mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 11:23:33 +08:00
vmount/mavlink: update gimbal information message
We should be using gimbal_manager_information and not gimbal_device_information. Plus, this updates the fields and flags according to the MAVLink changes.
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
|
||||
#include "input_mavlink.h"
|
||||
#include <uORB/Publication.hpp>
|
||||
#include <uORB/topics/gimbal_device_information.h>
|
||||
#include <uORB/topics/gimbal_manager_information.h>
|
||||
#include <uORB/topics/vehicle_roi.h>
|
||||
#include <uORB/topics/vehicle_command_ack.h>
|
||||
#include <uORB/topics/position_setpoint_triplet.h>
|
||||
@@ -470,29 +470,26 @@ void InputMavlinkGimbalV2::_stream_gimbal_manager_status()
|
||||
|
||||
void InputMavlinkGimbalV2::_stream_gimbal_manager_information()
|
||||
{
|
||||
gimbal_device_information_s gimbal_device_info;
|
||||
gimbal_device_info.timestamp = hrt_absolute_time();
|
||||
const char vendor_name[] = "PX4";
|
||||
const char model_name[] = "AUX gimbal";
|
||||
// TODO: Take gimbal_device_information into account.
|
||||
|
||||
strncpy((char *)gimbal_device_info.vendor_name, vendor_name, sizeof(gimbal_device_info.vendor_name));
|
||||
strncpy((char *)gimbal_device_info.model_name, model_name, sizeof(gimbal_device_info.model_name));
|
||||
gimbal_manager_information_s gimbal_manager_info;
|
||||
gimbal_manager_info.timestamp = hrt_absolute_time();
|
||||
|
||||
gimbal_device_info.firmware_version = 0;
|
||||
gimbal_device_info.capability_flags = 0;
|
||||
gimbal_device_info.capability_flags = gimbal_device_information_s::GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL |
|
||||
gimbal_device_information_s::GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK |
|
||||
gimbal_device_information_s::GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS |
|
||||
gimbal_device_information_s::GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK |
|
||||
gimbal_device_information_s::GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS |
|
||||
gimbal_device_information_s::GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK;
|
||||
gimbal_manager_info.cap_flags =
|
||||
gimbal_manager_information_s::GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL |
|
||||
gimbal_manager_information_s::GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK |
|
||||
gimbal_manager_information_s::GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS |
|
||||
gimbal_manager_information_s::GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK |
|
||||
gimbal_manager_information_s::GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS |
|
||||
gimbal_manager_information_s::GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK |
|
||||
gimbal_manager_information_s::GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL;
|
||||
|
||||
gimbal_device_info.pitch_max = M_PI_F / 2;
|
||||
gimbal_device_info.pitch_min = -M_PI_F / 2;
|
||||
gimbal_device_info.yaw_max = M_PI_F;
|
||||
gimbal_device_info.yaw_min = -M_PI_F;
|
||||
gimbal_manager_info.pitch_max = M_PI_F / 2;
|
||||
gimbal_manager_info.pitch_min = -M_PI_F / 2;
|
||||
gimbal_manager_info.yaw_max = M_PI_F;
|
||||
gimbal_manager_info.yaw_min = -M_PI_F;
|
||||
|
||||
_gimbal_device_info_pub.publish(gimbal_device_info);
|
||||
_gimbal_manager_info_pub.publish(gimbal_manager_info);
|
||||
}
|
||||
|
||||
int InputMavlinkGimbalV2::update_impl(unsigned int timeout_ms, ControlData **control_data, bool already_active)
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#include <uORB/Publication.hpp>
|
||||
#include <uORB/Subscription.hpp>
|
||||
#include <uORB/topics/gimbal_device_attitude_status.h>
|
||||
#include <uORB/topics/gimbal_device_information.h>
|
||||
#include <uORB/topics/gimbal_manager_information.h>
|
||||
#include <uORB/topics/gimbal_manager_status.h>
|
||||
#include <uORB/topics/vehicle_command.h>
|
||||
#include <uORB/topics/vehicle_roi.h>
|
||||
@@ -150,7 +150,7 @@ private:
|
||||
|
||||
uORB::Subscription _gimbal_device_attitude_status_sub{ORB_ID(gimbal_device_attitude_status)};
|
||||
uORB::Subscription _vehicle_global_position_sub{ORB_ID(vehicle_global_position)};
|
||||
uORB::Publication<gimbal_device_information_s> _gimbal_device_info_pub{ORB_ID(gimbal_device_information)};
|
||||
uORB::Publication<gimbal_manager_information_s> _gimbal_manager_info_pub{ORB_ID(gimbal_manager_information)};
|
||||
uORB::Publication<gimbal_manager_status_s> _gimbal_manager_status_pub{ORB_ID(gimbal_manager_status)};
|
||||
map_projection_reference_s _projection_reference = {}; ///< reference to convert (lon, lat) to local [m]
|
||||
uint8_t _cur_roi_mode = vehicle_roi_s::ROI_NONE;
|
||||
|
||||
Reference in New Issue
Block a user