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 Dec 6, 2024
1 parent cb12bfa commit 8df3df5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
12 changes: 6 additions & 6 deletions system/redundancy_switcher_interface/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ The availability converter subscribes `/system/operation_mode/availability` and

### Interface

| Interface Type | Interface Name | Data Type | Description |
| -------------- | ------------------------------------- | -------------------------------------------------- | ----------------------------- |
| subscriber | `/system/operation_mode/availability` | `tier4_system_msgs/msg/OperationModeAvailability` | Usable behavior of the ego. |
| subscriber | `/vehicle/status/mrm_state` | `autoware_vehicle_msgs/msg/ControlModeReport` | Ego control mode. |
| udp sender | none | `struct Availability` | Combination of the above two. |
| Interface Type | Interface Name | Data Type | Description |
| -------------- | ------------------------------------- | ------------------------------------------------- | ----------------------------- |
| subscriber | `/system/operation_mode/availability` | `tier4_system_msgs/msg/OperationModeAvailability` | Usable behavior of the ego. |
| subscriber | `/vehicle/status/mrm_state` | `autoware_vehicle_msgs/msg/ControlModeReport` | Ego control mode. |
| udp sender | none | `struct Availability` | Combination of the above two. |

## mrm converter

Expand Down Expand Up @@ -42,7 +42,7 @@ The log converter receive udp packets into a structure called `ElectionCommuni
| udp receiver | none | `struct ElectionCommunication` | messages among election nodes. |
| udp receiver | none | `struct ElectionStatus` | Leader Election status. |
| publisher | `/system/election/communication` | `tier4_system_msgs/msg/ElectionCommunication` | messages among election nodes. |
| publisher | `/system/election/status` | `autoware_adapi_v1_msgs/msg/MrmState` | Leader Election status. |
| publisher | `/system/election/status` | `autoware_adapi_v1_msgs/msg/MrmState` | Leader Election status. |
| publisher | `/system/fail_safe/over_all/mrm_state` | `autoware_adapi_v1_msgs/msg/mrm_state` | System-wide MRM status. |

## Parameters
Expand Down
8 changes: 6 additions & 2 deletions system/redundancy_switcher_interface/script/relay_to_sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,15 @@ def operation_mode_state_callback(self, msg):
if msg.mode == 2:
self.operation_mode_autonomous_state = True
if self.tmp_operation_mode_autonomous_state != self.operation_mode_autonomous_state:
self.get_logger().info(f"Operation mode changed: {self.operation_mode_autonomous_state}")
self.get_logger().info(
f"Operation mode changed: {self.operation_mode_autonomous_state}"
)
else:
self.operation_mode_autonomous_state = False
if self.tmp_operation_mode_autonomous_state != self.operation_mode_autonomous_state:
self.get_logger().info(f"Operation mode changed: {self.operation_mode_autonomous_state}")
self.get_logger().info(
f"Operation mode changed: {self.operation_mode_autonomous_state}"
)

def trajectory_callback(self, msg):
if self.autonomous_mode or self.operation_mode_autonomous_state == False:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ void AvailabilityConverter::setSubscriber()
node_->create_callback_group(rclcpp::CallbackGroupType::MutuallyExclusive, false);
rclcpp::SubscriptionOptions control_mode_options = rclcpp::SubscriptionOptions();
control_mode_options.callback_group = control_mode_callback_group_;
auto not_executed_callback = []([[maybe_unused]] const typename autoware_vehicle_msgs::msg::
ControlModeReport::ConstSharedPtr msg) {};
auto not_executed_callback =
[]([[maybe_unused]] const typename autoware_vehicle_msgs::msg::ControlModeReport::ConstSharedPtr
msg) {};

sub_operation_mode_availability_ =
node_->create_subscription<tier4_system_msgs::msg::OperationModeAvailability>(
"~/input/operation_mode_availability", qos,
std::bind(&AvailabilityConverter::convertToUdp, this, std::placeholders::_1),
availability_options);

sub_control_mode_ =
node_->create_subscription<autoware_vehicle_msgs::msg::ControlModeReport>(
"~/input/control_mode", qos, not_executed_callback, control_mode_options);
sub_control_mode_ = node_->create_subscription<autoware_vehicle_msgs::msg::ControlModeReport>(
"~/input/control_mode", qos, not_executed_callback, control_mode_options);
}

void AvailabilityConverter::convertToUdp(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ class AvailabilityConverter
std::unique_ptr<UdpSender<Availability>> udp_availability_sender_;
rclcpp::CallbackGroup::SharedPtr availability_callback_group_;
rclcpp::CallbackGroup::SharedPtr control_mode_callback_group_;
rclcpp::Subscription<autoware_vehicle_msgs::msg::ControlModeReport>::SharedPtr
sub_control_mode_;
rclcpp::Subscription<autoware_vehicle_msgs::msg::ControlModeReport>::SharedPtr sub_control_mode_;
rclcpp::Subscription<tier4_system_msgs::msg::OperationModeAvailability>::SharedPtr
sub_operation_mode_availability_;
};
Expand Down

0 comments on commit 8df3df5

Please sign in to comment.