Skip to content
Snippets Groups Projects
Commit 52ba62d6 authored by Lorenz Meier's avatar Lorenz Meier
Browse files

Navigator: Pause and unpause camera triggering on entering and exiting a mission

parent 447c167d
No related branches found
No related tags found
No related merge requests found
......@@ -141,10 +141,32 @@ Mission::on_inactive()
_work_item_type = WORK_ITEM_TYPE_DEFAULT;
}
void
Mission::on_inactivation()
{
// Disable camera trigger
vehicle_command_s cmd{};
cmd.command = vehicle_command_s::VEHICLE_CMD_DO_TRIGGER_CONTROL;
// Pause trigger
cmd.param1 = -1.0f;
cmd.param3 = 1.0f;
cmd.timestamp = hrt_absolute_time();
_navigator->publish_vehicle_cmd(cmd);
}
void
Mission::on_activation()
{
set_mission_items();
// unpause triggering if it was paused
vehicle_command_s cmd{};
cmd.command = vehicle_command_s::VEHICLE_CMD_DO_TRIGGER_CONTROL;
// unpause trigger
cmd.param1 = -1.0f;
cmd.param3 = 0.0f;
cmd.timestamp = hrt_absolute_time();
_navigator->publish_vehicle_cmd(cmd);
}
void
......
......@@ -72,6 +72,7 @@ public:
~Mission() override = default;
void on_inactive() override;
void on_inactivation() override;
void on_activation() override;
void on_active() override;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment