I have a question about Flying a drone in offboard mode without GPS using ROS2 and GotoSetpoint. I am using the main branch on PX4-autopilot.
The problem is that a list of setpoints in WGS84 is generated and then someone takes a drone, put it “some where”, inserts the position in an app and press start/launch.
I have build an application able to fly the drone with and without GPS using gazabo sim
make px4_sitl gz_x500_flow and make px4_sitl gz_x500. They both sort of work.
The drone does start but the initial GPS position is not set, so the drone is just flying using NED local position, i.e. positions relative to the launch position. So far so good.
But the setpoints is fixed in a json file using WGS84 (lat/long) so my solution was to set the first coordinate as launch position. This works in a simulator but not in the real world. If the mission file is created before knowing where the drone launched another launch setpoint must be added or the GPS position should be sent the drone.
So I need to set the initial position of the launch position.
One solution is send the initial position using:
VehicleGlobalPosition, in “/fmu/in/aux_global_position” (question: I gees AUX_AGP_CTRL be enabled). but I think this solution require a periodic update.
And reference all set points to that position, i.e. calculate the NED position.
I have also seen methods using set estimate origin/home in QGraundControl but could not figure out how these is set using ROS2.
So, what is a good/correct method to set an initial launch position in WGS84?