I'm working on an SDF file written in XML used to describe a robotic arm. There are many repeated parts in the robot and I'm trying to declare a variable of int type and reuse it in different parts of the code. However, I can't seem to get the code working properly in a simulator.
This is a snippet of my code (I've omitted some unrelated portions of the code):
<?xml version='1.0'?>
<sdf version='1.7'>
<!DOCTYPE model [<!ENTITY basesize "1 1 0.1">]>
<model name='working_arm'>
<link name='base'>
<visual name='base_visual'>
<pose>0 0 0.05 0 -0 0</pose>
<geometry>
<box>
<size>&basesize;</size>
</box>
</geometry>
</visual>
<link>
<model>
<sdf>
I think this fails because entities can only be declared as strings and size does not accept strings. However, I am unable to find any documentation on how to specify the entity declared to be an integer.
Replacing &basesize; with this manual input works so I know that it's not an issue with other parts of the code:
<size>1 1 0.1</size>
Edit: Something like this? Because it still doesn't seem to work.
<?xml version='1.0'?>
<!DOCTYPE sdf [<!ENTITY basesize "1 1 0.1">]>
<sdf version='1.7'>
<model name='working_arm'>
<link name='base'>
<visual name='base_visual'>
<pose>0 0 0.05 0 -0 0</pose>
<geometry>
<box>
<size>&basesize;</size>
</box>
</geometry>
</visual>
<link>
<model>
<sdf>