I am trying to use SITL with Mavros to send rc override commands, something really simple. But it is not working. The funny thing is that I am using a program that was working before (in December 2021), so I guess it is probably something related to software versions. Since then, I upgrade my OS packages (ubuntu 20.04) and the ardupilot repo to use the current master version (I also tried with arduSub-stable, and a version from commit 37a1b32).
Basically, I am doing the following things:
Set mode to âMANUALâ
Arm motors
Publish override msg into the /mavros/rc/override topic, like channels: [1500, 1500, 1500, 1500, 1700, 1500, 1500, 1500, 1500, 1100, 1500, 0, 0, 0, 0, 0, 0, 0]
The result is that the vehicle is in MANUAL mode, the motors get armed but it does not move.
Am I missing anything? Any specific versions I should use?
This gets printed in the console (not sure if it is relevant) Got MISSION_ACK: TYPE_RALLY: UNSUPPORTED
I havenât used SITL much, and havenât used mavros at all, so Iâve asked the software team to take a look at this in case they know whatâs likely going on
It would likely be useful if you can specify the ArduSub version youâre simulating, and how youâre running your code.
and rally points are part of missions, so it seems odd to me that theyâre apparently being used, especially if youâre trying to manually control the simulated vehicle.
Separately, does it work if you wait for a while? If so you might be facing something similar to this.
Iâm not familiar with the workflow. Changing params is configuration, which Iâd generally expect to happen before operation rather than during live control. Assuming you use a more standard GCS application for initialisation and then hand off control to mavros once the vehicle is configured and armed, couldnât the application continue to receive and log MAVLink messages but allow mavros to take on the role of the GCS?
And how can I do that? Setting sytem_id to 255? Something like this?
ros2 param set mavros system_id 255
or for ros1 rosparam set /mavros/target_system_id 255
EDIT:
So, I figure out that I can set the fcu_url as udp://:14551@:14555/?ids=255,240 and then it works. I am not sure why the value 240, I understand that 255 is the GCS sys_id.
I found the answer here
EDIT 2:
At least it worked for ROS1, but it didnât work for ROS2 using this command to run mavros: ros2 run mavros mavros_node --ros-args --param fcu_url:=udp://:14551@:14555/?ids=255,240
I like the idea of quickly moving quickly between manual and [external] automated control. So it seems handy to have both mavros and QGC connected if possible.
I just learned that mavros will act as a proxy, with connections to both the FCU and GCS, e.g.:
which file in your workspace did you edit exactly? I commented out the lines you mentioned in the âGCS_Common.cppâ file in my ros2 workspace, then I built again the workspace, however nothing seems to happen.
cd ~/ardupilot
./waf configure --board sitl
./waf sub
And the typical ROS2 workspace build:
cd ~/colcon_ws/src
colcon build
I suppose it should be possible to embed the ardupilot directory in colcon_ws/src, and then have colcon call waf via a CMake file, but I have not tried this.