Skip to content

Commit

Permalink
Fix file formatting (#66)
Browse files Browse the repository at this point in the history
Ajusta a formatação dos arquivos.

---------

Co-authored-by: Felipe Nunes <[email protected]>
  • Loading branch information
ersaraujo and fnalmeidap authored Oct 31, 2024
1 parent c06ede0 commit 5865daf
Show file tree
Hide file tree
Showing 26 changed files with 210 additions and 210 deletions.
2 changes: 2 additions & 0 deletions common/cpp/robocin/utility/iproto_convertible.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class IProtoConvertible {
IProtoConvertible& operator=(IProtoConvertible&&) noexcept = default;

virtual ~IProtoConvertible() = default;


virtual T toProto() const = 0;
virtual void fromProto(const T& proto) = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ rc::RobotInfo RobotCommandMapper::fromNavigationAndReferee(const tp::Referee& re
rc::RobotDribbler::DribblerCommand dribbler_command;
rc::Flags robot_flag;

command->set_msg_type(rc::MessageType::SSL_SPEED);
command->set_msg_type(rc::MessageType::MESSAGE_TYPE_SSL_SPEED);

robot_id->CopyFrom(navigation.output(navigation.output_size() - 1).robot_id());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"**/**/.devcontainer": true,
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ std::optional<rc::Decision> DecisionProcessor::process(std::span<const Payload>
return std::nullopt;
}

const rc::Detection last_detection = detections.back();

return rc::Decision{};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"**/**/.devcontainer": true,
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ robocin_cpp_library(
common::output
common::wip
protocols::protobufs
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ robocin_cpp_library(
HDRS parameters.h
SRCS parameters.cpp
DEPS common::parameters
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ robocin_cpp_library(
SRCS motion_parser.cpp
DEPS protocols::protobufs
navigation_utils
)
)
8 changes: 4 additions & 4 deletions protocols/protocols/behavior/behavior.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ syntax = "proto3";
package protocols.behavior;

import "protocols/common/geometry.proto";
import "protocols/common/robot_id.proto";
import "protocols/common/peripheral_actuation.proto";
import "protocols/common/robot_id.proto";

/* BETA:
These messages are not implemented in CBR-2024 release.
It is a beta version for future development.
These messages are not implemented in CBR-2024 release.
It is a beta version for future development.
*/

message Motion {
Expand Down Expand Up @@ -36,4 +36,4 @@ message Obstacles {
bool right_goal_post = 7;

// TODO: Add game state obstacles: Stop, ball placement...
}
}
30 changes: 14 additions & 16 deletions protocols/protocols/behavior/behavior_unification.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,30 @@ syntax = "proto3";

package protocols.behavior.unification;

import "protocols/common/peripheral_actuation.proto";
import "protocols/common/robot_id.proto";

import "protocols/behavior/motion.proto";
import "protocols/behavior/planning.proto";
import "protocols/common/peripheral_actuation.proto";
import "protocols/common/robot_id.proto";

/*
Remove this implementation after CBR-2024.
This is a replica of current implementation of ssl-unification behavior output.
/*
Remove this implementation after CBR-2024.
This is a replica of current implementation of ssl-unification behavior output.
*/

message Behavior {
repeated Output output = 1;
repeated Output output = 1;
}

message Output {
common.RobotId robot_id = 1;
Motion motion = 2;
Planning planning = 3;
common.RobotId robot_id = 1;
Motion motion = 2;
Planning planning = 3;
}

message Motion {
GoToPoint go_to_point = 1;
GoToPointWithTrajectory go_to_point_with_trajectory = 2;
RotateInPoint rotate_in_point = 3;
RotateOnSelf rotate_on_self = 4;
common.PeripheralActuation peripheral_actuation = 5;
GoToPoint go_to_point = 1;
GoToPointWithTrajectory go_to_point_with_trajectory = 2;
RotateInPoint rotate_in_point = 3;
RotateOnSelf rotate_on_self = 4;
common.PeripheralActuation peripheral_actuation = 5;
}

130 changes: 65 additions & 65 deletions protocols/protocols/behavior/motion.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,93 +5,93 @@ package protocols.behavior;
import "protocols/common/geometry.proto";

message DiscretizedPath {
repeated PathNode path = 1;
GoToPoint go_to_point = 2;
repeated PathNode path = 1;
GoToPoint go_to_point = 2;
}

message PathNode {
common.Point2Df position = 1;
common.Point2Df velocity = 2;
double time = 3;
common.Point2Df position = 1;
common.Point2Df velocity = 2;
double time = 3;
}

message RotateInPoint {
common.Point2Df target = 1;
double target_angle = 2;
bool clockwise = 3;
double orbit_radius = 4;
double rotate_velocity = 5;
double min_velocity = 6;
double approach_kp = 7;
double angle_kp = 8;
common.Point2Df target = 1;
double target_angle = 2;
bool clockwise = 3;
double orbit_radius = 4;

double rotate_velocity = 5;
double min_velocity = 6;
double approach_kp = 7;
double angle_kp = 8;
}

message RotateOnSelf {
double target_angle = 1;
common.Point2Df velocity = 2;
double kp = 3;
double target_angle = 1;
common.Point2Df velocity = 2;
double kp = 3;
}

message GoToPoint {
common.Point2Df target = 1;
double target_angle = 2;
MovingProfile moving_profile = 3;
PrecisionToTarget precision_to_target = 4;
bool sync_rotate_with_linear_movement = 5;
common.Point2Df target = 1;
double target_angle = 2;

MovingProfile moving_profile = 3;
PrecisionToTarget precision_to_target = 4;
bool sync_rotate_with_linear_movement = 5;
}

message GoToPointWithTrajectory {
GoToPoint go_to_point = 1;
PathConfig path_config = 2;
GoToPoint go_to_point = 1;
PathConfig path_config = 2;
}

message PathConfig {
common.Point2Df target_velocity = 1;
bool avoid_ball = 2;
bool avoid_ball_placement = 3;
bool avoid_ally_penalty_area = 4;
bool avoid_enemy_penalty_area = 5;
bool avoid_ally_robots = 6;
bool avoid_enemy_robots = 7;

repeated int32 ally_skipped = 8;
repeated int32 enemy_skipped = 9;
common.Point2Df target_velocity = 1;
bool avoid_ball = 2;
bool avoid_ball_placement = 3;
bool avoid_ally_penalty_area = 4;
bool avoid_enemy_penalty_area = 5;
bool avoid_ally_robots = 6;
bool avoid_enemy_robots = 7;

repeated int32 ally_skipped = 8;
repeated int32 enemy_skipped = 9;
}

enum PrecisionToTarget {
High = 0;
Normal = 1;
High = 0;
Normal = 1;
}

enum MovingProfile {
// Move safely profile
SafeInStopSpeed = 0;

// Specific movement profile
BalancedInApproachBallSpeed = 1;
BalancedInCarryBallSpeed = 2;
BalancedInCarryBallLowSpeed = 3;

// Goto point direct profile
DirectApproachBallSpeed = 4;
DirectSafeKickBallSpeed = 5;
DirectBalancedKickBallSpeed = 6;
DirectKickBallwithEnemyClose = 7;
gotoBallWithEnemy = 8;
PushBallInPenalty = 9;
TOTOZINHO = 10;

// Default movement profile
BalancedInSlowSpeed = 11;
BalancedInMedianSpeed = 12;
BalancedInDefaultSpeed = 13;
BalancedInHighSpeed = 14;

// Goalkepper profile
GoalkeeperInTopSpeed = 15;

// Penalty push ball
PenaltyPushBall = 16;
// Move safely profile
SafeInStopSpeed = 0;

// Specific movement profile
BalancedInApproachBallSpeed = 1;
BalancedInCarryBallSpeed = 2;
BalancedInCarryBallLowSpeed = 3;

// Goto point direct profile
DirectApproachBallSpeed = 4;
DirectSafeKickBallSpeed = 5;
DirectBalancedKickBallSpeed = 6;
DirectKickBallwithEnemyClose = 7;
gotoBallWithEnemy = 8;
PushBallInPenalty = 9;
TOTOZINHO = 10;

// Default movement profile
BalancedInSlowSpeed = 11;
BalancedInMedianSpeed = 12;
BalancedInDefaultSpeed = 13;
BalancedInHighSpeed = 14;

// Goalkepper profile
GoalkeeperInTopSpeed = 15;

// Penalty push ball
PenaltyPushBall = 16;
}
10 changes: 5 additions & 5 deletions protocols/protocols/behavior/planning.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import "protocols/behavior/motion.proto";
import "protocols/common/peripheral_actuation.proto";

message Planning {
DiscretizedPath discretized_path = 1;
GoToPoint go_to_point = 2;
RotateInPoint rotate_in_point = 3;
RotateOnSelf rotate_on_self = 4;
common.PeripheralActuation peripheral_actuation = 5;
DiscretizedPath discretized_path = 1;
GoToPoint go_to_point = 2;
RotateInPoint rotate_in_point = 3;
RotateOnSelf rotate_on_self = 4;
common.PeripheralActuation peripheral_actuation = 5;
}
23 changes: 11 additions & 12 deletions protocols/protocols/common/feedback.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@ syntax = "proto3";
package protocols.common;

import "protocols/common/robot_id.proto";
import "protocols/common/robot_pose.proto";
import "protocols/common/robot_kick.proto";
import "protocols/common/robot_velocity.proto";
import "protocols/common/robot_motor.proto";
import "protocols/common/robot_pose.proto";
import "protocols/common/robot_velocity.proto";

message Feedback {
Telemetry telemetry = 1;
optional RobotPose pose = 2;

message Telemetry {
RobotId robot_id = 1;
RobotVelocity robot_velocity = 2;
RobotMotor robot_motor = 3;
RobotKick.KickInfo kick_info = 4;
}
}
Telemetry telemetry = 1;
optional RobotPose pose = 2;

message Telemetry {
RobotId robot_id = 1;
RobotVelocity robot_velocity = 2;
RobotMotor robot_motor = 3;
RobotKick.KickInfo kick_info = 4;
}
}
14 changes: 7 additions & 7 deletions protocols/protocols/common/message_type.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ syntax = "proto3";
package protocols.common;

enum MessageType {
UNKNOWN = 0;
SSL_SPEED = 1;
SSL_POSITION = 2;
SSL_TELEMETRY = 3;
SSL_ODOMETRY = 4;
SSL_MOTORS = 5;
}
MESSAGE_TYPE_UNSPECIFIED = 0;
MESSAGE_TYPE_SSL_SPEED = 1;
MESSAGE_TYPE_SSL_POSITION = 2;
MESSAGE_TYPE_SSL_TELEMETRY = 3;
MESSAGE_TYPE_SSL_ODOMETRY = 4;
MESSAGE_TYPE_SSL_MOTORS = 5;
}
7 changes: 3 additions & 4 deletions protocols/protocols/common/peripheral_actuation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ syntax = "proto3";

package protocols.common;

import "protocols/common/robot_kick.proto";
import "protocols/common/robot_dribbler.proto";
import "protocols/common/robot_kick.proto";

message PeripheralActuation {
RobotKick.KickCommand kick_command = 1;
RobotDribbler robot_dribbler = 2;
RobotKick.KickCommand kick_command = 1;
RobotDribbler robot_dribbler = 2;
}

Loading

0 comments on commit 5865daf

Please sign in to comment.