refactor(gimbal): drop unused external manager info topic to fit flash

The ROI forwarding path only needs GIMBAL_MANAGER_STATUS from an external
manager: it provides discovery (manager sysid/compid, gimbal device id) and
control ownership. GIMBAL_MANAGER_INFORMATION only added capability flags and
angle limits, which nothing uses until RC forwarding (deferred).

Carrying the extra uORB topic and its receiver handler pushed the tightest
board variant over its flash budget (ark_pi6x_encrypted_logs overflowed by
500 bytes). Drop the external_gimbal_manager_information topic; discovery and
ownership come from the status topic. It can return with RC, which actually
needs the angle limits.

Signed-off-by: Julian Oes <julian@oes.ch>
This commit is contained in:
Julian Oes committed 2026-09-22 15:15:30 +12:00
1 parent e3cf1e7163
commit e16fbcc2f9
6 files changed
+3 -79

No files matched your search

-1
View File
@@ -88,7 +88,6 @@ set(msg_files
EstimatorStatus.msg
EstimatorStatusFlags.msg
versioned/Event.msg
ExternalGimbalManagerInformation.msg
ExternalGimbalManagerStatus.msg
FigureEightStatus.msg
FailsafeFlags.msg
-23
View File
@@ -1,23 +0,0 @@
# External Gimbal Manager information
#
# Information about a gimbal manager running on another component (not us),
# decoded from an incoming GIMBAL_MANAGER_INFORMATION message. Used to discover
# external gimbal managers and their capabilities.
uint64 timestamp # [us] Time since system start
uint8 manager_sysid # [-] System id of the external gimbal manager
uint8 manager_compid # [-] Component id of the external gimbal manager
uint32 cap_flags # GIMBAL_MANAGER_CAP_FLAGS bitmask
uint8 gimbal_device_id # Gimbal device managed by this manager
float32 roll_min # [rad]
float32 roll_max # [rad]
float32 pitch_min # [rad]
float32 pitch_max # [rad]
float32 yaw_min # [rad]
float32 yaw_max # [rad]
+2 -17
View File
@@ -52,7 +52,6 @@ void OutputToGimbalManager::update(const ControlData &control_data, bool new_set
const hrt_abstime now = hrt_absolute_time();
_update_manager_info();
_update_manager_status();
if (!_manager_found) {
@@ -115,20 +114,6 @@ void OutputToGimbalManager::update(const ControlData &control_data, bool new_set
}
}
void OutputToGimbalManager::_update_manager_info()
{
external_gimbal_manager_information_s information;
if (_information_sub.update(&information)) {
if (!_manager_found) {
_manager_found = true;
_manager_sysid = information.manager_sysid;
_manager_compid = information.manager_compid;
_gimbal_device_id = information.gimbal_device_id;
}
}
}
void OutputToGimbalManager::_update_manager_status()
{
external_gimbal_manager_status_s status;
@@ -137,8 +122,8 @@ void OutputToGimbalManager::_update_manager_status()
_status = status;
_status_valid = true;
// The status is streamed periodically, so it also works as a discovery
// source if we haven't received the information message.
// The status is streamed periodically, so we use it to discover the
// manager as well as to track control ownership.
if (!_manager_found) {
_manager_found = true;
_manager_sysid = status.manager_sysid;
@@ -39,7 +39,6 @@
#include <uORB/Subscription.hpp>
#include <uORB/topics/vehicle_command.h>
#include <uORB/topics/gimbal_manager_set_pitchyaw.h>
#include <uORB/topics/external_gimbal_manager_information.h>
#include <uORB/topics/external_gimbal_manager_status.h>
namespace gimbal
@@ -67,13 +66,11 @@ private:
InControl // the manager reports us as primary control
};
void _update_manager_info();
void _update_manager_status();
bool _have_primary_control() const;
void _send_configure(bool acquire);
void _publish_set_pitchyaw();
uORB::Subscription _information_sub{ORB_ID(external_gimbal_manager_information)};
uORB::Subscription _status_sub{ORB_ID(external_gimbal_manager_status)};
uORB::Publication<gimbal_manager_set_pitchyaw_s> _set_pitchyaw_pub{ORB_ID(gimbal_manager_set_pitchyaw)};
uORB::Publication<vehicle_command_s> _vehicle_command_pub{ORB_ID(vehicle_command)};
+1 -32
View File
@@ -364,10 +364,6 @@ MavlinkReceiver::handle_message(mavlink_message_t *msg)
handle_message_gimbal_device_attitude_status(msg);
break;
case MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION:
handle_message_gimbal_manager_information(msg);
break;
case MAVLINK_MSG_ID_GIMBAL_MANAGER_STATUS:
handle_message_gimbal_manager_status(msg);
break;
@@ -3703,7 +3699,7 @@ MavlinkReceiver::handle_message_gimbal_device_attitude_status(mavlink_message_t
}
void
MavlinkReceiver::handle_message_gimbal_manager_information(mavlink_message_t *msg)
MavlinkReceiver::handle_message_gimbal_manager_status(mavlink_message_t *msg)
{
// Ignore our own gimbal manager: PX4 streams this itself from the autopilot
// component, and we only care about external gimbal managers here.
@@ -3711,33 +3707,6 @@ MavlinkReceiver::handle_message_gimbal_manager_information(mavlink_message_t *ms
return;
}
mavlink_gimbal_manager_information_t information_msg;
mavlink_msg_gimbal_manager_information_decode(msg, &information_msg);
external_gimbal_manager_information_s information{};
information.timestamp = hrt_absolute_time();
information.manager_sysid = msg->sysid;
information.manager_compid = msg->compid;
information.cap_flags = information_msg.cap_flags;
information.gimbal_device_id = information_msg.gimbal_device_id;
information.roll_min = information_msg.roll_min;
information.roll_max = information_msg.roll_max;
information.pitch_min = information_msg.pitch_min;
information.pitch_max = information_msg.pitch_max;
information.yaw_min = information_msg.yaw_min;
information.yaw_max = information_msg.yaw_max;
_external_gimbal_manager_information_pub.publish(information);
}
void
MavlinkReceiver::handle_message_gimbal_manager_status(mavlink_message_t *msg)
{
// Ignore our own gimbal manager (see handle_message_gimbal_manager_information).
if (msg->sysid == mavlink_system.sysid && msg->compid == mavlink_system.compid) {
return;
}
mavlink_gimbal_manager_status_t status_msg;
mavlink_msg_gimbal_manager_status_decode(msg, &status_msg);
-3
View File
@@ -83,7 +83,6 @@
#include <uORB/topics/gimbal_device_information.h>
#include <uORB/topics/gimbal_device_attitude_status.h>
#include <uORB/topics/rtcm_data.h>
#include <uORB/topics/external_gimbal_manager_information.h>
#include <uORB/topics/external_gimbal_manager_status.h>
#include <uORB/topics/home_position.h>
#include <uORB/topics/input_rc.h>
@@ -240,7 +239,6 @@ private:
void handle_message_gimbal_manager_set_manual_control(mavlink_message_t *msg);
void handle_message_gimbal_device_information(mavlink_message_t *msg);
void handle_message_gimbal_device_attitude_status(mavlink_message_t *msg);
void handle_message_gimbal_manager_information(mavlink_message_t *msg);
void handle_message_gimbal_manager_status(mavlink_message_t *msg);
void handle_message_global_position_sensor(mavlink_message_t *msg);
#if defined(MAVLINK_MSG_ID_RANGING_BEACON)
@@ -352,7 +350,6 @@ private:
uORB::Publication<gimbal_manager_set_manual_control_s> _gimbal_manager_set_manual_control_pub{ORB_ID(gimbal_manager_set_manual_control)};
uORB::Publication<gimbal_device_information_s> _gimbal_device_information_pub{ORB_ID(gimbal_device_information)};
uORB::Publication<gimbal_device_attitude_status_s> _gimbal_device_attitude_status_pub{ORB_ID(gimbal_device_attitude_status)};
uORB::Publication<external_gimbal_manager_information_s> _external_gimbal_manager_information_pub{ORB_ID(external_gimbal_manager_information)};
uORB::Publication<external_gimbal_manager_status_s> _external_gimbal_manager_status_pub{ORB_ID(external_gimbal_manager_status)};
uORB::Publication<irlock_report_s> _irlock_report_pub{ORB_ID(irlock_report)};
uORB::Publication<landing_target_pose_s> _landing_target_pose_pub{ORB_ID(landing_target_pose)};