I am designing an autopilot boat using jetson nano and pixhawk4. The pixhawk4 and the jetson nano are communicating through ros2 and micrortps. The pixhawk4 is uploaded with fmu-v5_rtps. The firmware used by the pixhawk4 is rover and the pixhawk4 is already calibrated. It can access to mission mode and set point using QGoundControl.
I directly test the offboard control mode on the jetson nano with only pixhawk 4 and GPS module because I cannot build the simulator on my jetson nano.
I used the ros2 offboard control ROS 2 Offboard Control Example provided by the PX4 official document. It ran without any error. (It said that offboard control mode was started and the arm command was sent)
In order to check whether the pixhawk4 is in offboard control mode. I made a new node in the ros2 to subscribe to these messages, “vehicle_control_mode” and “veihcle_status”. These two messages are matched successfully when micrortps_agent is used. They can keep printing the subscribed data from these two topics.
After that, I ran the offboard_control.cpp in the px4_ros_com. However, nothing changed in the published data of “vehicle_control_mode” and “vehicle_status”. “flag_armed” and “flag_control_offboard_enabled” from topic “vehicle_control_mode” are always false. “arming_state” of “vehicle_status” was always 1 even after offboard_control had been ran.
Is there some situation preventing the pixhawk4 to arm, switch to offboard mode and setpoint? It was not connected with any power board, sensor and motor. It was only connected to the jetson through usb and dev/ttyTHS1. It was also connected with a GPS module and the GPS module was hung outside my room in order to receive gps signal. It can receive gps signal successfully through topic “vehicle_gps_position”.
Therefore, I have no idea why the flag of “vehicle_control_mode” does not change. If it is not the right way to check the flight mode of the vehicle. Then, what should be the right way to check the setpoint and the offboard control mode?