Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions crane_sender/src/ibis_sender_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,12 @@ class IbisSenderNode : public SenderBase

robocup_ssl::RobotControl packet;
for (const auto & command : msg.robot_commands) {
if (command.robot_id >= CommConfig::AI_CMD_V2_ROBOT_NUM) {
RCLCPP_WARN_THROTTLE(
get_logger(), *get_clock(), 1000, "robot_id %u is out of range (>= %d); skipping command",
command.robot_id, CommConfig::AI_CMD_V2_ROBOT_NUM);
continue;
}
auto cmd = packet.add_robot_commands();
cmd->set_id(command.robot_id);

Expand Down Expand Up @@ -411,6 +417,12 @@ class IbisSenderNode : public SenderBase
commands->set_timestamp(0.0);

for (const auto & command : msg.robot_commands) {
if (command.robot_id >= CommConfig::AI_CMD_V2_ROBOT_NUM) {
RCLCPP_WARN_THROTTLE(
get_logger(), *get_clock(), 1000, "robot_id %u is out of range (>= %d); skipping command",
command.robot_id, CommConfig::AI_CMD_V2_ROBOT_NUM);
continue;
}
auto * robot_cmd = commands->add_robot_commands();
robot_cmd->set_id(command.robot_id);

Expand Down
Loading