Avoid changing semantics of mjsPlugin.name across XML sections.
The `extension` section used to discard the plugin name and write the instance name in `plugin.name`, while all of the other sections wrote the instance name in `plugin.instance_name` and optionally the plugin name in `plugin.name` (via the function `OnePlugin`). Now all plugin names are in `plugin.plugin_name` and the instance is written in `plugin.name`, so that it is possible to lookup a plugin via its unique instance name. PiperOrigin-RevId: 683183804 Change-Id: I179ef5d221143b720db24d745b09e327bf1449ef
This commit is contained in:
committed by
Copybara-Service
parent
5bfc7da7de
commit
66faba9aa5
@@ -170,7 +170,7 @@ TEST_F(PluginTest, ActivatePlugin) {
|
||||
|
||||
// associate plugin to body
|
||||
mjsBody* body = mjs_addBody(mjs_findBody(spec, "world"), 0);
|
||||
mjs_setString(body->plugin.name, "mujoco.elasticity.cable");
|
||||
mjs_setString(body->plugin.plugin_name, "mujoco.elasticity.cable");
|
||||
body->plugin.element = mjs_addPlugin(spec)->element;
|
||||
body->plugin.active = true;
|
||||
mjsGeom* geom = mjs_addGeom(body, 0);
|
||||
@@ -204,7 +204,7 @@ TEST_F(PluginTest, DeletePlugin) {
|
||||
// add actuator
|
||||
mjsActuator* actuator = mjs_addActuator(spec, 0);
|
||||
mjs_setString(actuator->target, "j1");
|
||||
mjs_setString(actuator->plugin.name, "mujoco.pid");
|
||||
mjs_setString(actuator->plugin.plugin_name, "mujoco.pid");
|
||||
actuator->plugin.element = mjs_addPlugin(spec)->element;
|
||||
actuator->plugin.active = true;
|
||||
actuator->trntype = mjTRN_JOINT;
|
||||
|
||||
Reference in New Issue
Block a user