mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-17 01:40:34 +08:00
Navigator: add set_gimbal_neutral() functionality
To point the gimbal forward eg during landing to reduce chance of damage. Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -65,6 +65,7 @@
|
||||
#include <uORB/Subscription.hpp>
|
||||
#include <uORB/SubscriptionInterval.hpp>
|
||||
#include <uORB/topics/geofence_result.h>
|
||||
#include <uORB/topics/gimbal_manager_set_attitude.h>
|
||||
#include <uORB/topics/home_position.h>
|
||||
#include <uORB/topics/mission.h>
|
||||
#include <uORB/topics/mission_result.h>
|
||||
@@ -276,6 +277,7 @@ public:
|
||||
|
||||
void acquire_gimbal_control();
|
||||
void release_gimbal_control();
|
||||
void set_gimbal_neutral();
|
||||
|
||||
void calculate_breaking_stop(double &lat, double &lon, float &yaw);
|
||||
|
||||
|
||||
@@ -1508,6 +1508,18 @@ void Navigator::disable_camera_trigger()
|
||||
publish_vehicle_cmd(&cmd);
|
||||
}
|
||||
|
||||
void Navigator::set_gimbal_neutral()
|
||||
{
|
||||
vehicle_command_s vcmd = {};
|
||||
vcmd.command = vehicle_command_s::VEHICLE_CMD_DO_GIMBAL_MANAGER_PITCHYAW;
|
||||
vcmd.param1 = NAN;
|
||||
vcmd.param2 = NAN;
|
||||
vcmd.param3 = NAN;
|
||||
vcmd.param4 = NAN;
|
||||
vcmd.param5 = gimbal_manager_set_attitude_s::GIMBAL_MANAGER_FLAGS_NEUTRAL;
|
||||
publish_vehicle_cmd(&vcmd);
|
||||
}
|
||||
|
||||
int Navigator::print_usage(const char *reason)
|
||||
{
|
||||
if (reason) {
|
||||
|
||||
Reference in New Issue
Block a user