Add additional data fields that can be reported by rangefinder sensors.
PiperOrigin-RevId: 848316991 Change-Id: Idbf7ba81b4da711a22c23302c8782ab2b0b98d82
This commit is contained in:
committed by
Copybara-Service
parent
f2e9097ed6
commit
70bc7be4bc
@@ -112,6 +112,16 @@ const int mjCONDATA_SIZE[mjNCONDATA] = {
|
||||
};
|
||||
|
||||
|
||||
// size of ray data fields
|
||||
const int mjRAYDATA_SIZE[mjNRAYDATA] = {
|
||||
1, // mjRAYDATA_DIST
|
||||
3, // mjRAYDATA_DIR
|
||||
3, // mjRAYDATA_ORIGIN
|
||||
3, // mjRAYDATA_POINT
|
||||
3, // mjRAYDATA_NORMAL
|
||||
1 // mjRAYDATA_DEPTH
|
||||
};
|
||||
|
||||
//-------------------------- get/set state ---------------------------------------------------------
|
||||
|
||||
// return size of a single state element
|
||||
@@ -745,6 +755,18 @@ int mju_condataSize(int dataspec) {
|
||||
}
|
||||
|
||||
|
||||
// return total size of data in a rangefinder sensor bitfield specification
|
||||
int mju_raydataSize(int dataspec) {
|
||||
int size = 0;
|
||||
for (int i=0; i < mjNRAYDATA; i++) {
|
||||
if (dataspec & (1 << i)) {
|
||||
size += mjRAYDATA_SIZE[i];
|
||||
}
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
// compute camera pixel parameters from model, output are:
|
||||
// pixel units: fx, fy (focal lengths), cx, cy (principal point)
|
||||
// length units: extent
|
||||
|
||||
Reference in New Issue
Block a user