-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
70 additions
and
33 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,72 @@ | ||
# Autoware Node | ||
|
||
## Abbreviations | ||
|
||
- **ACC:** Autoware Control Center | ||
- **AN:** Autoware Node | ||
- **HB:** Heartbeat | ||
|
||
## Overview | ||
|
||
Autoware Node is an Autoware.Core package designed to provide a base class for all future nodes in the system. It provides ability to register node to _Autoware_control_center_ (ACC), report node state, publish heartbeat and subscribe to monitored topics. It also inherits all lifecycle control capabilities of the base class [LifecycleNode](https://docs.ros2.org/latest/api/rclcpp_lifecycle/classrclcpp__lifecycle_1_1LifecycleNode.html) | ||
AN is an `autoware.core` package designed to provide a base class for all future nodes in the | ||
system. | ||
It provides ability to register node to ACC, report node state, publish heartbeats. | ||
It also inherits all lifecycle control capabilities of the base | ||
class [LifecycleNode](https://docs.ros2.org/latest/api/rclcpp_lifecycle/classrclcpp__lifecycle_1_1LifecycleNode.html) | ||
|
||
## Usage | ||
|
||
You can use _autoware_node_ as a base class for any node in Autoware.Core system. There is an example package _test_node_ which shows how _autoware_node_ communicate with ACC and other _autoware_nodes_. You can check it for more information. | ||
Check the [autoware_test_node](../autoware_test_node/README.md) package for an example of how to use `autoware::Node`. | ||
|
||
## Design | ||
|
||
_Autoware_node_ inherits from ROS 2 [_lifecycle_node_](https://design.ros2.org/articles/node_lifecycle.html) and has all basic functions of it. | ||
### Lifecycle | ||
|
||
Below are the main add-ons and how they work. | ||
AN inherits from ROS 2 [rclcpp_lifecycle::LifecycleNode](https://design.ros2.org/articles/node_lifecycle.html) and has | ||
all the basic functions of it. | ||
|
||
### Registration | ||
|
||
After startup each _autoware_node_ tries to register itself to ACC via a service call of _AutowareNodeRegister_. It happens in the dedicated timer. The timer will stop after the successful registration. | ||
Relevant parameters: | ||
|
||
| Parameter | Function | | ||
|----------------------------|------------------------------------------------------------------------| | ||
| `period_timer_register_ms` | The interval at which the AN periodically attempts to register itself. | | ||
|
||
Upon startup, AN starts a registration timer and periodically attempts to register itself to ACC via a service call. | ||
This registration timer runs asynchronously to the rest of the node's functionality. | ||
|
||
### De-registration | ||
Upon successful registration: | ||
|
||
If _autoware_node_ receives a request to it's _ControlCenterDeregister_ service. It will disable the flag _registered_ and it will startup timer which control registration client. | ||
- The registration timer is stopped. | ||
- ACC will create a subscription to the HB messages of AN. | ||
- ACC will return a UUID specific to the AN instance. | ||
|
||
### Error state | ||
|
||
_Autoware_node_ has `send_state` method to send it's state to ACC via _AutowareNodeError_ service. You need to provide `AutowareNodeState` and log message as parameters to the method. | ||
WIP. | ||
Currently, only sends positive heartbeat messages. | ||
|
||
### Heartbeat | ||
### Heartbeat (**HB**) | ||
|
||
The heartbeat publisher is configured to publish the heartbeat message each 200 ms. You can change it by the `period` parameter during the launch of _autoware_node_. Be aware that you will also need to configure ACC accordingly. | ||
Relevant parameters: | ||
|
||
Heartbeat functionality is based on ros2 [software_watchdogs](https://github.com/ros-safety/software_watchdogs) package. | ||
| Parameter | Function | | ||
|-----------------------|------------------------------------------------------------------------| | ||
| `deadline_ms` | If ACC doesn't receive a HB by this deadline, AN will be assumed dead. | | ||
| `period_heartbeat_ms` | AN is expected to publish a HB with this period. | | ||
|
||
* 🟡 `deadline_ms` should be slightly higher than `period_heartbeat_ms` to account for network delays. | ||
* 🔴 `deadline_ms` of AN should match the `deadline_ms` of ACC. | ||
|
||
Upon registration, AN starts a timer that periodically publishes HB messages to ACC. | ||
This HB timer runs asynchronously to the rest of the node's functionality. | ||
|
||
### Monitored subscription | ||
|
||
_Autoware_node_ provides the `create_monitored_subscription` method. It wraps around a standard `create_subscription` method and adds a function to monitor a frequency of messages received in the topic. If it violates the condition provided in the `hz` parameter of the method _autoware_node_ will send an error state to the ACC. | ||
WIP. | ||
|
||
## Credits | ||
|
||
- Heartbeat functionality is based on ROS 2 [software_watchdogs](https://github.com/ros-safety/software_watchdogs) | ||
package. |
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