I have a very simple URDF model of my robot and for some reason, I cannot display the model correctly:
Here is my definition of chassis.xacro:
<?xml version="1.0" ?>
<robot name="chassis" xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:property name="length" value="2" />
<xacro:property name="width" value="1" />
<xacro:property name="height" value="0.1" />
<xacro:property name="mass" value="5" />
<xacro:property name="radius" value="0.2" />
<xacro:property name="wmass" value="0.2" />
<xacro:property name="wwidth" value="0.2" />
<!--xacro:macro name="chassis" params="position parent r1 r2 height"-->
<xacro:include filename="$(find genius_description)/urdf/wheel.xacro"/>
<link name="base_link">
<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<box size="${length} ${width} ${height}"/>
</geometry>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<box size="${length} ${width} ${height}"/>
</geometry>
</collision>
<inertial>
<origin xyz="0 0 0" rpy="0 0 0"/>
<mass value="${mass}"/>
<inertia ixx="0 0 0" ixy="0 0 0" ixz="0 0 0"
iyy="0 0 0" iyz="0 0 0"
izz="0 0 0"/>
</inertial>
</link>
<link name="base_footprint"/>
<joint name="base_joint" type="fixed">
<parent link="base_footprint"/>
<child link="base_link"/>
<origin xyz="0 0 0.2" rpy="0 0 0"/>
</joint>
<xacro:wheel position="tl"
parent="base_link"
X="0.5"
Y="0.5"/>
<xacro:wheel position="tr"
parent="base_link"
X="0.5"
Y="-0.5"/>
<xacro:wheel position="bl"
parent="base_link"
X="-0.5"
Y="0.5"/>
<xacro:wheel position="br"
parent="base_link"
X="-0.5"
Y="-0.5"/>
</robot>
And wheel.xacro:
<?xml version="1.0" ?>
<robot xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:macro name="wheel" params="position parent X Y">
<!-- Wheel Link -->
<link name="${position}_wheel">
<visual>
<origin xyz="0 0 0" rpy="${-pi/2} 0 0"/>
<geometry>
<cylinder length="${wwidth}" radius="${radius}"/>
</geometry>
</visual>
<collision>
<origin xyz="0 0 0" rpy="${-pi/2} 0 0"/>
<geometry>
<cylinder length="${wwidth}" radius="${radius}"/>
</geometry>
</collision>
<inertial>
<origin xyz="0 0 0" rpy="${-pi/2} 0 0"/>
<mass value="${wmass}"/>
<inertia ixx="${1/12*wmass*3*radius**2+1/12*wmass*wwidth**2}" ixy="0.0" ixz="0.0"
iyy="${1/12*wmass*3*radius**2+1/12*wmass*wwidth**2}" iyz="0.0"
izz="${1/12*wmass*radius**2}"/>
</inertial>
</link>
<!-- Wheel Joint -->
<joint name="${position}_wheel_joint" type="continuous">
<parent link="${parent}"/>
<child link="${position}_wheel"/>
<origin xyz="${X} ${Y} -${radius}" rpy="0 0 0"/>
<axis xyz="0 1 0" rpy="0 0 0"/>
<limit effort="64" velocity="2"/>
<joint_properties damping="0.0" friction="0.0"/>
</joint>
</xacro:macro>
</robot>
Originally posted by EdwardNur on ROS Answers with karma: 115 on 2019-05-06
Post score: 0