Hi, everyone!
I have a PixHawk 5x (PX4), Raspberry Pi4 and quadrocopter.
I am planning to implement a transition from mission mode to offboard mode and back using the MAVSDK.
It will look like this: In mission mode, GPS is used, and in offboard mode, a tracking system (like ArUco). The drone flies using GPS, a co-computer recognizes the tracking system, switches the drone to offboard mode, flies into the building, executes the offboard program, then flies back out-door and switches to the mission mode, continuing the flight further to the next building, where everything is repeated.
To ensure a smooth transition from one coordinate system to another, I assume that I need to link them. I read: “PX4 do always correspondent transformation between global and local frames on the Firmware side.”
To pass the coordinates of the tracking system, I use:
mocap.set_vision_position_estimate (…);
for control in Offboard mode -
offboard.set_position_ned (…);
At the moment, in offboard mode in-door, everything works great…
And now some problems:
At: struct VisionPositionEstimate · MAVSDK Guide i see: PositionBody position_body {} - Global position (m)
But! In MAVSDK source code…
I see that the set_vision_position_estimate function refers to:
MAVSDK / src / third_party / mavlink / include / mavlink / v2.0 / common / mavlink_msg_vision_position_estimate.h with ID = 102 where local coordinates are used in meters.
102 != 101
ID = 101 global coordinates are used in meters.
MAVSDK/src/third_party/mavlink/include/mavlink/v2.0/common/mavlink_msg_global_vision_position_estimate.h
And so I have several questions:
-
position_body {} - Global position (m). Does this mean Global postition = GPS (lat / lon-> to_meters)?
-
Should I fix the bug (ID 102 to 101), or it doesn’t matter, or use mavsdk :: MavlinkPassthrough?
-
What is the best way to implement the transition from GPS to LocalNED? I noticed that when EKF2_AID_MASK = 24 GPS does not work, and when GPS is working set_vision_position_estimate does not work. Change EKF2_AID_MASK in flight? I think it’s not safe.
-
Perhaps the best way is to implement fakegps, with set parameter MAV_USEHILGPS?
-
Are there any links to completed projects with similar tasks?
Thank you for your attention!
Sorry for the english, this is google translator. )