Skip to content

Commit 3e38540

Browse files
jdsikaCopilot
andcommitted
Refactor: reuse PedestrianAttributes.Bone instead of duplicating
Address review feedback by removing the PersonSkeleton message from osi_common.proto and instead directly reusing MovingObject.PedestrianAttributes.Bone in the new Occupant.Skeleton message. This avoids type duplication entirely. The Occupant.Skeleton wrapper message provides its own bbcenter_to_root (offset from vehicle bounding box center) while referencing the existing Bone type for the skeleton hierarchy. Migration notes on both PedestrianAttributes and Occupant.Skeleton document the plan to introduce a common skeleton type in OSI 4. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3783520 commit 3e38540

3 files changed

Lines changed: 48 additions & 226 deletions

File tree

osi_common.proto

Lines changed: 0 additions & 213 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,216 +1104,3 @@ message Polygon3d
11041104
//
11051105
repeated Vector3d vertex = 1;
11061106
}
1107-
1108-
//
1109-
// \brief A skeleton representing the posture of a person.
1110-
//
1111-
// This is a generic skeleton model that can be used for any person
1112-
// representation, such as vehicle occupants or pedestrians.
1113-
//
1114-
// The skeleton is defined relative to a root point. The root point itself
1115-
// is positioned relative to the bounding box center of the containing
1116-
// entity using \c #bbcenter_to_root.
1117-
//
1118-
// \note The \c Bone message and \c Bone::Type enum are structurally
1119-
// equivalent to the ones defined in
1120-
// \c MovingObject::PedestrianAttributes::Bone. The duplication exists
1121-
// because Protocol Buffers does not support message type aliases,
1122-
// and \c PedestrianAttributes::Bone cannot be changed without a breaking
1123-
// change. In OSI 4, \c MovingObject::PedestrianAttributes is planned to
1124-
// adopt this common \c PersonSkeleton type, eliminating the duplication.
1125-
//
1126-
message PersonSkeleton
1127-
{
1128-
// Position offset from the bounding box center of the containing entity
1129-
// to the current position of the root point of the skeleton model.
1130-
//
1131-
// For an occupant this is the offset from the vehicle's bounding box
1132-
// center (\c MovingObject::base . \c BaseMoving::position) to the
1133-
// skeleton root, analogous to
1134-
// \c MovingObject::VehicleAttributes::bbcenter_to_rear.
1135-
//
1136-
// For a pedestrian this is the offset from the pedestrian's bounding
1137-
// box center to the skeleton root, analogous to
1138-
// \c MovingObject::PedestrianAttributes::bbcenter_to_root.
1139-
//
1140-
optional Vector3d bbcenter_to_root = 1;
1141-
1142-
// List of all bones of the person.
1143-
//
1144-
// The number of bones may vary, based on the detail level of
1145-
// the model used. For example, some simulators will not include
1146-
// detailed data about the hands.
1147-
//
1148-
// \note A bone of each type can be provided, or left out, depending
1149-
// on the desired level of detail, or available data. However, if a
1150-
// bone is defined, all bones in the chain from that bone back to
1151-
// the root point must be provided to create a complete chain.
1152-
//
1153-
repeated Bone skeleton_bone = 2;
1154-
1155-
//
1156-
// \brief A bone in the skeleton of a person.
1157-
//
1158-
// Each point represents a joint, or otherwise important point in the
1159-
// skeleton. For example pelvis, knee or shoulder. The naming convention
1160-
// should be followed for identifying bones.
1161-
//
1162-
// \note This message is structurally equivalent to
1163-
// \c MovingObject::PedestrianAttributes::Bone. See the note on
1164-
// \c PersonSkeleton for the rationale behind the duplication.
1165-
//
1166-
message Bone
1167-
{
1168-
// Bones are identified by their type, combined with which body side
1169-
// they are on.
1170-
//
1171-
// To properly identify the bones the pre-defined naming convention
1172-
// must be used.
1173-
//
1174-
// \image html OSI_SkeletonNamingConvention.svg
1175-
//
1176-
// A bone's name, position, and orientation is defined by the end-point
1177-
// closer to the root. For example: the "LOWER_ARM_L" will define the
1178-
// point in the left elbow of the model.
1179-
//
1180-
// If a bone which is more than one layer detached from the
1181-
// root point is used, all bones between that bone and the root also
1182-
// need to be defined in order to create a complete chain!
1183-
//
1184-
// If information about bones are missing, they may be left empty.
1185-
//
1186-
optional Type type = 1;
1187-
1188-
// Position of the bone.
1189-
//
1190-
// Reference system is the root, defined by
1191-
// \c PersonSkeleton::bbcenter_to_root.
1192-
//
1193-
optional Vector3d position = 2;
1194-
1195-
// Orientation of the bone.
1196-
//
1197-
// Reference system is the root, defined by
1198-
// \c PersonSkeleton::bbcenter_to_root.
1199-
//
1200-
optional Orientation3d orientation = 3;
1201-
1202-
// Length of the bone.
1203-
//
1204-
// Measured along its major axis.
1205-
//
1206-
// Unit: m
1207-
//
1208-
optional float length = 4;
1209-
1210-
// Determines whether a bone is explicitly missing from the model.
1211-
//
1212-
// In case a person has missing limbs this can be explicitly
1213-
// communicated by setting this boolean to TRUE.
1214-
//
1215-
optional bool missing = 5;
1216-
1217-
// The velocity of the bone.
1218-
//
1219-
// Reference system is the root, defined by
1220-
// \c PersonSkeleton::bbcenter_to_root.
1221-
//
1222-
optional Vector3d velocity = 6;
1223-
1224-
// The orientation rate of the bone.
1225-
//
1226-
// Reference system is the root, defined by
1227-
// \c PersonSkeleton::bbcenter_to_root.
1228-
//
1229-
optional Orientation3d orientation_rate = 7;
1230-
1231-
// The type of the bone.
1232-
//
1233-
// \image html OSI_PedestrianModelHierarchy.jpg
1234-
//
1235-
enum Type
1236-
{
1237-
// Root point of the person. Defined by
1238-
// \c PersonSkeleton::bbcenter_to_root.
1239-
//
1240-
TYPE_ROOT = 0;
1241-
1242-
// Bone defining the hip.
1243-
//
1244-
TYPE_HIP = 1;
1245-
1246-
// Bone defining the lower part of the spine.
1247-
//
1248-
TYPE_LOWER_SPINE = 2;
1249-
1250-
// Bone defining the upper part of the spine.
1251-
//
1252-
TYPE_UPPER_SPINE = 3;
1253-
1254-
// Bone defining the neck.
1255-
//
1256-
TYPE_NECK = 4;
1257-
1258-
// Bone defining the head.
1259-
//
1260-
TYPE_HEAD = 5;
1261-
1262-
// Bone defining the left shoulder.
1263-
//
1264-
TYPE_SHOULDER_L = 6;
1265-
1266-
// Bone defining the right shoulder.
1267-
//
1268-
TYPE_SHOULDER_R = 7;
1269-
1270-
// Bone defining the left upper arm.
1271-
//
1272-
TYPE_UPPER_ARM_L = 8;
1273-
1274-
// Bone defining the right upper arm.
1275-
//
1276-
TYPE_UPPER_ARM_R = 9;
1277-
1278-
// Bone defining the left forearm.
1279-
//
1280-
TYPE_LOWER_ARM_L = 10;
1281-
1282-
// Bone defining the right forearm.
1283-
//
1284-
TYPE_LOWER_ARM_R = 11;
1285-
1286-
// Bone defining the left hand.
1287-
//
1288-
TYPE_FULL_HAND_L = 12;
1289-
1290-
// Bone defining the right hand.
1291-
//
1292-
TYPE_FULL_HAND_R = 13;
1293-
1294-
// Bone defining the left thigh.
1295-
//
1296-
TYPE_UPPER_LEG_L = 14;
1297-
1298-
// Bone defining the right thigh.
1299-
//
1300-
TYPE_UPPER_LEG_R = 15;
1301-
1302-
// Bone defining the left shin.
1303-
//
1304-
TYPE_LOWER_LEG_L = 16;
1305-
1306-
// Bone defining the right shin.
1307-
//
1308-
TYPE_LOWER_LEG_R = 17;
1309-
1310-
// Bone defining the left foot.
1311-
//
1312-
TYPE_FULL_FOOT_L = 18;
1313-
1314-
// Bone defining the right foot.
1315-
//
1316-
TYPE_FULL_FOOT_R = 19;
1317-
}
1318-
}
1319-
}

