Skip to content

Commit

Permalink
Log message for CMDERROR messages
Browse files Browse the repository at this point in the history
  • Loading branch information
cpr-marcoh committed Mar 18, 2024
1 parent 9fbb5d0 commit b8897e6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ enum class MessageType {
EXECPAUSE,
EXECEND,
EXECERROR,
CMDERROR,
UNKNOWN = 1000
};

Expand Down
1 change: 1 addition & 0 deletions irc_ros_hardware/src/CRI/cri_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ MessageType CriMessage::GetMessageType(const std::string & msg)
{cri_keywords::TYPE_EXECPAUSE, MessageType::EXECPAUSE},
{cri_keywords::TYPE_EXECEND, MessageType::EXECEND},
{cri_keywords::TYPE_EXECPAUSE, MessageType::EXECPAUSE},
{cri_keywords::TYPE_CMDERROR, MessageType::CMDERROR}
};

auto it = message_type_map.find(typeString);
Expand Down
6 changes: 5 additions & 1 deletion irc_ros_hardware/src/irc_ros_cri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ void IrcRosCri::MessageThreadFunction()

break;
}

case cri_messages::MessageType::INFO: {
cri_messages::Info info = cri_messages::Info(msg);
RCLCPP_INFO(rclcpp::get_logger("iRC_ROS"), "INFO: %s", info.info.c_str());
Expand All @@ -139,6 +138,11 @@ void IrcRosCri::MessageThreadFunction()
RCLCPP_INFO(rclcpp::get_logger("iRC_ROS"), "EXECACK received");
break;
}
case cri_messages::MessageType::CMDERROR:
{
RCLCPP_ERROR(rclcpp::get_logger("iRC_ROS"), "CMDERROR: %s", msg.c_str());
break;
}
}
}
}
Expand Down

0 comments on commit b8897e6

Please sign in to comment.