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

sys_status.cpp: ignore sys_status mavlink messages from gimbals #1707

Merged
merged 1 commit into from
Feb 16, 2022

Conversation

amilcarlucas
Copy link
Contributor

@amilcarlucas amilcarlucas commented Feb 15, 2022

Without this gimbal reported errors are classified as UAV errors, and that is not good.

Copy link
Member

@vooon vooon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use C-style casts please.

@@ -761,6 +761,9 @@ class SystemStatusPlugin : public plugin::PluginBase

void handle_sys_status(const mavlink::mavlink_message_t *msg, mavlink::common::msg::SYS_STATUS &stat)
{
if ((mavlink::minimal::MAV_COMPONENT)msg->compid == mavlink::minimal::MAV_COMPONENT::COMP_ID_GIMBAL)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plase use static_cast & using.

using MC = mavlink::minimal::MAV_COMPONENT;

if (static_cast<MC>(msg->compid) == MC::COMP_ID_GIMBAL)
    return;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

@vooon vooon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks!

@vooon vooon merged commit 059dc72 into mavlink:master Feb 16, 2022
@amilcarlucas amilcarlucas deleted the ignore-gimbal-sys-status branch February 16, 2022 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants