Is it possible to set px4 params from roslaunch files?


I’m using MAVROS with px4 and I’m sending setpoints in OFFBOARD mode using the topic /mavros/setpoint_position/local, everything works fine. Now, I want to limit the max speed of the drone, I saw in this issue that this can be done by using the params MPC_XY_VEL_MAX and MPC_XY_CRUISE .

Is it possible to set this params in a roslaunch file? I tried using the following launch file but it doesn’t work, the drone speed doesn’t change.

  <include file="$(find px4)/launch/mavros_posix_sitl.launch">
      <env name="MPC_XY_CRUISE" value="3.1"/>
      <env name="MPC_XY_VEL_MAX" value="2"/>
      <arg name="respawn_gazebo" value="true"/>
      <arg name="respawn_mavros" value="true"/>

Maybe you can try using mavros param services or utility command to read all parameters and change the parameters you want

I set MPC_XY_VEL_MAX with the service /mavros/param/set and it worked. Thank you!

Glad to help! :smile: