|
| 1 | +<?xml version="1.0" ?> |
| 2 | + |
| 3 | +<robot name="karaburan" xmlns:xacro="http://www.ros.org/wiki/xacro"> |
| 4 | + <material name="black"> |
| 5 | + <color rgba="0.9 0.9 0.9 0.8" /> |
| 6 | + </material> |
| 7 | + |
| 8 | + <!-- Box inertia (COM op link-origin) --> |
| 9 | + <xacro:macro name="inertial_box" params="m x y z"> |
| 10 | + <inertial> |
| 11 | + <origin xyz="0 0 ${z*0.4}" rpy="0 0 0"/> |
| 12 | + <mass value="${m}"/> |
| 13 | + <inertia |
| 14 | + ixx="${m*(y*y+z*z)/12.0}" ixy="0" ixz="0" |
| 15 | + iyy="${m*(x*x+z*z)/12.0}" iyz="0" |
| 16 | + izz="${m*(x*x+y*y)/12.0}"/> |
| 17 | + </inertial> |
| 18 | + </xacro:macro> |
| 19 | + |
| 20 | + <xacro:macro name="inertial_cylinder_z" params="m r l"> |
| 21 | + <inertial> |
| 22 | + <origin xyz="0 0 0" rpy="0 0 0"/> |
| 23 | + <mass value="${m}"/> |
| 24 | + <inertia |
| 25 | + ixx="${m*(3*r*r + l*l)/12.0}" ixy="0" ixz="0" |
| 26 | + iyy="${m*(3*r*r + l*l)/12.0}" iyz="0" |
| 27 | + izz="${0.5*m*r*r}"/> |
| 28 | + </inertial> |
| 29 | + </xacro:macro> |
| 30 | + |
| 31 | + <link name="base_footprint"/> |
| 32 | + <link name="base_link"> |
| 33 | + <visual> |
| 34 | + <geometry> |
| 35 | + <box size="0.6 0.4 0.2" /> |
| 36 | + </geometry> |
| 37 | + <origin xyz="0 0 0.1" rpy="0 0 0" /> |
| 38 | + <material name="black" /> |
| 39 | + </visual> |
| 40 | + <collision> |
| 41 | + <geometry> |
| 42 | + <box size="0.6 0.4 0.2" /> |
| 43 | + </geometry> |
| 44 | + <origin xyz="0 0 0.1" rpy="0 0 0" /> |
| 45 | + </collision> |
| 46 | + <xacro:inertial_box m="4.0" x="0.6" y="0.4" z="0.2" /> |
| 47 | + </link> |
| 48 | + |
| 49 | + <link name="imu_link"> |
| 50 | + <visual> |
| 51 | + <geometry> |
| 52 | + <box size="0.03 0.03 0.001"/> |
| 53 | + </geometry> |
| 54 | + <origin xyz="0 0 0" rpy="0 0 0" /> |
| 55 | + <material name="black" /> |
| 56 | + </visual> |
| 57 | + |
| 58 | + <sensor name="imu_sensor" type="imu"> |
| 59 | + <always_on>1</always_on> |
| 60 | + <update_rate>1</update_rate> |
| 61 | + <visualize>true</visualize> |
| 62 | + <topic>imu</topic> |
| 63 | + </sensor> |
| 64 | + </link> |
| 65 | + |
| 66 | + <link name="gps"> |
| 67 | + <visual> |
| 68 | + <geometry> |
| 69 | + <box size="0.03 0.03 0.01"/> |
| 70 | + </geometry> |
| 71 | + <origin xyz="0 0 0" rpy="0 0 0" /> |
| 72 | + <material name="black" /> |
| 73 | + </visual> |
| 74 | + </link> |
| 75 | + |
| 76 | + <link name="lidar"> |
| 77 | + <visual> |
| 78 | + <geometry> |
| 79 | + <cylinder radius="0.05" length="0.05" /> |
| 80 | + </geometry> |
| 81 | + <origin xyz="0 0 0" rpy="0 0 0" /> |
| 82 | + <material name="black" /> |
| 83 | + </visual> |
| 84 | + <collision> |
| 85 | + <geometry> |
| 86 | + <box size="0.1 0.1 0.05" /> |
| 87 | + </geometry> |
| 88 | + <origin xyz="0 0 0" rpy="0 0 0" /> |
| 89 | + <material name="black" /> |
| 90 | + </collision> |
| 91 | + |
| 92 | + <sensor name="lidar" type="gpu_lidar"> |
| 93 | + <always_on>true</always_on> |
| 94 | + <visualize>true</visualize> |
| 95 | + <update_rate>5</update_rate> |
| 96 | + <topic>scan</topic> |
| 97 | + <gz_frame_id>lidar_link</gz_frame_id> |
| 98 | + <lidar> |
| 99 | + <scan> |
| 100 | + <horizontal> |
| 101 | + <samples>360</samples> |
| 102 | + <resolution>1.000000</resolution> |
| 103 | + <min_angle>0.000000</min_angle> |
| 104 | + <max_angle>6.280000</max_angle> |
| 105 | + </horizontal> |
| 106 | + </scan> |
| 107 | + <range> |
| 108 | + <min>0.120000</min> |
| 109 | + <max>3.5</max> |
| 110 | + <resolution>0.015000</resolution> |
| 111 | + </range> |
| 112 | + <noise> |
| 113 | + <type>gaussian</type> |
| 114 | + <mean>0.0</mean> |
| 115 | + <stddev>0.01</stddev> |
| 116 | + </noise> |
| 117 | + </lidar> |
| 118 | + </sensor> |
| 119 | + </link> |
| 120 | + |
| 121 | + <joint name="base_footprint_to_base_link" type="fixed"> |
| 122 | + <parent link="base_footprint"/> |
| 123 | + <child link="base_link"/> |
| 124 | + <origin xyz="0 0 0" rpy="0 0 0"/> |
| 125 | + </joint> |
| 126 | + |
| 127 | + <joint name="base_imu_joint" type="fixed"> |
| 128 | + <parent link="base_link" /> |
| 129 | + <child link="imu_link" /> |
| 130 | + <origin xyz="0.25 0 0.201" rpy="0 0 0" /> |
| 131 | + </joint> |
| 132 | + |
| 133 | + <joint name="base_gps_joint" type="fixed"> |
| 134 | + <parent link="base_link" /> |
| 135 | + <child link="gps" /> |
| 136 | + <origin xyz="-0.25 0 0.201" rpy="0 0 0" /> |
| 137 | + </joint> |
| 138 | + |
| 139 | + <xacro:macro name="prop_link" params="prefix"> |
| 140 | + <link name="${prefix}_prop"> |
| 141 | + <visual> |
| 142 | + <geometry> |
| 143 | + <cylinder radius="0.04" length="0.025" /> |
| 144 | + </geometry> |
| 145 | + <origin xyz="0 0 0" rpy="0 1.57 0" /> |
| 146 | + <material name="black" /> |
| 147 | + </visual> |
| 148 | + <xacro:inertial_cylinder_z m="0.05" r="0.03" l="0.01"/> |
| 149 | + </link> |
| 150 | + </xacro:macro> |
| 151 | + |
| 152 | + <xacro:prop_link prefix="left" /> |
| 153 | + <xacro:prop_link prefix="right" /> |
| 154 | + |
| 155 | + <joint name="base_lidar_joint" type="fixed"> |
| 156 | + <parent link="base_link" /> |
| 157 | + <child link="lidar" /> |
| 158 | + <origin xyz="0 0 0.225" rpy="0 0 0" /> |
| 159 | + </joint> |
| 160 | + |
| 161 | + <joint name="base_left_prop_joint" type="continuous"> |
| 162 | + <parent link="base_link" /> |
| 163 | + <child link="left_prop" /> |
| 164 | + <origin xyz="-0.25 0.1 -0.045" rpy="0 0 0" /> |
| 165 | + <axis xyz="1 0 0" /> |
| 166 | + </joint> |
| 167 | + |
| 168 | + <joint name="base_right_prop_joint" type="continuous"> |
| 169 | + <parent link="base_link" /> |
| 170 | + <child link="right_prop" /> |
| 171 | + <origin xyz="-0.25 -0.1 -0.045" rpy="0 0 0" /> |
| 172 | + <axis xyz="1 0 0" /> |
| 173 | + </joint> |
| 174 | +</robot> |
0 commit comments