I am using ROS with onboard Intel NUC and want to execute the following sequence of commands (using the older firmware i.e. without avoidance feature):
mission mode → offboard → mission mode(continue from last waypoint)
I am using set_mode mavros service to switch modes from OFFBOARD to AUTO.MISSION and the other way.
While switching from AUTO.MISSION to OFFBOARD, the copter goes back to the planned home location before completely switching to offboard mode while the state shows offboard mode?
Any ideas to prevent this and why this is happening?
In offboard mode it should hold its current position and irrespective of what the offboard setpoint is, it flies back to home position leaving the mission . As soon as set_mode OFFBOARD service is called, the /mavros/state shows OFFBOARD mode but still it is flying back to home position.