Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ersaraujo committed Oct 26, 2024
1 parent b5c6bac commit 4c901b4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ std::optional<rc::Behavior> BehaviorProcessor::process(std::span<const Payload>

behavior_message.output.emplace_back(
OutputMessage{
RobotIdMessage{std::nullopt, robot.robot_id().number()},
RobotIdMessage{},
MotionMessage{},
PlanningMessage{}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace behavior {

RobotIdMessage::RobotIdMessage(std::optional<Color> color, uint32_t number) :
RobotIdMessage::RobotIdMessage(std::optional<Color> color, std::optional<uint32_t> number) :
color{std::move(color)},
number{std::move(number)} {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ class RobotIdMessage : public robocin::IProtoConvertible<protocols::common::Robo

public:
explicit RobotIdMessage(std::optional<Color> color = std::nullopt,
uint32_t number = 0);
std::optional<uint32_t> 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;
};
Expand All @@ -32,7 +32,8 @@ class RobotIdMessage : public robocin::IProtoConvertible<protocols::common::Robo
};

std::optional<Color> color;
uint32_t number;
std::optional<uint32_t> number;

};

} // namespace behavior
Expand Down

0 comments on commit 4c901b4

Please sign in to comment.