Skip to content

Commit

Permalink
protoの整理
Browse files Browse the repository at this point in the history
  • Loading branch information
HansRobo committed Oct 16, 2024
1 parent 2b242ea commit 1c19aae
Show file tree
Hide file tree
Showing 9 changed files with 167 additions and 175 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#ifndef ROBOCUP_SSL_COMM__VISION_COMPONENT_HPP_
#define ROBOCUP_SSL_COMM__VISION_COMPONENT_HPP_

#include <robocup_ssl_msgs/messages_robocup_ssl_detection.pb.h>
#include <robocup_ssl_msgs/messages_robocup_ssl_geometry.pb.h>
#include <robocup_ssl_msgs/messages_robocup_ssl_wrapper.pb.h>
#include <robocup_ssl_msgs/ssl_vision_detection.pb.h>
#include <robocup_ssl_msgs/ssl_vision_geometry.pb.h>
#include <robocup_ssl_msgs/ssl_vision_wrapper.pb.h>

#include <memory>
#include <rclcpp/rclcpp.hpp>
Expand Down
10 changes: 5 additions & 5 deletions consai_ros2/robocup_ssl_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ set(protobuf_files
proto/grSim_Packet.proto
proto/grSim_Replacement.proto
proto/grSim_Robotstatus.proto
proto/messages_robocup_ssl_wrapper.proto
proto/messages_robocup_ssl_wrapper_tracked.proto
proto/messages_robocup_ssl_geometry.proto
proto/messages_robocup_ssl_detection.proto
proto/messages_robocup_ssl_detection_tracked.proto
proto/ssl_gc_common.proto
proto/ssl_gc_game_event.proto
proto/ssl_gc_geometry.proto
proto/ssl_gc_referee_message.proto
proto/ssl_vision_geometry.proto
proto/ssl_vision_detection.proto
proto/ssl_vision_detection_tracked.proto
proto/ssl_vision_wrapper.proto
proto/ssl_vision_wrapper_tracked.proto
)
protobuf_generate_cpp(PROTO_CPP PROTO_H
${protobuf_files}
Expand Down
128 changes: 0 additions & 128 deletions consai_ros2/robocup_ssl_msgs/proto/messages_robocup_ssl_geometry.proto

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
syntax = "proto2";

option go_package = "github.com/RoboCup-SSL/ssl-game-controller/internal/app/vision";

message SSL_DetectionBall {
required float confidence = 1;
optional uint32 area = 2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,11 @@
syntax = "proto2";

// Default network address: 224.5.23.2:10010

// A vector with two dimensions
message Vector2 {
required float x = 1;
required float y = 2;
}

// A vector with three dimensions
message Vector3 {
required float x = 1;
required float y = 2;
required float z = 3;
}
option go_package = "github.com/RoboCup-SSL/ssl-game-controller/internal/app/tracker";

// The team color of the robot
enum TeamColor {
// team not set
TEAM_COLOR_UNKNOWN = 0;
// yellow team
TEAM_COLOR_YELLOW = 1;
// blue team
TEAM_COLOR_BLUE = 2;
}
import "ssl_gc_common.proto";
import "ssl_gc_geometry.proto";

// A unique robot id with team information
message RobotId {
// The robot number
required uint32 id = 1;
// The team color
required TeamColor team_color = 2;
}
// Default network address: 224.5.23.2:10010

// Capabilities that a source implementation can have
enum Capability {
Expand Down Expand Up @@ -98,6 +72,7 @@ message TrackedFrame {
// A monotonous increasing frame counter
required uint32 frame_number = 1;
// The unix timestamp in [s] of the data
// If timestamp is larger than timestamp_captured, the source has applied a prediction already
required double timestamp = 2;

// The list of detected balls
Expand Down
137 changes: 137 additions & 0 deletions consai_ros2/robocup_ssl_msgs/proto/ssl_vision_geometry.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
syntax = "proto2";

option go_package = "github.com/RoboCup-SSL/ssl-game-controller/internal/app/vision";

// A 2D float vector.
message Vector2f {
required float x = 1;
required float y = 2;
}

// Represents a field marking as a line segment represented by a start point p1,
// and end point p2, and a line thickness. The start and end points are along
// the center of the line, so the thickness of the line extends by thickness / 2
// on either side of the line.
message SSL_FieldLineSegment {
// Name of this field marking.
required string name = 1;
// Start point of the line segment.
required Vector2f p1 = 2;
// End point of the line segment.
required Vector2f p2 = 3;
// Thickness of the line segment.
required float thickness = 4;
// The type of this shape
optional SSL_FieldShapeType type = 5;
}

// Represents a field marking as a circular arc segment represented by center point, a
// start angle, an end angle, and an arc thickness.
message SSL_FieldCircularArc {
// Name of this field marking.
required string name = 1;
// Center point of the circular arc.
required Vector2f center = 2;
// Radius of the arc.
required float radius = 3;
// Start angle in counter-clockwise order.
required float a1 = 4;
// End angle in counter-clockwise order.
required float a2 = 5;
// Thickness of the arc.
required float thickness = 6;
// The type of this shape
optional SSL_FieldShapeType type = 7;
}

message SSL_GeometryFieldSize {
required int32 field_length = 1;
required int32 field_width = 2;
required int32 goal_width = 3;
required int32 goal_depth = 4;
required int32 boundary_width = 5;
repeated SSL_FieldLineSegment field_lines = 6;
repeated SSL_FieldCircularArc field_arcs = 7;
optional int32 penalty_area_depth = 8;
optional int32 penalty_area_width = 9;
optional int32 center_circle_radius = 10;
optional int32 line_thickness = 11;
optional int32 goal_center_to_penalty_mark = 12;
optional int32 goal_height = 13;
optional float ball_radius = 14;
optional float max_robot_radius = 15;
}

message SSL_GeometryCameraCalibration {
required uint32 camera_id = 1;
required float focal_length = 2;
required float principal_point_x = 3;
required float principal_point_y = 4;
required float distortion = 5;
required float q0 = 6;
required float q1 = 7;
required float q2 = 8;
required float q3 = 9;
required float tx = 10;
required float ty = 11;
required float tz = 12;
optional float derived_camera_world_tx = 13;
optional float derived_camera_world_ty = 14;
optional float derived_camera_world_tz = 15;
optional uint32 pixel_image_width = 16;
optional uint32 pixel_image_height = 17;
}

// Two-Phase model for straight-kicked balls.
// There are two phases with different accelerations during the ball kicks:
// 1. Sliding
// 2. Rolling
// The full model is described in the TDP of ER-Force from 2016, which can be found here:
// https://ssl.robocup.org/wp-content/uploads/2019/01/2016_ETDP_ER-Force.pdf
message SSL_BallModelStraightTwoPhase {
// Ball sliding acceleration [m/s^2] (should be negative)
required double acc_slide = 1;
// Ball rolling acceleration [m/s^2] (should be negative)
required double acc_roll = 2;
// Fraction of the initial velocity where the ball starts to roll
required double k_switch = 3;
}

// Fixed-Loss model for chipped balls.
// Uses fixed damping factors for xy and z direction per hop.
message SSL_BallModelChipFixedLoss {
// Chip kick velocity damping factor in XY direction for the first hop
required double damping_xy_first_hop = 1;
// Chip kick velocity damping factor in XY direction for all following hops
required double damping_xy_other_hops = 2;
// Chip kick velocity damping factor in Z direction for all hops
required double damping_z = 3;
}

message SSL_GeometryModels {
optional SSL_BallModelStraightTwoPhase straight_two_phase = 1;
optional SSL_BallModelChipFixedLoss chip_fixed_loss = 2;
}

message SSL_GeometryData {
required SSL_GeometryFieldSize field = 1;
repeated SSL_GeometryCameraCalibration calib = 2;
optional SSL_GeometryModels models = 3;
}

enum SSL_FieldShapeType {
Undefined = 0;
CenterCircle = 1;
TopTouchLine = 2;
BottomTouchLine = 3;
LeftGoalLine = 4;
RightGoalLine = 5;
HalfwayLine = 6;
CenterLine = 7;
LeftPenaltyStretch = 8;
RightPenaltyStretch = 9;
LeftFieldLeftPenaltyStretch = 10;
LeftFieldRightPenaltyStretch = 11;
RightFieldLeftPenaltyStretch = 12;
RightFieldRightPenaltyStretch = 13;
}
11 changes: 11 additions & 0 deletions consai_ros2/robocup_ssl_msgs/proto/ssl_vision_wrapper.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
syntax = "proto2";

option go_package = "github.com/RoboCup-SSL/ssl-game-controller/internal/app/vision";

import "ssl_vision_detection.proto";
import "ssl_vision_geometry.proto";

message SSL_WrapperPacket {
optional SSL_DetectionFrame detection = 1;
optional SSL_GeometryData geometry = 2;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
syntax = "proto2";
import "messages_robocup_ssl_detection_tracked.proto";

option go_package = "github.com/RoboCup-SSL/ssl-game-controller/internal/app/tracker";

import "ssl_vision_detection_tracked.proto";

// A wrapper packet containing meta data of the source
// Also serves for the possibility to extend the protocol later
Expand Down

0 comments on commit 1c19aae

Please sign in to comment.