Skip to content

Instantly share code, notes, and snippets.

@scpeters
Created January 21, 2021 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scpeters/c9fe5d1d4b0e2e47f06ce4ac75331eb3 to your computer and use it in GitHub Desktop.
Save scpeters/c9fe5d1d4b0e2e47f06ce4ac75331eb3 to your computer and use it in GitHub Desktop.
applying material properties to named and unnamed visuals in a urdf
<sdf version='1.7'>
<model name='urdf_gazebo_extension_test'>
<link name='link1a'>
<inertial>
<pose>0 -1.5 0 -2.14159 0.141593 0.858407</pose>
<mass>100</mass>
<inertia>
<ixx>2</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>3</iyy>
<iyz>0</iyz>
<izz>4</izz>
</inertia>
</inertial>
<visual name='link1a_fixed_joint_lump__named_visual_visual'>
<pose>0 -1.5 0 0 -0 0</pose>
<geometry>
<box>
<size>0.2 3 0.2</size>
</box>
</geometry>
</visual>
<gravity>1</gravity>
<velocity_decay/>
</link>
</model>
</sdf>
<?xml version="1.0" ?>
<robot name="urdf_gazebo_extension_test">
<link name="link1a">
<inertial>
<mass value="100"/>
<origin rpy="1 3 4" xyz="0 -1.5 0"/>
<inertia ixx="2" ixy="0" ixz="0" iyy="3" iyz="0" izz="4"/>
</inertial>
<visual name="named_visual">
<geometry>
<box size="0.2 3.0 0.2"/>
</geometry>
<origin rpy="0 0 0" xyz="0 -1.5 0"/>
</visual>
</link>
<gazebo reference="link1a">
<visual>
<material>
<ambient>0 1 0 1.0</ambient>
</material>
</visual>
</gazebo>
</robot>
<sdf version='1.7'>
<model name='urdf_gazebo_extension_test'>
<link name='link1a'>
<inertial>
<pose>0 -1.5 0 -2.14159 0.141593 0.858407</pose>
<mass>100</mass>
<inertia>
<ixx>2</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>3</iyy>
<iyz>0</iyz>
<izz>4</izz>
</inertia>
</inertial>
<visual name='link1a_visual'>
<pose>0 -1.5 0 0 -0 0</pose>
<geometry>
<box>
<size>0.2 3 0.2</size>
</box>
</geometry>
<material>
<ambient>0 1 0 1</ambient>
</material>
</visual>
<gravity>1</gravity>
<velocity_decay/>
</link>
</model>
</sdf>
<?xml version="1.0" ?>
<robot name="urdf_gazebo_extension_test">
<link name="link1a">
<inertial>
<mass value="100"/>
<origin rpy="1 3 4" xyz="0 -1.5 0"/>
<inertia ixx="2" ixy="0" ixz="0" iyy="3" iyz="0" izz="4"/>
</inertial>
<visual>
<geometry>
<box size="0.2 3.0 0.2"/>
</geometry>
<origin rpy="0 0 0" xyz="0 -1.5 0"/>
</visual>
</link>
<gazebo reference="link1a">
<visual>
<material>
<ambient>0 1 0 1.0</ambient>
</material>
</visual>
</gazebo>
</robot>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment