When I launch the mavros_posix_sitl.launch
in px4, it always warns that:
"PositionTargetGlobal failed because no origin"
This leads to the inaccurate flight altitude of UAV in gazebo.
How to solve this problem? I have no idea.
When I launch the mavros_posix_sitl.launch
in px4, it always warns that:
"PositionTargetGlobal failed because no origin"
This leads to the inaccurate flight altitude of UAV in gazebo.
How to solve this problem? I have no idea.
This is due to PX4's EKF2 not having an origin set when starting the SITL.
Throught the mavlink console (if you dont have one started, just execute PX4-Autopilot/Tools/mavlink_shell.py pointing to the correct port), you can set a specific origin using the commander set_ekf_origin command and specifying the latitude, longitude and altitude, which will remove the warnings.
Once set, you can also save that origin by saving and loading your parameters.