diff --git a/behavior-ms/behavior-bruxo/behavior/processing/behavior_processor.cpp b/behavior-ms/behavior-bruxo/behavior/processing/behavior_processor.cpp index 3f087b65..b126332b 100644 --- a/behavior-ms/behavior-bruxo/behavior/processing/behavior_processor.cpp +++ b/behavior-ms/behavior-bruxo/behavior/processing/behavior_processor.cpp @@ -82,7 +82,7 @@ std::optional BehaviorProcessor::process(std::span behavior_message.output.emplace_back( OutputMessage{ - RobotIdMessage{std::nullopt, robot.robot_id().number()}, + RobotIdMessage{}, MotionMessage{}, PlanningMessage{} }); diff --git a/behavior-ms/behavior-bruxo/behavior/processing/messages/common/robot_id/robot_id.cpp b/behavior-ms/behavior-bruxo/behavior/processing/messages/common/robot_id/robot_id.cpp index 1c12f718..90a65aea 100644 --- a/behavior-ms/behavior-bruxo/behavior/processing/messages/common/robot_id/robot_id.cpp +++ b/behavior-ms/behavior-bruxo/behavior/processing/messages/common/robot_id/robot_id.cpp @@ -2,7 +2,7 @@ namespace behavior { -RobotIdMessage::RobotIdMessage(std::optional color, uint32_t number) : +RobotIdMessage::RobotIdMessage(std::optional color, std::optional number) : color{std::move(color)}, number{std::move(number)} {} diff --git a/behavior-ms/behavior-bruxo/behavior/processing/messages/common/robot_id/robot_id.h b/behavior-ms/behavior-bruxo/behavior/processing/messages/common/robot_id/robot_id.h index 84f7706f..c1fef487 100644 --- a/behavior-ms/behavior-bruxo/behavior/processing/messages/common/robot_id/robot_id.h +++ b/behavior-ms/behavior-bruxo/behavior/processing/messages/common/robot_id/robot_id.h @@ -16,12 +16,12 @@ class RobotIdMessage : public robocin::IProtoConvertible color = std::nullopt, - uint32_t number = 0); + std::optional number = 0); [[nodiscard]] protocols::common::RobotId toProto() const override { protocols::common::RobotId robot_id; robot_id.set_color(static_cast<::protocols::common::RobotId_Color>(color.value_or(Color::COLOR_UNSPECIFIED))); - robot_id.set_number(number); + robot_id.set_number(number.value_or(0)); return robot_id; }; @@ -32,7 +32,8 @@ class RobotIdMessage : public robocin::IProtoConvertible color; - uint32_t number; + std::optional number; + }; } // namespace behavior