aboutsummaryrefslogtreecommitdiff
path: root/src/modules/navigator/mission.h
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-09-03 21:18:32 +0200
committerThomas Gubler <thomasgubler@gmail.com>2014-09-03 21:30:56 +0200
commit5a35d20b7ba7f13356050096024c416235ba7a1a (patch)
treecec65ef947c3c2c80a1de3ca8fff7e543d31e307 /src/modules/navigator/mission.h
parent2761f98ab639c6e3737829adef179b372d9facce (diff)
downloadpx4-firmware-5a35d20b7ba7f13356050096024c416235ba7a1a.tar.gz
px4-firmware-5a35d20b7ba7f13356050096024c416235ba7a1a.tar.bz2
px4-firmware-5a35d20b7ba7f13356050096024c416235ba7a1a.zip
FOH mode for altitude
This introduces a parameter for the navigator. When enabled the navigator publishes a first order old (FOH) type altitude setpoint instead of the default zero order hold. For takeoff and landing the FOH mode is not active. The FOH altitude is calculated such that the sp reaches the altitude of the waypoint when the system is at a horizontal distance equal to the acceptance radius. Also the altitude setpoint will only converge towards the waypoint altitude but never diverge.
Diffstat (limited to 'src/modules/navigator/mission.h')
-rw-r--r--src/modules/navigator/mission.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/modules/navigator/mission.h b/src/modules/navigator/mission.h
index 4da6a1155..f7d12da70 100644
--- a/src/modules/navigator/mission.h
+++ b/src/modules/navigator/mission.h
@@ -36,6 +36,7 @@
* Navigator mode to access missions
*
* @author Julian Oes <julian@oes.ch>
+ * @author Thomas Gubler <thomasgubler@gmail.com>
*/
#ifndef NAVIGATOR_MISSION_H
@@ -75,6 +76,11 @@ public:
virtual void on_active();
+ enum mission_altitude_mode {
+ MISSION_ALTMODE_ZOH = 0,
+ MISSION_ALTMODE_FOH =1
+ };
+
private:
/**
* Update onboard mission topic
@@ -103,6 +109,16 @@ private:
void set_mission_items();
/**
+ * Updates the altitude sp to follow a foh
+ */
+ void altitude_sp_foh_update();
+
+ /**
+ * Resets the altitude sp foh logic
+ */
+ void altitude_sp_foh_reset();
+
+ /**
* Read current or next mission item from the dataman and watch out for DO_JUMPS
* @return true if successful
*/
@@ -136,6 +152,7 @@ private:
control::BlockParamInt _param_onboard_enabled;
control::BlockParamFloat _param_takeoff_alt;
control::BlockParamFloat _param_dist_1wp;
+ control::BlockParamInt _param_altmode;
struct mission_s _onboard_mission;
struct mission_s _offboard_mission;
@@ -157,7 +174,13 @@ private:
bool _inited;
bool _dist_1wp_ok;
- MissionFeasibilityChecker missionFeasiblityChecker; /**< class that checks if a mission is feasible */
+ MissionFeasibilityChecker _missionFeasiblityChecker; /**< class that checks if a mission is feasible */
+
+ float _min_current_sp_distance_xy; /**< minimum distance which was achieved to the current waypoint */
+ float _mission_item_previous_alt; /**< holds the altitude of the previous mission item,
+ can be replaced by a full copy of the previous mission item if needed*/
+ float _distance_current_previous; /**< distance from previous to current sp in pos_sp_triplet,
+ only use if current and previous are valid */
};
#endif