Navigator: move disable camera trigger on mission inactivation to seperate function

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2023-06-08 10:36:19 +02:00
parent d9ae2ed7ac
commit c6870006c7
3 changed files with 17 additions and 10 deletions

View File

@ -161,14 +161,7 @@ Mission::on_inactive()
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;
_navigator->publish_vehicle_cmd(&cmd);
_navigator->disable_camera_trigger();
_navigator->stop_capturing_images();
_navigator->release_gimbal_control();

View File

@ -302,8 +302,10 @@ public:
void acquire_gimbal_control();
void release_gimbal_control();
void calculate_breaking_stop(double &lat, double &lon, float &yaw);
void stop_capturing_images();
void calculate_breaking_stop(double &lat, double &lon, float &yaw);
void stop_capturing_images();
void disable_camera_trigger();
void mode_completed(uint8_t nav_state, uint8_t result = mode_completed_s::RESULT_SUCCESS);

View File

@ -1527,6 +1527,18 @@ void Navigator::mode_completed(uint8_t nav_state, uint8_t result)
_mode_completed_pub.publish(mode_completed);
}
void Navigator::disable_camera_trigger()
{
// 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;
publish_vehicle_cmd(&cmd);
}
int Navigator::print_usage(const char *reason)
{
if (reason) {