Move tactile sensor to the engine.
PiperOrigin-RevId: 788863133 Change-Id: I3172ebb7641fa8146469da25cba7db794760e7b1
This commit is contained in:
committed by
Copybara-Service
parent
89f4789085
commit
51babec9c5
@@ -492,6 +492,7 @@ const char* MJCF[nMJCF][mjXATTRNUM] = {
|
||||
{"clock", "*", "4", "name", "cutoff", "noise", "user"},
|
||||
{"user", "*", "9", "name", "objtype", "objname", "datatype", "needstage",
|
||||
"dim", "cutoff", "noise", "user"},
|
||||
{"tactile", "*", "4", "name", "geom", "mesh", "user"},
|
||||
{"plugin", "*", "9", "name", "plugin", "instance", "cutoff", "objtype", "objname", "reftype", "refname",
|
||||
"user"},
|
||||
{"<"},
|
||||
@@ -4297,6 +4298,18 @@ void mjXReader::Sensor(XMLElement* section) {
|
||||
}
|
||||
}
|
||||
|
||||
// tactile sensor
|
||||
if (type == "tactile") {
|
||||
sensor->type = mjSENS_TACTILE;
|
||||
sensor->reftype = mjOBJ_GEOM;
|
||||
ReadAttrTxt(elem, "geom", refname, /*required=*/true);
|
||||
|
||||
// associate the sensor with a mesh
|
||||
sensor->objtype = mjOBJ_MESH;
|
||||
ReadAttrTxt(elem, "mesh", objname, /*required=*/true);
|
||||
mjs_setString(sensor->objname, objname.c_str());
|
||||
}
|
||||
|
||||
else if (type == "plugin") {
|
||||
sensor->type = mjSENS_PLUGIN;
|
||||
OnePlugin(elem, &sensor->plugin);
|
||||
|
||||
Reference in New Issue
Block a user