Add clock sensor type.
PiperOrigin-RevId: 459720950 Change-Id: Ibda48ae7dc4aa7be451a947a1c53d10a7eaf176b
This commit is contained in:
committed by
Copybara-Service
parent
d3a86bb748
commit
c14a7ef4a7
@@ -3533,7 +3533,7 @@ void mjCSensor::Compile(void) {
|
||||
|
||||
// get sensorized object id
|
||||
objid = pobj->id;
|
||||
} else {
|
||||
} else if (type != mjSENS_CLOCK) {
|
||||
throw mjCError(this, "invalid type in sensor '%s' (id = %d)", name.c_str(), id);
|
||||
}
|
||||
|
||||
@@ -3804,6 +3804,12 @@ void mjCSensor::Compile(void) {
|
||||
}
|
||||
break;
|
||||
|
||||
case mjSENS_CLOCK:
|
||||
dim = 1;
|
||||
needstage = mjSTAGE_POS;
|
||||
datatype = mjDATATYPE_REAL;
|
||||
break;
|
||||
|
||||
case mjSENS_USER:
|
||||
// check for negative dim
|
||||
if (dim<0) {
|
||||
|
||||
Reference in New Issue
Block a user