Currently, there are great examples and documentation of offboard control and multi-vehicle control:
The issue is that there is no clear way to also launch PX4 in the launch scripts. Therefore, to launch 4 vehicles, the user needs to open 4 terminals to run PX4 using make. This becomes more challenging with more vehicles or with additional gazebo configuration.
So, I tried vehicle_gateway and it seems to me that it is exactly the kind of module that can facilitate entering the field of aerial robotics, as was discussed yesterday during the ROS Aerial working group.
It already has a PX4 package that allows to launch one or multiple instances of the PX4 autopilot, the uOrb ↔ DDS bridge and the Gazebo simulation.
However it uses micro_ros_agent, which is a wrapper of the MicroXRCEAgent. In my case, it fails when I launch px4_sim/launch/px4_sim.launch.py.
I tested vehicle_gateway with ROS2 Humble, Gazebo Garden and micro_ros_agent v3.0.4, and I suffer crashes of the micro_ros_agent with the following error :
[micro_ros_agent-3] terminate called after throwing an instance of 'std::bad_array_new_length'
The error also happen when I launch only the micro_ros_agent in one terminal and a PX4 instance in another one, so it doesn’t seems to be related to the vehicle_gateway repo.
Is this an issue only on my side, or is it for everyone ?
I tried to remove the micro_ros_agent node from the launch file and launched a MicroXRCEAgent separately, in another terminal. Everything works great in this case.
Anyway, we should make a choice on whether PX4 support vehicle gateway and it is the go-to method to launch PX4 and Gazebo using ROS2, or we add a new launch file directly in the PX4 project (that could be inspired by these ROS launch files).
My opinion is that it would be beneficial for newcomers that want to use ROS to have an easy way to integrate the PX4 Autopilot in their simulations, so I would push to use vehicle_gateway.
From what I’ve seen, Vehicle Gateway is in very active development, and from time to time the version from the main branch won’t work properly. Nevertheless, we’ve got our multi-robot setup working based on this version: Pin PX4 to most recent commit (#100) · osrf/vehicle_gateway@16e65ce · GitHub . It’s slightly old now given how fast the commits are coming to this repo, but for me, it works well.