Skip to content

Commit 1f113a3

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. Signed-off-by: Pierre R. Mai <pmai@pmsf.de>
1 parent 55bfcf7 commit 1f113a3

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
@@ -400,6 +400,31 @@ message MovingObject
400400
//
401401
optional BaseMoving base = 2;
402402

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

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

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

0 commit comments

Comments
 (0)