How to use only velocity control in offboard mode?

I am trying to subscribe to “geometry_msgs/Twist” message and convert it into “px4_msgs/msg/TrajectorySetpoint” message. I only need to use vx and yaw speed in my differential drive robot.

I am successful to use “position=true” in “offboard_control_mode” and send the local setpoint through “px4_msgs/msg/TrajectorySetpoint” message.

I also successful to use “actuator=true” in “offboard_control_mode” and control the rover using “px4_msgs/msg/ActuatorControls0” message.

However, when I was publishing “px4_msgs/msg/TrajectorySetpoint” message with vx and yaw speed in 3.3 Hz. It failed. I sent “velocity=true” and “body_rate=true” through “offboard_control_mode” in 3.3 Hz together with the setpoint message but I cannot switch it to offboard mode.

How can we switch to offboard mode when only “velocity=true” and “body_rate=true” in the “offboard_control_mode” message? I already published the offboard message and the setpoint message in at least 2 Hz.

I am using Holybro Pixhawk 6c and Jetson Xavier NX.
I use Ros2 Foxy to send the uorb topic to Pixhawk through micrortps_client and micrortps_agent. There is no gps module on my pixhawk.

It is working in gazebo simulation but not wokring on the hardware.
Is it owing to the GPS module? I have no GPS module on the hardware pixhawk

According to the document, offboard mode need to drive with some sensor like GPS and VIO. Without those sensor, we cannot get the pose and attitude information of the robot. Therefore, the velocity control will not work in offboard mode without gps.

If you are inside you can use optical flow. =)