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

Add support for EVENT messages #1922

Merged
merged 5 commits into from
Nov 15, 2023
Merged

Conversation

Vicidel
Copy link

@Vicidel Vicidel commented Nov 8, 2023

Hello all, working with PX4 we are starting to use EVENT instead of STATUS_TEXT for more details over the status of the autopilot. For this we needed to have the EVENT messages bridged to ROS2. This is my implementation, taking input from other people to have it merged in upstream mavros

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.

Overall looks good, just a few things.

mavros/src/plugins/sys_status.cpp Show resolved Hide resolved
mavros_msgs/CMakeLists.txt Show resolved Hide resolved
evt_msg.header.stamp = node->now();
evt_msg.severity = severity;
evt_msg.px4_id = px4_id;
evt_msg.event_time_boot_ms = eventm.event_time_boot_ms;
Copy link
Member

Choose a reason for hiding this comment

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

Usually time boot used to calculate header's time stamp.

Copy link
Author

Choose a reason for hiding this comment

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

Done in new commit

@@ -1010,10 +1010,10 @@ class SystemStatusPlugin : public plugin::Plugin
process_event_normal(severity, px4_id, eventm.arguments);

auto evt_msg = mavros_msgs::msg::StatusEvent();
evt_msg.header.stamp = node->now();
evt_msg.header.stamp.sec = event_time_boot_ms / 1000;
evt_msg.header.stamp.nanosec = (event_time_boot_ms % 1000) * 1000000;
Copy link
Member

Choose a reason for hiding this comment

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

rclcpp::Time synchronise_stamp(uint32_t time_boot_ms);

Copy link
Author

Choose a reason for hiding this comment

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

oh that's nice, added a commit for this

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 52a164e into mavlink:ros2 Nov 15, 2023
0 of 3 checks passed
@Vicidel
Copy link
Author

Vicidel commented Nov 15, 2023

Perfect, thank you!

@Vicidel Vicidel deleted the pr-event-messages branch November 15, 2023 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants