Open edbyy opened 3 years ago
What state is the vehicle in when you move it? Which mode? Is it armed or disarmed? Are you sending MAV_CMD_NAV_TAKEOFF
or simply switching the vehicle to takeoff mode?
@dagar I tried moving it in manual and position modes, always disarmed. I tried launching it with commander takeoff
as well as using the mavsdk command drone.getAction().takeoff()
which I believe sends MAV_CMD_NAV_TAKEOFF
?
Do you happen to have a log? https://logs.px4.io/
Here is another log, this one shows the second flight on the same battery; it was flown once, landed, then another takeoff was triggered without moving the drone from where it landed and it still shot back without locking on to the new position: https://review.px4.io/plot_app?log=a15d9457-1ab1-4c2f-baee-30f668b91319
It seems that it's just simply going back to (0, 0). I've been digging through the code to try and understand how takeoff works so pardon if this is a dumb question as I'm still wrapping my head around it all, but is this where the takeoff position is set? https://github.com/PX4/PX4-Autopilot/blob/v1.11.3/src/modules/navigator/navigator_main.cpp#L344:L386 It seems to only use latitude and longitude which means during takeoff no other position sources besides GPS are used? This might explain the issue I'm experiencing.
Describe the bug Not sure if this is intended behavior or not but I’ve noticed that when moving the vehicle after initialization but prior to takeoff it will always try to return to the position it was initialized at instead of where the takeoff command was triggered. So basically I put the drone down, let Pixhawk initialize, then when everything is running and ready to fly I move the drone say a meter to the left, then when I trigger a takeoff command the drone will fly 1 meter back to the right. It happens every time in all directions. I am able to replicate this in SITL if I move the model a short enough distance that it doesn’t cause the position estimate to fail and reset. Upon takeoff the drone will immediately tilt and travel in the direction it was originally located at. For reference I am controlling the drone through mavlink using only VIO without a GPS.
To Reproduce
Expected behavior Drone should lock on to current position where takeoff mode was triggered.