forked from Archive/PX4-Autopilot
Waypoints: Get time inside WP radius right
This commit is contained in:
parent
f351afe3f6
commit
b3c6574500
|
@ -76,7 +76,7 @@ void map_mavlink_mission_item_to_mission_item(const mavlink_mission_item_t *mavl
|
|||
mission_item->loiter_direction = (mavlink_mission_item->param3 > 0) ? 1 : -1; /* 1 if positive CW, -1 if negative CCW */
|
||||
mission_item->nav_cmd = NAV_CMD_WAYPOINT; // TODO correct
|
||||
mission_item->radius = mavlink_mission_item->param1;
|
||||
mission_item->time_inside = mavlink_mission_item->param2;
|
||||
mission_item->time_inside = mavlink_mission_item->param2 / 1e3f; /* from milliseconds to seconds */
|
||||
}
|
||||
|
||||
void map_mission_item_to_mavlink_mission_item(const struct mission_item_s *mission_item, const uint16_t seq, mavlink_mission_item_t *mavlink_mission_item)
|
||||
|
@ -89,7 +89,7 @@ void map_mission_item_to_mavlink_mission_item(const struct mission_item_s *missi
|
|||
mavlink_mission_item->param3 = mission_item->loiter_radius*(float)mission_item->loiter_direction;
|
||||
mavlink_mission_item->command = MAV_CMD_NAV_WAYPOINT; // TODO add
|
||||
mavlink_mission_item->param1 = mission_item->radius;
|
||||
mavlink_mission_item->param2 = mission_item->time_inside;
|
||||
mavlink_mission_item->param2 = mission_item->time_inside * 1e3f; /* from seconds to milliseconds */
|
||||
|
||||
mavlink_mission_item->seq = seq;
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ struct mission_item_s
|
|||
int8_t loiter_direction; /**< 1: positive / clockwise, -1, negative. */
|
||||
enum NAV_CMD nav_cmd; /**< true if loitering is enabled */
|
||||
float radius; /**< radius in which the mission is accepted as reached in meters */
|
||||
float time_inside; /**< time that the MAV should stay inside the radius before advancing in milliseconds */
|
||||
float time_inside; /**< time that the MAV should stay inside the radius before advancing in seconds */
|
||||
};
|
||||
|
||||
struct mission_s
|
||||
|
|
Loading…
Reference in New Issue