Parameters entries and expected formatting
MVSim uses a custom parameter parsing system defined in TParameterDefinitions
and TParamEntry classes. This system extends standard C sscanf format
specifiers with additional types commonly used in robotics and simulation.
Parameters can be defined in XML as either:
XML attributes:
<block mass="50.0" static="true"/>XML child elements:
<block><mass>50.0</mass><static>true</static></block>
Both forms are equivalent and parsed using the same system.
All those defined by standard sscanf, plus these extensions:
Format specifier |
C++ pointer to… |
Expected format |
|---|---|---|
|
|
A number, in degrees. |
|
|
A string. Whitespace will be trimmed. |
|
|
A color like |
|
|
Expects |
|
|
Expects |
|
|
Expects |
|
|
Expects |
|
|
Expects |
Special handling
NaN values
Some parameters use NaN (Not a Number) as a sentinel value to indicate “not set” or “use default”. For example:
Block
visual_scale: NaN means use the class-definedmodel_scaleBlock
zmin/zmax: NaN means auto-calculate from visual model
When parameters have default NaN values, omitting them in XML leaves them as NaN, which triggers the appropriate fallback behavior.