How to set MPC_XY_VEL_MAX parameter on MavSdk C++ API

Hi there,

I am trying to navigate the drone in Offboard mode using “set_position_ned” method.
I also want to limit the maximum velocity of the vehicle. I tried to use “set_maximum_speed” method of Action plugin. But this method adjusts the “MPC_XY_CRUISE” parameter and does not limit the velocity the way I need. Is there a way to set “MPC_XY_VEL_MAX” parameter using MavSdk C++ API?

The steps I performed and the results I have observed is as follows:

  1. I limit the horizontal velocity to 7m/s using “set_maximum_speed” method.

  2. In QGroundControl, I verify that MPC_XY_CRUISE is set to 7m/s and MPC_XY_VEL_MAX is still set to 12 m/s.

  3. When I control the drone using “set_position_ned” method, I observe that the drone is moving with velocity of 12 m/s.

  4. When I command “Return” to the vehicle from QGC, I observe that the vehicle returns with velocity of 7 m/s.

From this experiment, I understand that I need to set the MPC_XY_VEL_MAX parameter instead of MPC_XY_CRUISE and this is not the case when I use “set_maximum_speed” method.

Could anyone help me about this issue?

Thanks in advance,

Did you try to change the parameter MPC_XY_VEL_MAX value using MAVSDK Param plugin ?

Not sure if it is recommended to change parameter in flight though

1 Like

Yes @Katawan, I can change it using the Param plugin.
I verified the results in QGroundControl and this suggestioon solves my problem.
Thank you very much.

Note: I am not planning to change this parameter during flight. I need to change it when the vehicle is on ground.