Experimental simple_offboard/navigate_after_armed parameter

If this parameter is on, /navigate service waits until copter is armed, before starts to move the position setpoint
This commit is contained in:
Oleg Kalachev
2018-03-05 21:42:48 +03:00
parent d4efa58388
commit 0256deef66

View File

@@ -79,6 +79,7 @@ AUTO_OFFBOARD = rospy.get_param('~auto_offboard', True)
AUTO_ARM = AUTO_OFFBOARD and rospy.get_param('~auto_arm', True)
OFFBOARD_TIMEOUT = rospy.Duration(rospy.get_param('~offboard_timeout', 3))
ARM_TIMEOUT = rospy.Duration(rospy.get_param('~arm_timeout', 5))
NAVIGATE_AFTER_ARMED = rospy.Duration(rospy.get_param('~navigate_after_armed', False))
TRANSFORM_TIMEOUT = rospy.Duration(rospy.get_param('~transform_timeout', 3))
SETPOINT_RATE = rospy.get_param('~setpoint_rate', 30)
@@ -162,6 +163,9 @@ def get_publisher_and_message(req, stamp, continued=True, update_frame=True):
current_nav_start = pose.pose.position
current_nav_start_stamp = stamp
if NAVIGATE_AFTER_ARMED and not state.armed:
current_nav_start_stamp = stamp
setpoint = get_navigate_setpoint(stamp, current_nav_start, current_nav_finish.pose.position,
current_nav_start_stamp, req.speed)