mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:36:48 +08:00
Navigator: move disable camera trigger on mission inactivation to seperate function
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -161,14 +161,7 @@ Mission::on_inactive()
|
|||||||
void
|
void
|
||||||
Mission::on_inactivation()
|
Mission::on_inactivation()
|
||||||
{
|
{
|
||||||
// Disable camera trigger
|
_navigator->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->stop_capturing_images();
|
_navigator->stop_capturing_images();
|
||||||
_navigator->release_gimbal_control();
|
_navigator->release_gimbal_control();
|
||||||
|
|
||||||
|
|||||||
@@ -303,7 +303,9 @@ public:
|
|||||||
void release_gimbal_control();
|
void release_gimbal_control();
|
||||||
|
|
||||||
void calculate_breaking_stop(double &lat, double &lon, float &yaw);
|
void calculate_breaking_stop(double &lat, double &lon, float &yaw);
|
||||||
|
|
||||||
void stop_capturing_images();
|
void stop_capturing_images();
|
||||||
|
void disable_camera_trigger();
|
||||||
|
|
||||||
void mode_completed(uint8_t nav_state, uint8_t result = mode_completed_s::RESULT_SUCCESS);
|
void mode_completed(uint8_t nav_state, uint8_t result = mode_completed_s::RESULT_SUCCESS);
|
||||||
|
|
||||||
|
|||||||
@@ -1527,6 +1527,18 @@ void Navigator::mode_completed(uint8_t nav_state, uint8_t result)
|
|||||||
_mode_completed_pub.publish(mode_completed);
|
_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)
|
int Navigator::print_usage(const char *reason)
|
||||||
{
|
{
|
||||||
if (reason) {
|
if (reason) {
|
||||||
|
|||||||
Reference in New Issue
Block a user