From 557fd3d99bc02acb53e3716f1fafb6ccb16a705f Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 2 Dec 2015 09:15:11 +0100 Subject: [PATCH] Navigation: Turn mission item into packed struct and make nav_cmd compiler-independent --- src/modules/navigator/navigation.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/navigator/navigation.h b/src/modules/navigator/navigation.h index d23a20c5ff..e6b8a68281 100644 --- a/src/modules/navigator/navigation.h +++ b/src/modules/navigator/navigation.h @@ -81,6 +81,7 @@ enum ORIGIN { * This is the position the MAV is heading towards. If it of type loiter, * the MAV is circling around it with the given loiter radius in meters. */ +#pragma pack(push, 1) struct mission_item_s { bool altitude_is_relative; /**< true if altitude is relative from start point */ double lat; /**< latitude in degrees */ @@ -89,19 +90,19 @@ struct mission_item_s { float yaw; /**< in radians NED -PI..+PI, NAN means don't change yaw */ float loiter_radius; /**< loiter radius in meters, 0 for a VTOL to hover */ int8_t loiter_direction; /**< 1: positive / clockwise, -1, negative. */ - enum NAV_CMD nav_cmd; /**< navigation command */ + unsigned nav_cmd; /**< navigation command */ float acceptance_radius; /**< default 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 seconds */ float pitch_min; /**< minimal pitch angle for fixed wing takeoff waypoints */ bool autocontinue; /**< true if next waypoint should follow after this one */ - enum ORIGIN origin; /**< where the waypoint has been generated */ + unsigned origin; /**< where the waypoint has been generated */ int do_jump_mission_index; /**< index where the do jump will go to */ unsigned do_jump_repeat_count; /**< how many times do jump needs to be done */ unsigned do_jump_current_count; /**< count how many times the jump has been done */ int actuator_num; /**< actuator number to be set 0..5 ( corresponds to AUX outputs 1..6 */ int actuator_value; /**< new value for selected actuator in ms 900...2000 */ }; - +#pragma pack(pop) #include /**