osi_object.proto

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,12 +1302,10 @@ message MovingObject
13021302
// This is an extension to the \c MovingObject with additional information
13031303
// describing a pedestrian in more detail.
13041304
//
1305-
// \note The skeleton data (\c #bbcenter_to_root and \c Bone) in this
1306-
// message is structurally equivalent to the common
1307-
// \c PersonSkeleton type defined in osi_common.proto. In OSI 4, this
1308-
// message is planned to use \c PersonSkeleton directly, replacing the
1309-
// local definitions. For new integrations, consider using
1310-
// \c PersonSkeleton where possible.
1305+
// \note The \c Bone type defined in this message is also reused by
1306+
// \c Occupant::Skeleton for vehicle occupant pose representation.
1307+
// In OSI 4, a common skeleton type is planned to replace both
1308+
// usages.
13111309
//
13121310
message PedestrianAttributes
13131311
{

osi_occupant.proto

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ syntax = "proto2";
33
option optimize_for = SPEED;
44

55
import "osi_common.proto";
6+
import "osi_object.proto";
67

78
package osi3;
89

@@ -39,15 +40,51 @@ message Occupant
3940
// The skeleton of the occupant.
4041
//
4142
// The skeleton represents the posture and body structure of the occupant
42-
// within the host vehicle. Bone positions and orientations are defined
43-
// relative to the skeleton root point.
43+
// within the host vehicle.
4444
//
45-
// The \c PersonSkeleton::bbcenter_to_root field provides the offset
46-
// from the vehicle's bounding box center
47-
// (\c MovingObject::base . \c BaseMoving::position) to the skeleton
48-
// root point.
45+
optional Skeleton skeleton = 4;
46+
47+
//
48+
// \brief Skeleton data describing the posture of the occupant.
49+
//
50+
// The skeleton is defined relative to a root point. The root point
51+
// itself is positioned relative to the vehicle's bounding box center
52+
// using \c #bbcenter_to_root.
4953
//
50-
optional PersonSkeleton skeleton = 4;
54+
// \note This message reuses
55+
// \c MovingObject::PedestrianAttributes::Bone to avoid type
56+
// duplication. In OSI 4, a common skeleton type is planned to
57+
// replace both this and \c MovingObject::PedestrianAttributes.
58+
//
59+
message Skeleton
60+
{
61+
// Position offset from the vehicle's bounding box center
62+
// (\c MovingObject::base . \c BaseMoving::position) to the
63+
// current position of the root point of the skeleton model,
64+
// analogous to
65+
// \c MovingObject::VehicleAttributes::bbcenter_to_rear.
66+
//
67+
optional Vector3d bbcenter_to_root = 1;
68+
69+
// List of all bones of the occupant.
70+
//
71+
// The number of bones may vary, based on the detail level of
72+
// the model used. For example, some simulators will not include
73+
// detailed data about the hands of an occupant.
74+
//
75+
// \note A bone of each type can be provided, or left out,
76+
// depending on the desired level of detail, or available data.
77+
// However, if a bone is defined, all bones in the chain from
78+
// that bone back to the root point must be provided to create
79+
// a complete chain.
80+
//
81+
// \note Reuses \c MovingObject::PedestrianAttributes::Bone
82+
// for the bone definition. Bone positions and orientations are
83+
// defined relative to the skeleton root point
84+
// (\c #bbcenter_to_root).
85+
//
86+
repeated MovingObject.PedestrianAttributes.Bone skeleton_bone = 2;
87+
}
5188

5289
//
5390
// \brief Information regarding the classification of the occupant.

0 commit comments

Comments
 (0)