Skip to content

Commit

Permalink
{Feature} add cameraId to ImageDataRecord
Browse files Browse the repository at this point in the history
Summary: add cameraId to ImageDataRecord to allow output image data from data provider to contain information of which camera it came from.

Reviewed By: seanwarren-meta, SeaOtocinclus

Differential Revision: D48122194

fbshipit-source-id: ce979d6e44127c320047460da70239ea8a0e69d5
  • Loading branch information
Cheng Peng authored and facebook-github-bot committed Aug 10, 2023
1 parent bde7de5 commit f301006
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/data_provider/players/ImageSensorPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ bool ImageSensorPlayer::onDataLayoutRead(
configRecord_.description = config.description.get();
} else if (r.recordType == vrs::Record::Type::DATA) {
auto& data = getExpectedLayout<datalayout::ImageSensorDataRecordMetadata>(dl, blockIndex);
dataRecord_.cameraId = configRecord_.cameraId;
dataRecord_.groupId = data.groupId.get();
dataRecord_.groupMask = data.groupMask.get();
dataRecord_.frameNumber = data.frameNumber.get();
Expand Down
1 change: 1 addition & 0 deletions core/data_provider/players/ImageSensorPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ struct ImageConfigRecord {
* @brief Image data type: meta data
*/
struct ImageDataRecord {
uint32_t cameraId; ///< @brief ID of the camera, 0 to N
uint64_t groupId;
uint64_t groupMask;
uint64_t frameNumber; ///< @brief index of the frame
Expand Down
1 change: 1 addition & 0 deletions core/python/SensorDataPyBind.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ inline void declareImageDataRecord(py::module& m) {
.def_readwrite("description", &ImageConfigRecord::description);
py::class_<ImageDataRecord>(m, "ImageDataRecord")
.def(py::init<>())
.def_readwrite("camera_id", &ImageDataRecord::cameraId, "ID of the camera, 0 to N")
.def_readwrite("group_id", &ImageDataRecord::groupId)
.def_readwrite("group_mask", &ImageDataRecord::groupMask)
.def_readwrite("frame_number", &ImageDataRecord::frameNumber, "index of the frame")
Expand Down

0 comments on commit f301006

Please sign in to comment.