Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCS_MAVLink: Fix for the Gopro/Solo Gimbal issue #23861

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion libraries/GCS_MAVLink/MAVLink_routing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ routing table.
*/
bool MAVLink_routing::check_and_forward(GCS_MAVLINK &in_link, const mavlink_message_t &msg)
{
#if HAL_SOLO_GIMBAL_ENABLED
// check if a Gopro is connected. If yes, we allow the routing
// of mavlink messages to a private channel (Solo Gimbal case)
if (!gopro_status_check && (msg.msgid == MAVLINK_MSG_ID_GOPRO_HEARTBEAT)) {
gopro_status_check = true;
gcs().send_text(MAV_SEVERITY_NOTICE, "GoPro in Solo gimbal detected");
}
#endif // HAL_SOLO_GIMBAL_ENABLED

// handle the case of loopback of our own messages, due to
// incorrect serial configuration.
if (msg.sysid == mavlink_system.sysid &&
Expand Down Expand Up @@ -139,7 +148,14 @@ bool MAVLink_routing::check_and_forward(GCS_MAVLINK &in_link, const mavlink_mess
bool process_locally = match_system && match_component;

// don't ever forward data from a private channel
if (from_private_channel) {
// unless a Gopro camera is connected to a Solo gimbal
bool should_process_locally = from_private_channel;
#if HAL_SOLO_GIMBAL_ENABLED
if (gopro_status_check) {
should_process_locally = false;
}
#endif
if (should_process_locally) {
return process_locally;
}

Expand Down
3 changes: 3 additions & 0 deletions libraries/GCS_MAVLink/MAVLink_routing.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,7 @@ class MAVLink_routing
void handle_heartbeat(GCS_MAVLINK &link, const mavlink_message_t &msg);

void send_to_components(const char *pkt, const mavlink_msg_entry_t *entry, uint8_t pkt_len);

// check for Gopro in Solo gimbal status
bool gopro_status_check; // default is none
};