|
| 1 | +<?xml version="1.0"?> |
| 2 | +<robot name="robot" xmlns:xacro="http://www.ros.org/wiki/xacro"> |
| 3 | + <xacro:include filename="$(find fuse_models)/test/wheel.xacro"/> |
| 4 | + |
| 5 | + <xacro:property name="deg_to_rad" value="0.01745329251994329577"/> |
| 6 | + |
| 7 | + <!-- Constants for robot dimensions --> |
| 8 | + <xacro:property name="width" value="0.5" /> <!-- Square dimensions (widthxwidth) of beams --> |
| 9 | + <xacro:property name="wheel_radius" value="0.11" /> <!-- Link 1 --> |
| 10 | + <xacro:property name="thickness" value="0.086" /> <!-- Link 2 --> |
| 11 | + |
| 12 | + <!-- Links: inertial,visual,collision --> |
| 13 | + <link name="base_link"> |
| 14 | + <inertial> |
| 15 | + <!-- origin is relative --> |
| 16 | + <origin xyz="0 0 0" rpy="0 0 0"/> |
| 17 | + <mass value="5"/> |
| 18 | + <inertia ixx="5" ixy="0" ixz="0" iyy="5" iyz="0" izz="5"/> |
| 19 | + </inertial> |
| 20 | + <visual> |
| 21 | + <geometry> |
| 22 | + <box size="${width} 0.1 0.1"/> |
| 23 | + </geometry> |
| 24 | + </visual> |
| 25 | + <collision> |
| 26 | + <!-- origin is relative --> |
| 27 | + <origin xyz="0 0 0"/> |
| 28 | + <geometry> |
| 29 | + <box size="${width} 0.1 0.1"/> |
| 30 | + </geometry> |
| 31 | + </collision> |
| 32 | + </link> |
| 33 | + |
| 34 | + <link name="base_footprint"> |
| 35 | + <visual> |
| 36 | + <geometry> |
| 37 | + <sphere radius="0.01"/> |
| 38 | + </geometry> |
| 39 | + </visual> |
| 40 | + <collision> |
| 41 | + <origin xyz="0 0 0"/> |
| 42 | + <geometry> |
| 43 | + <sphere radius="0.00000001"/> |
| 44 | + </geometry> |
| 45 | + </collision> |
| 46 | + </link> |
| 47 | + <joint name="base_footprint_joint" type="fixed"> |
| 48 | + <origin xyz="0 0 ${wheel_radius}" rpy="0 0 0"/> |
| 49 | + <child link="base_link"/> |
| 50 | + <parent link="base_footprint"/> |
| 51 | + </joint> |
| 52 | + |
| 53 | + <!-- Wheels --> |
| 54 | + <xacro:wheel name="wheel_0" parent="base" radius="${wheel_radius}" thickness="${thickness}"> |
| 55 | + <origin xyz="${(width+thickness)/2} 0 0" rpy="0 ${90.0 * deg_to_rad} 0"/> |
| 56 | + </xacro:wheel> |
| 57 | + <xacro:wheel name="wheel_1" parent="base" radius="${wheel_radius}" thickness="${thickness}"> |
| 58 | + <origin xyz="${-(width+thickness)/2} 0 0" rpy="0 ${90.0 * deg_to_rad} 0"/> |
| 59 | + </xacro:wheel> |
| 60 | + |
| 61 | + <!-- IMU --> |
| 62 | + <link name="imu_link"/> |
| 63 | + <joint name="imu_joint" type="fixed"> |
| 64 | + <parent link="base_link" /> |
| 65 | + <child link="imu_link" /> |
| 66 | + <origin xyz="0.1 -0.2 0.3" rpy="0.0 ${-90.0 * deg_to_rad} ${90.0 * deg_to_rad}"/> |
| 67 | + </joint> |
| 68 | + |
| 69 | + <gazebo reference="imu_link"> |
| 70 | + <gravity>true</gravity> |
| 71 | + <sensor name="imu_sensor" type="imu"> |
| 72 | + <always_on>true</always_on> |
| 73 | + <update_rate>50.0</update_rate> |
| 74 | + <visualize>true</visualize> |
| 75 | + <plugin name="imu_plugin" filename="libgazebo_ros_imu_sensor.so"> |
| 76 | + <topicName>imu</topicName> |
| 77 | + <bodyName>imu_link</bodyName> |
| 78 | + <updateRateHZ>50.0</updateRateHZ> |
| 79 | + <frameName>imu_link</frameName> |
| 80 | + <gaussianNoise>0.001</gaussianNoise> |
| 81 | + <xyzOffset>0 0 0</xyzOffset> |
| 82 | + <rpyOffset>0 0 0</rpyOffset> |
| 83 | + <initialOrientationAsReference>false</initialOrientationAsReference> |
| 84 | + </plugin> |
| 85 | + </sensor> |
| 86 | + </gazebo> |
| 87 | + |
| 88 | + <!-- ros_control plugin --> |
| 89 | + <gazebo> |
| 90 | + <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so"> |
| 91 | + <robotNamespace>/</robotNamespace> |
| 92 | + <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType> |
| 93 | + </plugin> |
| 94 | + </gazebo> |
| 95 | + |
| 96 | + <!-- Colour --> |
| 97 | + <gazebo reference="base_link"> |
| 98 | + <material>Gazebo/Green</material> |
| 99 | + </gazebo> |
| 100 | + |
| 101 | + <gazebo reference="base_footprint"> |
| 102 | + <material>Gazebo/Purple</material> |
| 103 | + </gazebo> |
| 104 | +</robot> |
0 commit comments