forked from ssl-core/ssl-core
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
267 additions
and
273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,4 +113,4 @@ | |
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 39 additions & 39 deletions
78
behavior-ms/behavior-bruxo/behavior/processing/messages/behavior/behavior_message.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,56 @@ | ||
#include "behavior/processing/messages/motion/motion_message.h" | ||
#include "behavior/processing/messages/common/robot_id/robot_id.h" | ||
#include "behavior/processing/messages/motion/motion_message.h" | ||
#include "behavior/processing/messages/planning/planning_message.h" | ||
|
||
#include <protocols/behavior/behavior_unification.pb.h> | ||
|
||
#include <robocin/output/log.h> | ||
#include <robocin/utility/iproto_convertible.h> | ||
|
||
namespace behavior { | ||
|
||
class OutputMessage : public robocin::IProtoConvertible<protocols::behavior::unification::Output> { | ||
public: | ||
OutputMessage(RobotIdMessage robot_id = RobotIdMessage{}, | ||
MotionMessage motion = MotionMessage{}, | ||
PlanningMessage planning = PlanningMessage{}); | ||
|
||
[[nodiscard]] protocols::behavior::unification::Output toProto() const override { | ||
protocols::behavior::unification::Output output; | ||
output.mutable_robot_id()->CopyFrom(robot_id.toProto()); | ||
output.mutable_motion()->CopyFrom(motion.toProto()); | ||
output.mutable_planning()->CopyFrom(planning.toProto()); | ||
return output; | ||
}; | ||
|
||
void fromProto(protocols::behavior::unification::Output output) override { | ||
robot_id.fromProto(output.robot_id()); | ||
motion.fromProto(output.motion()); | ||
planning.fromProto(output.planning()); | ||
}; | ||
|
||
RobotIdMessage robot_id; | ||
MotionMessage motion; | ||
PlanningMessage planning; | ||
public: | ||
OutputMessage(RobotIdMessage robot_id = RobotIdMessage{}, | ||
MotionMessage motion = MotionMessage{}, | ||
PlanningMessage planning = PlanningMessage{}); | ||
|
||
[[nodiscard]] protocols::behavior::unification::Output toProto() const override { | ||
protocols::behavior::unification::Output output; | ||
output.mutable_robot_id()->CopyFrom(robot_id.toProto()); | ||
output.mutable_motion()->CopyFrom(motion.toProto()); | ||
output.mutable_planning()->CopyFrom(planning.toProto()); | ||
return output; | ||
}; | ||
|
||
void fromProto(protocols::behavior::unification::Output output) override { | ||
robot_id.fromProto(output.robot_id()); | ||
motion.fromProto(output.motion()); | ||
planning.fromProto(output.planning()); | ||
}; | ||
|
||
RobotIdMessage robot_id; | ||
MotionMessage motion; | ||
PlanningMessage planning; | ||
}; | ||
|
||
class BehaviorMessage : public robocin::IProtoConvertible<protocols::behavior::unification::Behavior> { | ||
public: | ||
BehaviorMessage(std::vector<OutputMessage> output = std::vector<OutputMessage>{}); | ||
class BehaviorMessage | ||
: public robocin::IProtoConvertible<protocols::behavior::unification::Behavior> { | ||
public: | ||
BehaviorMessage(std::vector<OutputMessage> output = std::vector<OutputMessage>{}); | ||
|
||
[[nodiscard]] protocols::behavior::unification::Behavior toProto() const override { | ||
protocols::behavior::unification::Behavior behavior; | ||
for (const auto& output : output) { | ||
behavior.add_output()->CopyFrom(output.toProto()); | ||
} | ||
return behavior; | ||
}; | ||
[[nodiscard]] protocols::behavior::unification::Behavior toProto() const override { | ||
protocols::behavior::unification::Behavior behavior; | ||
for (const auto& output : output) { | ||
behavior.add_output()->CopyFrom(output.toProto()); | ||
} | ||
return behavior; | ||
}; | ||
|
||
void fromProto(protocols::behavior::unification::Behavior behavior) override { | ||
// Implementação específica para converter de proto para BehaviorMessage | ||
}; | ||
void fromProto(protocols::behavior::unification::Behavior behavior) override { | ||
// Implementação específica para converter de proto para BehaviorMessage | ||
}; | ||
|
||
std::vector<OutputMessage> output; | ||
std::vector<OutputMessage> output; | ||
}; | ||
|
||
} // namespace behavior | ||
} // namespace behavior |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 27 additions & 28 deletions
55
behavior-ms/behavior-bruxo/behavior/processing/messages/common/robot_id/robot_id.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.