Replies: 3 comments 6 replies
-
|
Go beyond! |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the detailed proposal and the PoC, @Koichi98 ! This is great work and a promising direction for reducing DDS overhead. Regarding your discussion points:
No. If However, as you can see, all Autoware Core packages (apart from the ones directly under the ROS build farm) are under the So I'd suggest either:
Yes, the wrapper can be placed under |
Beta Was this translation helpful? Give feedback.
-
|
Hey @Koichi98, awesome proposal! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
Note: This discussion uses "DDS" to refer to the concrete middleware, but the issues described (discovery overhead, middleware thread CPU consumption) apply to the RMW layer in general.
Currently, autoware_agnocast_wrapper provides macro-level wrappers for Pub/Sub operations (AUTOWARE_CREATE_PUBLISHER, AUTOWARE_CREATE_SUBSCRIPTION, etc.), allowing build-time switching between Agnocast and ROS 2 via the ENABLE_AGNOCAST environment variable. The node itself is always rclcpp::Node.
This proposal extends the wrapper to add support for agnocast::Node.
What is agnocast::Node?
agnocast::Node is a Node class that is implemented without inheriting from rclcpp::Node. It provides an interface equivalent to rclcpp::Node (get_logger(), declare_parameter(), get_clock(), create_publisher(), create_subscription(), etc.), but internally it does not create a DDS participant at all.
In other words, it can be used as a node that does not participate in DDS and communicates exclusively through Agnocast.
This provides the following benefits:
Proposed Changes
We propose extending common/autoware_agnocast_wrapper by adding an autoware::agnocast_wrapper::Node class. This class holds both rclcpp::Node and agnocast::Node internally and switches between them at runtime based on the ENABLE_AGNOCAST environment variable.
The specific changes are as follows:
- Holds both rclcpp::Node and agnocast::Node internally and delegates to the appropriate one based on the result of use_agnocast()
- Wraps common APIs such as parameters, logger, clock, and callback groups
- Pub/Sub creation is also provided as methods of the Node class
- Publisher, Subscription, and PollingSubscriber are refactored into abstract base classes with separate Agnocast and ROS 2 subclasses
- In agnocast mode: uses agnocast::init() + AgnocastOnlySingleThreadedExecutor
- In rclcpp mode: uses rclcpp::init() + rclcpp::executors::SingleThreadedExecutor as before
- Note: The current PoC template only supports SingleThreadedExecutor, but support for MultiThreadedExecutor is planned.
A proof-of-concept implementation of the modified autoware_agnocast_wrapper is available here: Koichi98/autoware.universe#3
Discussion Points
Is it appropriate to absorb this extension in common/autoware_agnocast_wrapper (universe)?
- When using this in Autoware Core, is it acceptable to depend on a common package in universe?
- Or should the wrapper be placed on the core side?
Also, please feel free to comment if you have any other concerns.
Reference
Beta Was this translation helpful? Give feedback.
All reactions