# Stabilize and depth-hold modes are not working with SITL properly

**URL:** <https://discuss.bluerobotics.com/t/stabilize-and-depth-hold-modes-are-not-working-with-sitl-properly/3076>\
**Category:** ArduSub\
**Tags:** sitl, simulate\
**Created:** [July 29, 2018, 9:00pm UTC](https://discuss.bluerobotics.com/t/stabilize-and-depth-hold-modes-are-not-working-with-sitl-properly/3076 "2018-07-29T21:00:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShehabAldeen](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@ShehabAldeen](https://discuss.bluerobotics.com/u/ShehabAldeen)\
**Post date:** [July 29, 2018, 9:00pm UTC](https://discuss.bluerobotics.com/t/stabilize-and-depth-hold-modes-are-not-working-with-sitl-properly/3076/1 "2018-07-29T21:00:30Z")

</div>

Hello,

I am using SITL with ArduSub, the firmware boots in manual mode but before arming the vehicle I am initializing the rc channels to 1500 `rc all 1500` so the ROV is stable after that, if I changed the mode to stabilize or depth-hold the ROV start to move randomly and rotate around itself.  
I have mavros running with the SITL simulator the /mavros/rc/override and the /mavros/rc/in are having values of 1500 in all channels  
but the /mavros/rc/out is changing randomly!!

---

<div class="post-metadata">

**Author:** ![jwalser](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/jwalser/32/2234_2.png) [@jwalser](https://discuss.bluerobotics.com/u/jwalser)\
**Post date:** [August 1, 2018, 4:41pm UTC](https://discuss.bluerobotics.com/t/stabilize-and-depth-hold-modes-are-not-working-with-sitl-properly/3076/2 "2018-08-01T16:41:42Z")

</div>

Version Version Version. When you are getting developer help or debugging with other developers, it is always important to mention the version of the software that you are working with.

I have no problems and cannot reproduce your issue on ArduSub STABLE v3.5.3:

```auto
MANUAL> rc all 1500
MANUAL> arm throttle
MANUAL> APM: Arming motors
Got MAVLink msg: COMMAND_ACK {command : 400, result : 0}
ARMED
Arming checks disabled
mode stabilize
MANUAL> Got MAVLink msg: COMMAND_ACK {command : 11, result : 0}
STABILIZE> Mode STABILIZE
mode alt_hold
STABILIZE> Got MAVLink msg: COMMAND_ACK {command : 11, result : 0}
ALT_HOLD> Mode ALT_HOLD

```

---

<div class="post-metadata">

**Author:** ![patrickelectric](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/patrickelectric/32/2162_2.png) [@patrickelectric](https://discuss.bluerobotics.com/u/patrickelectric)\
**Post date:** [August 2, 2018, 4:47pm UTC](https://discuss.bluerobotics.com/t/stabilize-and-depth-hold-modes-are-not-working-with-sitl-properly/3076/3 "2018-08-02T16:47:57Z")

</div>

Hi,

I’m using the last version of ArduSub and mavros and everything is working fine here also.

```auto
#rostopic echo /mavros/rc/out
---
header: 
  seq: 198
  stamp: 
    secs: 1533228095
    nsecs: 428080505
  frame_id: ''
channels: [1500, 1500, 1500, 1500, 1500, 1500, 0, 0]
---

```

---

<div class="post-metadata">

**Author:** ![ShehabAldeen](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@ShehabAldeen](https://discuss.bluerobotics.com/u/ShehabAldeen)\
**Post date:** [August 5, 2018, 6:59am UTC](https://discuss.bluerobotics.com/t/stabilize-and-depth-hold-modes-are-not-working-with-sitl-properly/3076/4 "2018-08-05T06:59:41Z")

</div>

I don’t what was the problem but after going to ‘Frame Setup’ and pressing ‘Load vehicle default parameters’ I got everything working fine

by the way, I have never changed any parameter

---

<div class="post-metadata">

**Author:** ![ShehabAldeen](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@ShehabAldeen](https://discuss.bluerobotics.com/u/ShehabAldeen)\
**Post date:** [August 5, 2018, 7:00am UTC](https://discuss.bluerobotics.com/t/stabilize-and-depth-hold-modes-are-not-working-with-sitl-properly/3076/5 "2018-08-05T07:00:16Z")

</div>

Thank you guys for your help everything is working fine now

---

<div class="post-metadata">

**Author:** ![yuzo-san](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/yuzo-san/32/3620_2.png) [@yuzo-san](https://discuss.bluerobotics.com/u/yuzo-san)\
**Post date:** [February 23, 2019, 3:43pm UTC](https://discuss.bluerobotics.com/t/stabilize-and-depth-hold-modes-are-not-working-with-sitl-properly/3076/6 "2019-02-23T15:43:47Z")

</div>

@ShehabAldeen @jwalser  
I was wondering, were you using ArduSub stable version or 3.6 dev version for this test?

Because I’m having problems running SITL with gazebo using Ardusub stable version. Can’t seem to be able to link it to the gazebo simulation and it doesn’t seem to have the gazebo-bluerov2 frame which worked with with me with gazebo in ardusub-dev-3.6

> SIM\_VEHICLE: Run MavProxy  
> SIM\_VEHICLE: “mavproxy.py” “–master” “tcp:127.0.0.1:5760” “–sitl” “127.0.0.1:5501” “–out” “127.0.0.1:14550” “–out” “127.0.0.1:14551” “–out” “udp:0.0.0.0:14550” “–console”  
> RiTW: Starting ArduSub : /home/yuzo-san/ardupilot/build/sitl/bin/ardusub -S -I0 --home -35.363261,149.165230,584,353 --model bluerov2 --speedup 1  
> Connect tcp:127.0.0.1:5760 source\_system=255  
> [Errno 111] Connection refused sleeping  
> [Errno 111] Connection refused sleeping  
> [Errno 111] Connection refused sleeping  
> [Errno 111] Connection refused sleeping  
> Failed to connect to tcp:127.0.0.1:5760 : [Errno 111] Connection refused  
> SIM\_VEHICLE: MAVProxy exited  
> SIM\_VEHICLE: Killing tasks

This is the error I’m getting
