-
-
Notifications
You must be signed in to change notification settings - Fork 78
feat: initial ROS2 AsyncAPI contribution by SIEMENS AG #270
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
Open
gramss
wants to merge
13
commits into
asyncapi:master
Choose a base branch
from
gramss:master
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.
+332
−0
Open
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7872c4f
Initial ROS2 AsyncAPI contribution by SIEMENS AG. This was a team eff…
3d21380
Merge branch 'master' into master
asyncapi-bot f62254f
Merge branch 'asyncapi:master' into master
gramss a1e9876
feat: apply initial suggestions from Fran in the pull request
463fb3d
feat: update README with comments from the PR.
f6380c3
added message header definition and complete example
5e6bbc8
fix ros 2 typo
gramss 9654072
Update ros2/README.md
fmvilas 13162bf
Update ros2/README.md
fmvilas 766a870
Update ros2/README.md
fmvilas 167b15a
Update ros2/README.md
fmvilas 1c60da6
final touches to address gavanderhoorn concerns regarding different r…
d64de7a
add @amparo-siemens and me as codeowners of the ros2 binding
gramss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,185 @@ | ||
| # ROS 2 Bindings | ||
|
|
||
| This document defines how to describe ROS 2-specific information in AsyncAPI. | ||
|
|
||
| It applies to all versions of ROS 2 (foxy, galactic, humble, iron, jazzy). | ||
gramss marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| <a name="version"></a> | ||
|
|
||
| ## Version | ||
|
|
||
| Current version is `0.1.0`. | ||
|
|
||
| <a name="server"></a> | ||
|
|
||
| ## Server Binding Object | ||
|
|
||
| This object contains information about the server representation in ROS 2. | ||
| ROS 2 can use either DDS or Zenoh as its middleware. | ||
gramss marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| DDS is decentralized with no central server, so the field `host` can set to `localhost`. | ||
gramss marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| When using Zenoh, the `host` field specifies the Zenoh Router IP address. | ||
|
|
||
| ###### Fixed Fields | ||
|
|
||
| Field Name | Type | ROS 2 Versions | Description | ||
gramss marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ---|:---:|:---:|---| | ||
| `rmwImplementation` | string | all | Specifies the ROS 2 middleware implementation to be used. Valid values include `rmw_fastrtps_cpp` (Fast DDS), `rmw_cyclonedds_cpp` (Cyclone DDS), `rmw_connext_cpp` (RTI Connext), and `rmw_zenoh_cpp` (Zenoh). This determines the underlying middleware implementation that handles communication. | ||
gramss marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| `domainId` | integer | all | All ROS 2 nodes use domain ID 0 by default. To prevent interference between different groups of computers running ROS 2 on the same network, a group can be set with a unique domain ID. Must be a non-negative integer less than 232. | ||
gramss marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### Examples | ||
|
|
||
| ```yaml | ||
| servers: | ||
| ros2: | ||
| host: localhost | ||
| protocol: ros2 | ||
| protocolVersion: humble | ||
| bindings: | ||
| ros2: | ||
| rmwImplementation: rmw_fastrtps_cpp | ||
| domainId: 0 | ||
| ``` | ||
| <a name="channel"></a> | ||
| ## Channel Binding Object | ||
| A channel represents a ROS 2 topic, service or action interface. | ||
| This object DOES NOT contain any ROS 2 specific properties. | ||
| Example - ROS 2 topic: | ||
| ```yaml | ||
| address: /turtle1/cmd_vel | ||
| messages: | ||
| TwistMsg: | ||
| $ref: '#/components/messages/TwistMsg' | ||
gramss marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
| Example - ROS 2 action: | ||
| ```yaml | ||
| RotateAbsoluteRequest: | ||
| address: /turtle1/rotate_absolute | ||
| messages: | ||
| RotateAbsoluteActionRequest: | ||
| $ref: '#/components/messages/RotateAbsoluteActionRequest' | ||
|
|
||
| RotateAbsoluteReply: | ||
| address: /turtle1/rotate_absolute | ||
| messages: | ||
| RotateAbsoluteActionResult: | ||
| $ref: '#/components/messages/RotateAbsoluteActionResult' | ||
| RotateAbsoluteActionFeedback: | ||
| $ref: '#/components/messages/RotateAbsoluteActionFeedback' | ||
| ``` | ||
gramss marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <a name="operation"></a> | ||
| ## Operation Binding Object | ||
| AsyncAPI operations with their `send` and `receive` actions map directly to ROS 2 subscribers, publishers, actions or services. | ||
| - send -> `publisher`, `action_client`, `service_client` | ||
| - receive -> `subscriber`, `action_server`, `service_server` | ||
fmvilas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ###### Fixed Fields | ||
|
|
||
| Field Name | Type | ROS 2 Versions | Description | ||
gramss marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ---|:---:|:---:|---| | ||
| `type` | string | all | Specifies the ROS 2 type of the node for this operation. Valid values are: `publisher`, `subscriber`, `service_client`, `service_server`, `action_client`, `action_server`. This defines how the node will interact with the associated topic or action. | ||
fmvilas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| `node` | string | all | The name of the ROS 2 node that implements this operation. | ||
| `qosPolicies` | object | all | Quality of Service (QoS) for the topic. | ||
gramss marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### Quality of Service Object | ||
gramss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| This object contains ROS 2 specific information about the Quality of Service policies. | ||
| More information here: https://docs.ros.org/en/jazzy/Concepts/Intermediate/About-Quality-of-Service-Settings.html#qos-policies | ||
|
|
||
| Field Name | Type | ROS 2 Versions | Description | ||
gramss marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ---|:---:|:---:|---| | ||
| `reliability` | string | all | One of `best_effort` or `reliable`. More information here: [ROS 2 QoS](https://docs.ros.org/en/jazzy/Concepts/Intermediate/About-Quality-of-Service-Settings.html#qos-policies) | ||
| `history` | string | all | One of `keep_last`, `keep_all` or `unknown`. More information here: [ROS 2 QoS](https://docs.ros.org/en/jazzy/Concepts/Intermediate/About-Quality-of-Service-Settings.html#qos-policies) | ||
| `durability` | string | all | One of `transient_local` or `volatile`. More information here: [ROS 2 QoS](https://docs.ros.org/en/jazzy/Concepts/Intermediate/About-Quality-of-Service-Settings.html#qos-policies) | ||
| `lifespan` | integer | all | The maximum amount of time between the publishing and the reception of a message without the message being considered stale or expired. `-1` means infinite. | ||
| `deadline` | integer | all | The expected maximum amount of time between subsequent messages being published to a topic. `-1` means infinite. | ||
| `liveliness` | string | all | One of `automatic`or `manual`. More information here: [ROS 2 QoS](https://docs.ros.org/en/jazzy/Concepts/Intermediate/About-Quality-of-Service-Settings.html#qos-policies) | ||
gramss marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| `leaseDuration` | integer | all | the maximum period of time a publisher has to indicate that it is alive before the system considers it to have lost liveliness. `-1` means infinite. | ||
gramss marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ### Examples | ||
|
|
||
| ROS 2 subscriber example: | ||
|
|
||
| ```yaml | ||
| receiveCmdVel: | ||
| action: receive | ||
| channel: | ||
| $ref: "#/channels/CmdVel" | ||
| bindings: | ||
| ros2: | ||
| role: subscriber | ||
fmvilas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| node: /turtlesim | ||
| qosPolicies: | ||
| history: unknown | ||
| reliability: reliable | ||
| durability: volatile | ||
| lifespan: -1 | ||
| deadline: -1 | ||
| liveliness: automatic | ||
| leaseDuration: -1 | ||
| ``` | ||
| ROS 2 action Server example: | ||
|
|
||
| ```yaml | ||
| receiveRotateAbsolute: | ||
| action: receive | ||
| channel: | ||
| $ref: "#/channels/RotateAbsoluteRequest" | ||
| reply: | ||
| channel: | ||
| $ref: "#/channels/RotateAbsoluteReply" | ||
| bindings: | ||
| ros2: | ||
| role: action_server | ||
| node: /turtlesim | ||
| ``` | ||
|
|
||
gramss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| <a name="message"></a> | ||
|
|
||
| ## Message Binding Object | ||
|
|
||
| ROS 2 message types (defined in .msg/.srv/.aciton files) are mapped to AsyncAPI message payloads. | ||
gramss marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| This object DOES NOT contain any ROS 2 specific properties. | ||
|
|
||
| ```yaml | ||
| Vector3Msg: | ||
| type: object | ||
| properties: | ||
| x: | ||
| type: number | ||
| format: double | ||
| y: | ||
| type: number | ||
| format: double | ||
| z: | ||
| type: number | ||
| format: double | ||
| ``` | ||
gramss marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ROS 2 Type | AsyncAPI Type | AsyncAPI Format | | ||
fmvilas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ---|:---:|---| | ||
| bool | boolean | boolean | ||
| byte | string | octet | ||
| char | integer | uint8 | ||
| float32 | number | float | ||
| float64 | number | double | ||
| int8 | integer | int8 | ||
| uint8 | integer | uint8 | ||
| int16 | integer | int16 | ||
| uint16 | integer | uint16 | ||
| int32 | integer | int32 | ||
| uint32 | integer | uint32 | ||
| int64 | integer | int64 | ||
| uint64 | integer | uint64 | ||
| string | string | string | ||
| array | array | -- | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.