Skip to content

Commit

Permalink
modify: spellcheck
Browse files Browse the repository at this point in the history
Signed-off-by: TetsuKawa <[email protected]>
  • Loading branch information
TetsuKawa committed Jun 24, 2024
1 parent 53e43a2 commit 4a0bd0e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions system/leader_election_converter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ The log converter receive udp packets into a structure called `ElectionCommuni

| Interface Type | Interface Name | Data Type | Description |
| -------------- | -------------------------------------- | --------------------------------------------- | ------------------------------- |
| udp receiver | none | `struct ElectionCommunication` | messages amoung election nodes. |
| 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 amoung election nodes. |
| publisher | `/system/election/communication` | `tier4_system_msgs/msg/ElectionCommunication` | messages among election nodes. |
| publisher | `/system/election/status` | `tier4_system_msgs/msg/MrmState` | Leader Election status. |
| publisher | `/system/fail_safe/over_all/mrm_state` | `autoware_adapi_v1_msgs/msg/mrm_state` | System-wode MRM status. |
| publisher | `/system/fail_safe/over_all/mrm_state` | `autoware_adapi_v1_msgs/msg/mrm_state` | System-wide MRM status. |

## Parameters

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<launch>
<arg name="param_file" default="$(find-pkg-share leader_election_converter)/config/leader_electioin_converter.param.yaml"/>
<arg name="param_file" default="$(find-pkg-share leader_election_converter)/config/leader_election_converter.param.yaml"/>
<arg name="input_control_mode" default="/vehicle/status/control_mode"/>
<arg name="input_operation_mode_availability" default="/system/operation_mode/availability"/>
<arg name="input_mrm_state" default="/system/fail_safe/mrm_state"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"properties": {
"availability_dest_ip": {
"type": "string",
"description": "IP address of the destination of avaialability",
"description": "IP address of the destination of availability",
"default": "127.0.0.1"
},
"availability_dest_port": {
"type": "string",
"description": "Port of the destination of avaialability",
"description": "Port of the destination of availability",
"default": "9000"
},
"mrm_state_dest_ip": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ namespace leader_election_converter
{

LogConverter::LogConverter(rclcpp::Node * node)
: node_(node), is_election_comunication_running_(true), is_election_status_running_(true)
: node_(node), is_election_communication_running_(true), is_election_status_running_(true)
{
}

LogConverter::~LogConverter()
{
is_election_comunication_running_ = false;
udp_election_comunication_receiver_->~UdpReceiver();
is_election_communication_running_ = false;
udp_election_communication_receiver_->~UdpReceiver();
is_election_status_running_ = false;
udp_election_status_receiver_->~UdpReceiver();
if (udp_election_comunication_thread_.joinable()) {
udp_election_comunication_thread_.join();
if (udp_election_communication_thread_.joinable()) {
udp_election_communication_thread_.join();
}
if (udp_election_status_thread_.joinable()) {
udp_election_status_thread_.join();
Expand All @@ -45,19 +45,19 @@ LogConverter::~LogConverter()
void LogConverter::setUdpElectionCommunicatioinReceiver(
const std::string & src_ip, const std::string & src_port)
{
udp_election_comunication_thread_ =
udp_election_communication_thread_ =
std::thread(&LogConverter::startUdpElectionCommunicationReceiver, this, src_ip, src_port);
}

void LogConverter::startUdpElectionCommunicationReceiver(
const std::string & src_ip, const std::string & src_port)
{
try {
udp_election_comunication_receiver_ = std::make_unique<UdpReceiver<ElectionCommunication>>(
udp_election_communication_receiver_ = std::make_unique<UdpReceiver<ElectionCommunication>>(
src_ip, src_port,
std::bind(&LogConverter::convertElectionCommunicationToTopic, this, std::placeholders::_1));
while (is_election_comunication_running_) {
udp_election_comunication_receiver_->receive();
while (is_election_communication_running_) {
udp_election_communication_receiver_->receive();
}
} catch (const std::exception & e) {
RCLCPP_ERROR(node_->get_logger(), "Error in UDP receiver thread: %s", e.what());
Expand Down Expand Up @@ -88,7 +88,7 @@ void LogConverter::startUdpElectionStatusReceiver(

void LogConverter::setPublisher()
{
pub_election_comunication_ =
pub_election_communication_ =
node_->create_publisher<tier4_system_msgs::msg::ElectionCommunication>(
"~/output/election_communication", rclcpp::QoS{1});
pub_election_status_ = node_->create_publisher<tier4_system_msgs::msg::ElectionStatus>(
Expand All @@ -107,7 +107,7 @@ void LogConverter::convertElectionCommunicationToTopic(const ElectionCommunicati
msg.link = (node_msg.msg >> 24) & 0xFF;
msg.heartbeat = (node_msg.msg >> 56) & 0x0F;
msg.checksum = (node_msg.msg >> 60) & 0x0F;
pub_election_comunication_->publish(msg);
pub_election_communication_->publish(msg);
}

void LogConverter::convertElectionStatusToTopic(const ElectionStatus & status)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class LogConverter
explicit LogConverter(rclcpp::Node * node);
~LogConverter();

void setUdpElectionCommunicatioinReceiver(
void setUdpElectionCommunicationReceiver(
const std::string & src_ip, const std::string & src_port);
void setUdpElectionStatusReceiver(const std::string & src_ip, const std::string & src_port);
void setPublisher();
Expand All @@ -77,16 +77,16 @@ class LogConverter
void convertElectionStatusToTopic(const ElectionStatus & status);

rclcpp::Node * node_;
std::unique_ptr<UdpReceiver<ElectionCommunication>> udp_election_comunication_receiver_;
std::unique_ptr<UdpReceiver<ElectionCommunication>> udp_election_communication_receiver_;
std::unique_ptr<UdpReceiver<ElectionStatus>> udp_election_status_receiver_;
rclcpp::Publisher<tier4_system_msgs::msg::ElectionCommunication>::SharedPtr
pub_election_comunication_;
pub_election_communication_;
rclcpp::Publisher<tier4_system_msgs::msg::ElectionStatus>::SharedPtr pub_election_status_;
rclcpp::Publisher<autoware_adapi_v1_msgs::msg::MrmState>::SharedPtr pub_over_all_mrm_state_;

std::thread udp_election_comunication_thread_;
std::thread udp_election_communication_thread_;
std::thread udp_election_status_thread_;
std::atomic<bool> is_election_comunication_running_;
std::atomic<bool> is_election_communication_running_;
std::atomic<bool> is_election_status_running_;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ LeaderElectionConverter::LeaderElectionConverter(const rclcpp::NodeOptions & nod

// convert udp packets of election info to topics
log_converter_.setPublisher();
log_converter_.setUdpElectionCommunicatioinReceiver(
log_converter_.setUdpElectionCommunicationReceiver(
election_communication_src_ip_, election_communication_src_port_);
log_converter_.setUdpElectionStatusReceiver(election_status_src_ip_, election_status_src_port_);
}
Expand Down

0 comments on commit 4a0bd0e

Please sign in to comment.