mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 15:33:34 +08:00
Navigation: Turn mission item into packed struct and make nav_cmd compiler-independent
This commit is contained in:
@@ -81,6 +81,7 @@ enum ORIGIN {
|
|||||||
* This is the position the MAV is heading towards. If it of type loiter,
|
* 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.
|
* the MAV is circling around it with the given loiter radius in meters.
|
||||||
*/
|
*/
|
||||||
|
#pragma pack(push, 1)
|
||||||
struct mission_item_s {
|
struct mission_item_s {
|
||||||
bool altitude_is_relative; /**< true if altitude is relative from start point */
|
bool altitude_is_relative; /**< true if altitude is relative from start point */
|
||||||
double lat; /**< latitude in degrees */
|
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 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 */
|
float loiter_radius; /**< loiter radius in meters, 0 for a VTOL to hover */
|
||||||
int8_t loiter_direction; /**< 1: positive / clockwise, -1, negative. */
|
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 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 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 */
|
float pitch_min; /**< minimal pitch angle for fixed wing takeoff waypoints */
|
||||||
bool autocontinue; /**< true if next waypoint should follow after this one */
|
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 */
|
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_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 */
|
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_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 */
|
int actuator_value; /**< new value for selected actuator in ms 900...2000 */
|
||||||
};
|
};
|
||||||
|
#pragma pack(pop)
|
||||||
#include <uORB/topics/mission.h>
|
#include <uORB/topics/mission.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user