Setting PX4 parameters with ROS2?

Hello guys, I have a few questions regarding PX4 parameters.

For the context my goal is to simulate multiple drones in gazebo using ROS2 and px-4. I am using publisher_trajectory with position to send drones to a precise point in space. But I have some specifications on the maximum velocity and acceleration, that’s why I need to modify some of PX4 paremeters.

PX4 has a lot of parameters referenced. But I’ve not been able to find any example of code to change those parameters using ROS2. Is it even possible or do you need to modify them using PX4 framework ?

And, is it possible to set two different maximum velocities for two multicopters in the same simulation ( MPC_VEL_MANUAL parameter) ? For example, one drone set to a max velocity of 10m/s and the other one to 20m/s.

I’m quite new to the px4 and ROS2 environment, so if something I said is wrong do not hesitate to correct me.

Thank you in advance for your response :slight_smile:

Hi @Elliot , you can change PX4 parameters only using mavlink and mavros. Currently the direct ROS2 interface does not support this feature

Hi, from what I’ve gathered on the Internet, it seems that ros2 does have a VehicleCommand.msg for this specific purpose which is VehicleCommand::VEHICLE_CMD_DO_SET_PARAMETER, but this specific VehicleCommand is somehow not fully implemented into the ros2 environment yet, does anyone know if the px4 team have any plans of continuing development for parameters changing directly from ros2 or if this feature will ever be implemented?

Rather than not bein fullly implemented in ROS 2, VehicleCommand::VEHICLE_CMD_DO_SET_PARAMETER is not implemented in the PX4 side: all the command of VehicleCommand derive from the corresponding MAVLINK version. However, VEHICLE_CMD_DO_SET_PARAMETER is parsed direcly in the MAVLINK module making VehicleCommand::VEHICLE_CMD_DO_SET_PARAMETER “useless”.

Please feel free to open a feature request issue on GitHub or to comment on existing ones (if any).