Skip to content

Commit

Permalink
fix codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffmann-stefan committed Oct 31, 2024
1 parent 3f86127 commit 4b0d793
Showing 1 changed file with 48 additions and 50 deletions.
98 changes: 48 additions & 50 deletions src/convert_builtin_interfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,31 +69,30 @@ convert_1_to_2(

// Explicitly map the values of the log level as they differ between
// ROS1 and ROS2.
switch (ros1_msg.level)
{
case rosgraph_msgs::Log::DEBUG:
ros2_msg.level = rcl_interfaces::msg::Log::DEBUG;
break;

case rosgraph_msgs::Log::INFO:
ros2_msg.level = rcl_interfaces::msg::Log::INFO;
break;

case rosgraph_msgs::Log::WARN:
ros2_msg.level = rcl_interfaces::msg::Log::WARN;
break;

case rosgraph_msgs::Log::ERROR:
ros2_msg.level = rcl_interfaces::msg::Log::ERROR;
break;

case rosgraph_msgs::Log::FATAL:
ros2_msg.level = rcl_interfaces::msg::Log::FATAL;
break;

default:
ros2_msg.level = ros1_msg.level;
break;
switch (ros1_msg.level) {
case rosgraph_msgs::Log::DEBUG:
ros2_msg.level = rcl_interfaces::msg::Log::DEBUG;
break;

case rosgraph_msgs::Log::INFO:
ros2_msg.level = rcl_interfaces::msg::Log::INFO;
break;

case rosgraph_msgs::Log::WARN:
ros2_msg.level = rcl_interfaces::msg::Log::WARN;
break;

case rosgraph_msgs::Log::ERROR:
ros2_msg.level = rcl_interfaces::msg::Log::ERROR;
break;

case rosgraph_msgs::Log::FATAL:
ros2_msg.level = rcl_interfaces::msg::Log::FATAL;
break;

default:
ros2_msg.level = ros1_msg.level;
break;
}

ros2_msg.name = ros1_msg.name;
Expand All @@ -113,31 +112,30 @@ convert_2_to_1(

// Explicitly map the values of the log level as they differ between
// ROS1 and ROS2.
switch (ros2_msg.level)
{
case rcl_interfaces::msg::Log::DEBUG:
ros1_msg.level = rosgraph_msgs::Log::DEBUG;
break;

case rcl_interfaces::msg::Log::INFO:
ros1_msg.level = rosgraph_msgs::Log::INFO;
break;

case rcl_interfaces::msg::Log::WARN:
ros1_msg.level = rosgraph_msgs::Log::WARN;
break;

case rcl_interfaces::msg::Log::ERROR:
ros1_msg.level = rosgraph_msgs::Log::ERROR;
break;

case rcl_interfaces::msg::Log::FATAL:
ros1_msg.level = rosgraph_msgs::Log::FATAL;
break;

default:
ros1_msg.level = ros1_msg.level;
break;
switch (ros2_msg.level) {
case rcl_interfaces::msg::Log::DEBUG:
ros1_msg.level = rosgraph_msgs::Log::DEBUG;
break;

case rcl_interfaces::msg::Log::INFO:
ros1_msg.level = rosgraph_msgs::Log::INFO;
break;

case rcl_interfaces::msg::Log::WARN:
ros1_msg.level = rosgraph_msgs::Log::WARN;
break;

case rcl_interfaces::msg::Log::ERROR:
ros1_msg.level = rosgraph_msgs::Log::ERROR;
break;

case rcl_interfaces::msg::Log::FATAL:
ros1_msg.level = rosgraph_msgs::Log::FATAL;
break;

default:
ros1_msg.level = ros1_msg.level;
break;
}

ros1_msg.name = ros2_msg.name;
Expand Down

0 comments on commit 4b0d793

Please sign in to comment.