Proposal for providing a stable interface #3922
Replies: 4 comments 10 replies
-
These ideas were considered, but were not adopted for the following reasons.
|
Beta Was this translation helpful? Give feedback.
-
Hello @isamu-takagi san, I would like to ask some simple questions. I'm asking these just to understand, not to criticize. Let's assume we have adopted this feature for the entire Autoware, everything has integrated this feature as you've suggested. I see this brings the following: const auto interface = ComponentInterfaceManager(node);
pub = interface.create_publisher<InterfaceClass>();
sub = interface.create_subscription<InterfaceClass>(callback);
|
Beta Was this translation helpful? Give feedback.
-
I asked simulator developers to list the interfaces the simulator uses. We would like to discuss whether these topics and services should be defined as interfaces.
|
Beta Was this translation helpful? Give feedback.
-
I have created a task to implement this proposal. autowarefoundation/autoware.universe#6419 |
Beta Was this translation helpful? Give feedback.
-
Overview
With current Autoware, when a ROS message type changes, all packages that depend on that message must be updated. However, when the interface changes due to implementation reasons, it is inconvenient for the old interface to suddenly become unusable, so it is desirable to provide a transition period.
Also, since you don't know which interfaces are exposed, external components may use implementation-dependent private topics or services. Therefore, we need a way to distinguish between topics and services that are available externally.
Goals
Approach
Use REP-2007 Type Adaptation Feature to define the conversion between custom type and ROS message type, and use the custom type as an interface. This custom type does not change once it is released. This allows you to update the conversion function and maintain the interface even if you change the message.
Of course, you can also use ROS message type directly as before. The advantage of using custom type for interface is that you do not need to modify your code even if the ROS message type changes.
Packages
As shown in the figure below, create a package that defines the interface, and add the interface type and type adapter to it. The parts that need to be updated when the ROS message type is changed are shown in red.
Versioning
After the transition period expires, the old interface type will be removed. An example is shown below. The color of the bar in the diagram indicates that the message has changed. The length of the transition period is not determined here. The message maintainer will decide based on the situation.
Implementation
The sample code is here.
The interface specification package provides classes for abstracted interface generation. Use the interface as below through this class.
1 - Declare abstracted publisher/subscription.
2 - Create interface via interface generation class.
3 - Publish/subscribe using custom type.
Beta Was this translation helpful? Give feedback.
All reactions