-
Notifications
You must be signed in to change notification settings - Fork 994
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
Adding OpenDroneID plugin and messages #2002
base: ros2
Are you sure you want to change the base?
Conversation
In ros2 you have You can run tests using |
@@ -111,6 +111,7 @@ add_library(mavros_extras_plugins SHARED | |||
src/plugins/obstacle_distance.cpp | |||
src/plugins/odom.cpp | |||
src/plugins/onboard_computer_status.cpp | |||
src/plugins/open_drone_id.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part of file must be generated by cog script. Please do not change this blocks manually.
<description>@brief Open Drone ID plugin | ||
@plugin open_drone_id | ||
|
||
Sends Open Drone ID data to the FCU</description> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same - cog extracts metadata from special plugin comments. Do not change manually.
operator_id.operator_id_type = msg->operator_id_type; | ||
|
||
size_t length = std::min(operator_id.operator_id.size(), msg->operator_id.size()); | ||
std::memcpy(operator_id.operator_id.data(), msg->operator_id.data(), length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use mavlink::set_string()
or set_string_z()
.
Example:
mavros/mavros/src/plugins/param.cpp
Line 277 in 0632e97
mavlink::set_string(ret.param_id, param_id); |
system.category_eu = msg->category_eu; | ||
system.class_eu = msg->class_eu; | ||
system.operator_altitude_geo = msg->operator_altitude_geo; | ||
system.timestamp = msg->timestamp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to see a cog script here...
msg/OpenDroneID/OperatorID.msg | ||
msg/OpenDroneID/SelfID.msg | ||
msg/OpenDroneID/System.msg | ||
msg/OpenDroneID/SystemUpdate.msg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same - code generated list.
uint8 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1 | ||
uint8 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2 | ||
uint8 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3 | ||
uint8 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/mavlink/mavros/blob/ros2/mavros_cog.py#L217
I'd prefer to remove unneded prefix - anyway it'll be namespaced into msg class.
Oh, and as i remember - idl do not recognize subdirs, so you must move messages to msg dir, just with prefix. |
Adds a plugin to receive OpenDroneID mavros messages and send the data to the FCU. Messages based on Open Drone ID MAVLink spec.
Looking at the contributing guidelines, it recommends to uncrustify and test, but it looks like the guidelines are out of date as the uncrustify config no longer exists in tools/, and it recommends testing with catkin which is no longer used for ROS2. What is the recommended method for uncrustifying and testing?
Tested using Ardupilot, confirmed that messages are received and broadcasted by Ardupilot Open Drone ID infrastructure.