I am using ROS2 foxy and fastRTPS.
I implemented a ROS2 node to control PX4 in offboard mode based on global setpoints. Simply it gets GPS coordinates of the desired setpoints and converts them to local NED points then sends them over the position_setpoint_triplet message. A setpoint is considered reached when:
1- the XY distance between the current location of the multirotor and the goal setpoint is less than a certain threshold (currently 0.5m).
2- The Z distance between the current location of the multirotor and the goal setpoint is less than a certain threshold (currently 0.25m).
In a nutshell, I am trying to “simulate” the mission mode from ROS2 using the offboard mode.
The issue that I am having is that the multirotor sometimes keeps hovering around the setpoint until ROS signals that it is reached and sometimes overshoots a bit after the setpoint.
How can I adjust the trajectory to make it smoother as in the mission mode?
Maybe Jaeyoung-Lim could help?