Sensors of type user no longer require objtype and objname. If unspecified, the objtype will be mjOBJ_UNKNOWN. Also, `user sensors datatype default is now "real"`.

PiperOrigin-RevId: 489652972
Change-Id: I0a8f21ee1a2f5292e6bbcfe3785536cfd1498b85
This commit is contained in:
Yuval Tassa
2022-11-19 02:04:53 -08:00
committed by Copybara-Service
parent 6f2092bef2
commit 221c63d744
8 changed files with 96 additions and 14 deletions
+2 -2
View File
@@ -3697,7 +3697,7 @@ void mjCSensor::Compile(void) {
// get sensorized object id
objid = pobj->id;
} else if (type != mjSENS_CLOCK && type != mjSENS_PLUGIN) {
} else if (type != mjSENS_CLOCK && type != mjSENS_PLUGIN && type != mjSENS_USER) {
throw mjCError(this, "invalid type in sensor '%s' (id = %d)", name.c_str(), id);
}
@@ -3779,7 +3779,7 @@ void mjCSensor::Compile(void) {
"joint must be slide or hinge in sensor '%s' (id = %d)", name.c_str(), id);
}
//set
// set
dim = 1;
datatype = mjDATATYPE_REAL;
if (type==mjSENS_JOINTPOS) {