hardware: “holybro pixhawk 6c”
air frame: “aion r1 rover”
firmware: px4_v1.14
I am trying to receive “geometry_msgs/msg/Twist” data from nav2 and convert the linear velocities and angular velocities into “px4_msgs/msg/TrajectorySetpoint”.
I am trying to use offboard velocity control. Therefore, I kept publishing “px4_msgs/msg/offboard_control_mode” from my jetson with only true value in velocity.
I tested it with px4_sitl.
I have read the source code, I know that the yawspeed of trajectory_setpoint will not be used anywhere.
For the linear velocity, I put it into the velocity array of trajectory_setpoint.
The rover will only output linear velocity x and angular velocity z (yaw speed).
When the linear velocity x is positive, the rover goes forward and turned right simultaneously.
When the linear velocity x is negative, the rover goes forward and turned left simultaneously.
The angular velocity z cannot affect the rover in px4_sitl because the yawspeed of TrajectorySetpoint is not used in the source code for rover. Offboard body rates control is also not available for rover.
It means that the rover is not able to go straight forward and backward currently. It is also not able to rotate itself in offboard velocity control.
Is there any better way to convert “geometry_msgs/Twist” into px4 offboard control input?
Could somebody with px4 + nav2 experience give me some recommendation?