[ros2] How to set maximum velocity during offboard control mode

I am currently using PX4-ROS2 bridge to control my vehicle in offboard control mode. I am successful to get the gps location using uorb message “vehicle_gps_position” and set destination using uorb message “trajectory_setpoint”.

After that, I want to modify the maximum velocity of the vehicle through webpage when it is moving. However, I cannot find any related uorb message which can control the maximum velocity of the vehicle.

I tried the uorb message “vehicle_constraints” to control the maximum xy velocity of the vehicle but it did not have any response.

Apart from that, I am using the “vel_m_s” of uorb message “vehicle_gps_position” to observe the ground velocity of the vehicle. However, I don’t think gps velocity is accurate. I think it will affect the result of the testing of the maximum velocity control. Is there any better method to monitor the velocity of the vehicle?

I test everything using simulator “make px4_sitl_rtps gazebo_boat”.

My questions:

  1. How can we set maximum velocity of the vehicle in offboard mode using ros2?
  2. Instead of gps ground velocity, how can I monitor the velocity of the vehicle? (Is it possible to monitor the velocity using the sensors on the Holybro Pixhawk 4?)