Skip to content

Commit

Permalink
style(pre-commit): autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Nov 18, 2024
1 parent 8af553c commit 054597a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion common/autoware_control_center/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Publishes reports on the current status of registered Autoware nodes.
## Parameters

| Name | Type | Default Value | Description |
|-----------------------|----------|---------------|--------------------------------------------------------------------------|
| --------------------- | -------- | ------------- | ------------------------------------------------------------------------ |
| `deadline_ms` | `double` | `220.0` | Maximum duration to wait for a heartbeat before considering a node dead. |
| `report_publish_rate` | `double` | `1.0` | Frequency (in Hz) at which NodeReports are published. |

Expand Down
8 changes: 4 additions & 4 deletions common/autoware_node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ all the basic functions of it.
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.
Expand All @@ -52,12 +52,12 @@ Currently, only sends positive heartbeat messages.
Relevant parameters:

| 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.
- 🟡 `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.
Expand Down
18 changes: 9 additions & 9 deletions common/autoware_node/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ namespace autoware::node
{
Node::Node(
const std::string & node_name, const std::string & ns, const rclcpp::NodeOptions & options)
: LifecycleNode(node_name, ns, options),
sequence_number_{0},
is_registered_{false},
period_timer_register_ms_{declare_parameter<double>("period_timer_register_ms")},
period_heartbeat_ms_{declare_parameter<double>("period_heartbeat_ms")},
deadline_ms_{declare_parameter<double>("deadline_ms")}
: LifecycleNode(node_name, ns, options),
sequence_number_{0},
is_registered_{false},
period_timer_register_ms_{declare_parameter<double>("period_timer_register_ms")},
period_heartbeat_ms_{declare_parameter<double>("period_heartbeat_ms")},
deadline_ms_{declare_parameter<double>("deadline_ms")}
{
RCLCPP_DEBUG(
get_logger(), "Node %s constructor", get_node_base_interface()->get_fully_qualified_name());

rclcpp::QoS qos_profile(1);
qos_profile.liveliness(RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC)
.liveliness_lease_duration(std::chrono::duration<double, std::milli>(deadline_ms_))
.deadline(std::chrono::duration<double, std::milli>(deadline_ms_));
.liveliness_lease_duration(std::chrono::duration<double, std::milli>(deadline_ms_))
.deadline(std::chrono::duration<double, std::milli>(deadline_ms_));

pub_heartbeat_ = this->create_publisher<autoware_control_center_msgs::msg::Heartbeat>(
"~/heartbeat", qos_profile);
Expand Down Expand Up @@ -108,4 +108,4 @@ void Node::on_register(FutureRegister future)
is_registered_ = true;
RCLCPP_DEBUG(get_logger(), "Registration succeeded.");
}
} // namespace autoware::node
} // namespace autoware::node

0 comments on commit 054597a

Please sign in to comment.