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:
Alessio Quaglino
2024-10-07 07:56:17 -07:00
committed by Copybara-Service
parent 5bfc7da7de
commit 66faba9aa5
14 changed files with 53 additions and 62 deletions
+1 -2
View File
@@ -1412,7 +1412,7 @@ class mjCPlugin_ : public mjCBase {
std::vector<char> flattened_attributes; // config attributes flattened in plugin-declared order;
protected:
std::string instance_name;
std::string plugin_name;
};
class mjCPlugin : public mjCPlugin_ {
@@ -1428,7 +1428,6 @@ class mjCPlugin : public mjCPlugin_ {
private:
void Compile(void); // compiler
void NameSpace(const mjCModel* m);
};