Skip to content

Commit 5cb8798

Browse files
committed
Reorder enum declaration and use for duplicated type names
This is a temporary work-around for a bug in the flatc compiler when translating protobuf idl to fbs idl, where definition after use will confuse the compiler when type names are reused in the same file but different surrounding types.
1 parent 5165b02 commit 5cb8798

File tree

3 files changed

+187
-186
lines changed

3 files changed

+187
-186
lines changed

osi_lane.proto

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -973,27 +973,6 @@ message LaneBoundary
973973
//
974974
message Classification
975975
{
976-
// The type of the lane boundary.
977-
//
978-
optional Type type = 1;
979-
980-
// The semantic color of the lane boundary in case of lane markings.
981-
//
982-
// \note The color types represent the semantic classification of
983-
// lane markings only. They do not represent an actual visual appearance.
984-
//
985-
optional Color color = 2;
986-
987-
// The ids of \c StationaryObject which limit the corresponding lane.
988-
// This field must be set if the \c #type is set to
989-
// \c #TYPE_STRUCTURE
990-
//
991-
// \rules
992-
// refers_to: StationaryObject
993-
// \endrules
994-
//
995-
repeated Identifier limiting_structure_id = 3;
996-
997976
// The lane boundary type.
998977
// There is no special representation for double lines, e.g. solid /
999978
// solid or dashed / solid. In such cases, each lane will define its own
@@ -1070,6 +1049,28 @@ message LaneBoundary
10701049
TYPE_SOUND_BARRIER = 15;
10711050
}
10721051

1052+
// The type of the lane boundary.
1053+
//
1054+
optional Type type = 1;
1055+
1056+
// The semantic color of the lane boundary in case of lane markings.
1057+
//
1058+
// \note The color types represent the semantic classification of
1059+
// lane markings only. They do not represent an actual visual appearance.
1060+
//
1061+
optional Color color = 2;
1062+
1063+
// The ids of \c StationaryObject which limit the corresponding lane.
1064+
// This field must be set if the \c #type is set to
1065+
// \c #TYPE_STRUCTURE
1066+
//
1067+
// \rules
1068+
// refers_to: StationaryObject
1069+
// \endrules
1070+
//
1071+
repeated Identifier limiting_structure_id = 3;
1072+
1073+
10731074
// The semantic color of the lane boundary in case of a lane markings.
10741075
// Lane markings that alternate in color must be represented by
10751076
// individual \c LaneBoundary segments.

osi_object.proto

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,31 @@ message MovingObject
399399
//
400400
optional BaseMoving base = 2;
401401

402+
// Definition of object types.
403+
//
404+
enum Type
405+
{
406+
// Type of the object is unknown (must not be used in ground truth).
407+
//
408+
TYPE_UNKNOWN = 0;
409+
410+
// Other (unspecified but known) type of moving object.
411+
//
412+
TYPE_OTHER = 1;
413+
414+
// Object is a vehicle.
415+
//
416+
TYPE_VEHICLE = 2;
417+
418+
// Object is a pedestrian.
419+
//
420+
TYPE_PEDESTRIAN = 3;
421+
422+
// Object is an animal.
423+
//
424+
TYPE_ANIMAL = 4;
425+
}
426+
402427
// The type of the object.
403428
//
404429
optional Type type = 3;
@@ -487,31 +512,6 @@ message MovingObject
487512
//
488513
optional ColorDescription color_description = 11;
489514

490-
// Definition of object types.
491-
//
492-
enum Type
493-
{
494-
// Type of the object is unknown (must not be used in ground truth).
495-
//
496-
TYPE_UNKNOWN = 0;
497-
498-
// Other (unspecified but known) type of moving object.
499-
//
500-
TYPE_OTHER = 1;
501-
502-
// Object is a vehicle.
503-
//
504-
TYPE_VEHICLE = 2;
505-
506-
// Object is a pedestrian.
507-
//
508-
TYPE_PEDESTRIAN = 3;
509-
510-
// Object is an animal.
511-
//
512-
TYPE_ANIMAL = 4;
513-
}
514-
515515
//
516516
// \brief The vehicle attributes for \c MovingObject (host or other).
517517
//
@@ -726,33 +726,6 @@ message MovingObject
726726
//
727727
message VehicleClassification
728728
{
729-
// The type of the vehicle.
730-
//
731-
optional Type type = 1;
732-
733-
// The light state of the vehicle.
734-
//
735-
optional LightState light_state = 2;
736-
737-
// Flag defining whether the vehicle has an attached trailer.
738-
//
739-
optional bool has_trailer = 3;
740-
741-
// Id of the attached trailer.
742-
//
743-
// \note Field need not be set if has_Trailer is set to false or use
744-
// value for non valid id.
745-
//
746-
// \rules
747-
// check_if this.has_trailer is_equal_to true else do_check is_set
748-
// \endrules
749-
//
750-
optional Identifier trailer_id = 4;
751-
752-
// The role of the vehicle.
753-
//
754-
optional Role role = 5;
755-
756729
// Definition of vehicle types.
757730
//
758731
// \note OSI provides a richer set of vehicle types than is supported by some
@@ -872,6 +845,33 @@ message MovingObject
872845
TYPE_STANDUP_SCOOTER = 17;
873846
}
874847

848+
// The type of the vehicle.
849+
//
850+
optional Type type = 1;
851+
852+
// The light state of the vehicle.
853+
//
854+
optional LightState light_state = 2;
855+
856+
// Flag defining whether the vehicle has an attached trailer.
857+
//
858+
optional bool has_trailer = 3;
859+
860+
// Id of the attached trailer.
861+
//
862+
// \note Field need not be set if has_Trailer is set to false or use
863+
// value for non valid id.
864+
//
865+
// \rules
866+
// check_if this.has_trailer is_equal_to true else do_check is_set
867+
// \endrules
868+
//
869+
optional Identifier trailer_id = 4;
870+
871+
// The role of the vehicle.
872+
//
873+
optional Role role = 5;
874+
875875
//
876876
// \brief The state of the lights of a vehicle.
877877
//

0 commit comments

Comments
 (0)