|
10 | 10 | <color rgba="0 0 1 1.0"/> |
11 | 11 | </material> |
12 | 12 |
|
13 | | - <xacro:macro name="rotor" params="rotor parent xyz color"> |
| 13 | + <xacro:macro name="rotor" params="rotor parent xyz color namespace"> |
14 | 14 | <link name='rotor_${rotor}'> |
15 | 15 | <inertial> |
16 | 16 | <mass value="0.005"/> |
17 | 17 | <inertia ixx="9.75e-07" ixy="0" ixz="0" iyy="4.17041e-05" iyz="0" izz="4.26041e-05"/> |
18 | 18 | </inertial> |
19 | 19 |
|
20 | | - <collision name='rotor_${rotor}_collision'> |
| 20 | + <collision> |
21 | 21 | <geometry> |
22 | 22 | <cylinder length="0.005" radius="0.1"/> |
23 | 23 | </geometry> |
24 | 24 | </collision> |
25 | | - <visual name='rotor_${rotor}_visual'> |
| 25 | + <visual> |
26 | 26 | <geometry> |
27 | 27 | <mesh filename="$(find as2_gazebo_assets)/models/quadrotor_base/meshes/propeller_ccw.dae" scale="0.1 0.1 0.1"/> |
28 | 28 | </geometry> |
|
44 | 44 |
|
45 | 45 | <xacro:macro name="quadrotor" params="namespace"> |
46 | 46 |
|
47 | | - <link name="base"></link> |
48 | | - |
49 | 47 | <!-- This is from quadrotor_base from as2 --> |
50 | 48 | <link name="base_link"> |
51 | | - <enable_wind>true</enable_wind> |
| 49 | + <gazebo> |
| 50 | + <enable_wind>true</enable_wind> |
| 51 | + </gazebo> |
52 | 52 | <inertial> |
53 | 53 | <mass value="1.5"/> |
54 | 54 | <inertia ixx="0.025" ixy="0" ixz="0" iyy="0.009" iyz="0" izz="0.033"/> |
|
58 | 58 | <box size="0.47 0.47 0.11"/> |
59 | 59 | </geometry> |
60 | 60 | </collision> |
61 | | - <visual name='base_link_inertia_visual'> |
| 61 | + <visual> |
62 | 62 | <geometry> |
63 | 63 | <mesh filename="$(find as2_gazebo_assets)/models/quadrotor_base/meshes/quadrotor.dae"/> |
64 | 64 | </geometry> |
|
86 | 86 | </visual> |
87 | 87 | </link> |
88 | 88 |
|
89 | | - <joint name="base_to_base_link" type="fixed"> |
90 | | - <parent link="base"/> |
91 | | - <child link="base_link"/> |
92 | | - <origin xyz="0 0 0" rpy="0 0 0"/> |
93 | | - </joint> |
94 | | - |
95 | | - <xacro:rotor rotor="0" parent="base_link" xyz="0.13 -0.22 0.023" color="Blue"/> |
96 | | - <xacro:rotor rotor="1" parent="base_link" xyz="-0.13 0.2 0.023" color="Red"/> |
97 | | - <xacro:rotor rotor="2" parent="base_link" xyz="0.13 0.22 0.023" color="Blue"/> |
98 | | - <xacro:rotor rotor="3" parent="base_link" xyz="-0.13 -0.2 0.023" color="Red"/> |
| 89 | + <xacro:rotor rotor="0" parent="base_link" xyz="0.13 -0.22 0.023" color="Blue" namespace="${namespace}"/> |
| 90 | + <xacro:rotor rotor="1" parent="base_link" xyz="-0.13 0.2 0.023" color="Red" namespace="${namespace}"/> |
| 91 | + <xacro:rotor rotor="2" parent="base_link" xyz="0.13 0.22 0.023" color="Blue" namespace="${namespace}"/> |
| 92 | + <xacro:rotor rotor="3" parent="base_link" xyz="-0.13 -0.2 0.023" color="Red" namespace="${namespace}"/> |
99 | 93 |
|
100 | | - <xacro:imu mass="0.005" parent="base_link"/> |
101 | | - <xacro:velocity namespace="${namespace}"/> |
102 | 94 | <xacro:tf freq="100"/> |
103 | | - <xacro:odom topic="/${namespace}/odom" freq="100"/> |
| 95 | + <xacro:imu mass="0.005" parent="base_link" namespace="${namespace}"/> |
| 96 | + <xacro:odom topic="odom" freq="100" namespace="${namespace}"/> |
104 | 97 | <xacro:motors namespace="${namespace}"/> |
| 98 | + <xacro:velocity namespace="${namespace}"/> |
105 | 99 | </xacro:macro> |
106 | 100 | </robot> |
0 commit comments