Browse Source

AP_Mission: added truncate() function

Used when loading a mission while flying

Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
mission-4.1.18
Andrew Tridgell 11 years ago committed by Randy Mackay
parent
commit
107cc2c126
  1. 9
      libraries/AP_Mission/AP_Mission.cpp
  2. 3
      libraries/AP_Mission/AP_Mission.h

9
libraries/AP_Mission/AP_Mission.cpp

@ -113,6 +113,15 @@ bool AP_Mission::clear() @@ -113,6 +113,15 @@ bool AP_Mission::clear()
return true;
}
/// trucate - trunacte any mission items beyond index
void AP_Mission::truncate(uint16_t index)
{
if (_cmd_total > index) {
_cmd_total.set_and_save(index);
}
}
/// update - ensures the command queues are loaded with the next command and calls main programs command_init and command_verify functions to progress the mission
/// should be called at 10hz or higher
void AP_Mission::update()

3
libraries/AP_Mission/AP_Mission.h

@ -130,6 +130,9 @@ public: @@ -130,6 +130,9 @@ public:
/// returns true if mission was running so it could not be cleared
bool clear();
/// truncate - truncate any mission items beyond given index
void truncate(uint16_t index);
/// update - ensures the command queues are loaded with the next command and calls main programs command_init and command_verify functions to progress the mission
/// should be called at 10hz or higher
void update();

Loading…
Cancel
Save