RoboCup-SSL/ssl-vision

Add an enum-typed attribute to geometry message to identify lines and arcs

g3force opened this issue · 2 comments

The current geometry message identifies lines and arcs by a string. The protocol is missing a concrete definition of each of the shapes. Teams have to look for certain names as implicitly defined in the source code to get dimensions of the penalty area.

I suggest to add an optional attribute to SSL_FieldCicularArc and SSL_FieldLineSegment:

enum SSL_FieldShapeType {
  CenterCircle = 0;
  TopTouchLine = 1;
  BottomTouchLine = 2;
  LeftGoalLine = 3;
  RightGoalLine = 4;
  HalfwayLine = 5;
  CenterLine = 6;
  LeftPenaltyStretch = 7;
  RightPenaltyStretch = 8;
  LeftFieldLeftPenaltyStrech = 9;
  LeftFieldRightPenaltyStrech = 10;
  RightFieldLeftPenaltyStrech = 11;
  RightFieldRightPenaltyStrech = 12;
}

message SSL_FieldLineSegment {
...
optional SSL_FieldShapeType = 5;
...
}

message SSL_FieldCicularArc {
...
optional SSL_FieldShapeType = 7;
...
}

There should be an additional Undefined option, and that should be value 0.
I think this should go along with the code change necessary to set the enum option while publishing geometry in SSL-Vision.

I suggest to wait for PR #88, where I already switched to the new penalty area shapes.