Closed traversaro closed 5 years ago
Ok for me nice idea
variable_names
tag sounds straightforward and neat.
However, in case of shorter tags, (just brainstorming here) how about descriptors
or identifiers
? Would it make sense ?
I would like to stick to something containing "variables" as this is the Jargon used in the FMI specification: https://fmi-standard.org/docs/2.0.1-develop/#_definition_of_model_variables_modelvariables , but I am definitely open to something better than variable_names
.
I think it is safer to encode the variable name as an attribute, rather than an inner text element, i.e. as in:
<plugin name="fmi_actuator_plugin" filename="libFMIActuatorPlugin.so">
<actuator>
<name>actuator_0</name>
<joint>JOINT_0</joint>
<fmu>electric_motor.fmu</fmu>
<variable_names>
<actuatorInput name="motorInput" />
</variable_names>
</actuator>
</plugin>
The basic idea is that in FMI
the variable name is indeed encoded as an attribute of the ScalarVariable
tag (see https://fmi-standard.org/docs/2.0.1-develop/#_example_xml_description_file_2), so as long as we encode the name ourself as attributes, we know that we will support any kind of strange variable name. For the same reason we could encode the default name as an attribute as well (<variable_name defaultName="actuatorInput" name="motorInput"/>
) but as we are choosing the default name our self I think we can ensure that we can choose simple enough names.
At the moment, we need to explictly specify the variable names in each fmu, as in:
especially if some explicitly prepares its own FMUs to use them with
gazebo-fmi
, the variable names will always be the same, and manually specify them is just error prone.I think a nice alternative is instead to assume that the variable have some default name (in the actuator case, actuatorInput, etc etc) and the user just need to specify the variable name if it is different from the default. To make an example, this:
will be equivalent to this:
and to this:
Obviously, it would not make sense to specify the names of the variables if they are the default one, so the user will actually use the
variable_names
tag if he has some variable names different from the default, see for example:What do you think @prashanthr05 @triccyx ?