Robotics StackExchange | Archived questions

Does Gazebo support declaration of variables using DOCTYPE?

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 using DOCTYPE and reuse it in different parts of the code. However, I am unable to insert the model into Gazebo (nothing appears).

This is a snippet of my code (I've omitted some unrelated portions of the code):

<?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>

However, the model appears when I remove the DOCTYPE line and replace &basesize; with 1 1 0.1.

Asked by gerald on 2022-01-07 05:23:31 UTC

Comments

Answers