-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
AP_UROS: factor out common ROS client code #25179
Draft
srmainwaring
wants to merge
16
commits into
ArduPilot:master
Choose a base branch
from
srmainwaring:prs/pr-micro-ros-common-templates
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
AP_UROS: factor out common ROS client code #25179
srmainwaring
wants to merge
16
commits into
ArduPilot:master
from
srmainwaring:prs/pr-micro-ros-common-templates
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 tasks
e918eaa
to
3ca6006
Compare
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> modules: update ardupliot_uros - Added mode_switch service interface for esp32 - Added mode_switch service interface for stm32. Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
- Add option --enable-uros. - Add define AP_UROS_ENABLED. Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> Tools: ros2: disable DSS in colcon build Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> Tools: ros2: update README Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
AP_UROS: search for micro-ROS client library in ardupilot_uros module Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add vector3 subscriber example - PoC - will only work for SITL / POSIX (must add use custom transport) Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: move init and create code into respective functions - Make rcl objects member variables. - Update checks macros to report to GCS. - Move rcl initialisation to init(). - Move subscriber creation to create(). Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add custom transport - Adapt UDP custom transport from AP_DDS. Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: enable custom transport Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add publisher example Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add publisher example - Send message to GCS. Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: include additional ROS message types Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add time publisher - Add time publisher. - Rename node to 'ardupilot_uros'. - Change timer period to 1 ms Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add publishers for local pose and twist Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add publishers for battery, clock, nav sat, static tf Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: clarify number of handles calculation Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: implement topic writers using code from AP_DDS - Strings and sequence values are not populated as memory must be allocated. Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add code for static transform from AP_DDS - Strings and sequence values are not populated as memory must be allocated. Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: manage memory for topic strings and sequences Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: only update nav sat fix on new data to match AP_DDS Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add subscriber to sensor_msgs/msg/Joy Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: remove demo subscriber to geometry_msgs/msg/Vector3 Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: update @todo formatting Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add function declarations for Ubuntu build Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: disable tf2_msgs for esp32 dev Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: move global variables into AP_UROS_Client class - Make singleton. - Make update_topic member function. - Add trampoline for thread task. - Move thread to core 1 and adjust priority. - Customise initialisation. Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: fix initialisation of local twist publisher Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: publish geopose, static_tf, and subscribe to tf Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: use trampoline functions for timer and message callbacks Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add arm motors service Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add parameter server Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add README Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: display parameter changes in GCS Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: implementation of custom serial transport - Note this is ESP32 specific. - Requires micro-ROS client library to be built for custom transport. - UART_NUM_2 not managed by AP_HAL - Return if publisher or subscriber initialisation fails Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: call uros_port->begin(0) to ensure thread owns port Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: support build for stm32 - disable param server Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: support both esp32 and stm32 Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add compile option for param server Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: update macros for debug and error messages Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: fix bug introduced into entity handle count Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: update print format specifier for TF message Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: enable UDP transport for SITL Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: update print format specifier for TF message Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add microros library distro options to wscript Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: fix library paths in wscript Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add stubs for mode switch service Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: implement arming service Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: implement mode switch service Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add stub for velocity control subscriber Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add classes adapted from AP_DDS to manage external control - Functions are stubs only. Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: adapt external control functions to micro-ROS message types Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: enable external odom in uros client Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: update GCS messages for services - Add UROS: prefix. Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: update README Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_ROS: add space after template keyword Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_ROS: add accessor templates for strings and a sequence of transforms Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_ROS: use accessor templates for strings in external control Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_ROS: add mutable versions of accessor templates Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_ROS: consolidate code for populating published messages Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_ROS: consolidate code for publishing nav sat fix Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_ROS: rename mutable transforms Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_ROS: use mutable transforms template for static transforms Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_ROS: fix formatting Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_ROS: add accessor templates for battery state Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_ROS: consolidate code for publishing battery state Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add specialisations for string and sequence accessors Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: adjust indentation Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add mutable versions of accessor templates Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: use common code from AP_ROS for published topics Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: consolidate code for publishing nav sat fix Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: delete code moved to AP_ROS Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: rename mutable transforms Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: consolidate code for publishing static transforms Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: move template specialisation definitions to cpp to prevent duplicate symbols Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_UROS: add accessor templates for battery state Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_DDS: use common code from AP_ROS for external control Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_DDS: use common code from AP_ROS for time type conversion Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_DDS: add mutable versions of accessor templates Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_DDS: use common code from AP_ROS for published topics Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_DDS: consolidate code for publishing nav sat fix Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_DDS: delete code moved to AP_ROS Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_DDS: rename mutable transforms Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_DDS: consolidate code for publishing static transforms Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_DDS: move template specialisation definitions to cpp to prevent duplicate symbols Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_DDS: fix formatting Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_DDS: add accessor templates for battery state Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> AP_DDS: consolidate code for publishing battery state Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
3ca6006
to
6560d16
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow up to #25154 that factors duplicate code from
AP_DDS
andAP_UROS
into a common libraryAP_ROS
.The functions are templated on the ROS message types because the ROS message interfaces generated for the XRCE-DDS-Client and micro-ROS are not the same. The method names are almost identical so templating allows the reading and writing to the message libraries to be duck-typed with the exception of string and sequences. These are handled by templated accessors with specialisations for the message types that are required (
String
,TFMessage
,BatteryState
).Dependencies