|
| 1 | +<?xml version="1.0"?> |
| 2 | +<sdf version="1.9"> |
| 3 | + <model name="iris_with_ardupilot_1"> |
| 4 | + <include> |
| 5 | + <uri>model://iris_with_standoffs</uri> |
| 6 | + </include> |
| 7 | + |
| 8 | + <!-- plugins --> |
| 9 | + <plugin filename="gz-sim-joint-state-publisher-system" |
| 10 | + name="gz::sim::systems::JointStatePublisher"> |
| 11 | + </plugin> |
| 12 | + |
| 13 | + <plugin filename="gz-sim-lift-drag-system" |
| 14 | + name="gz::sim::systems::LiftDrag"> |
| 15 | + <a0>0.3</a0> |
| 16 | + <alpha_stall>1.4</alpha_stall> |
| 17 | + <cla>4.2500</cla> |
| 18 | + <cda>0.10</cda> |
| 19 | + <cma>0.0</cma> |
| 20 | + <cla_stall>-0.025</cla_stall> |
| 21 | + <cda_stall>0.0</cda_stall> |
| 22 | + <cma_stall>0.0</cma_stall> |
| 23 | + <area>0.002</area> |
| 24 | + <air_density>1.2041</air_density> |
| 25 | + <cp>0.084 0 0</cp> |
| 26 | + <forward>0 1 0</forward> |
| 27 | + <upward>0 0 1</upward> |
| 28 | + <link_name>iris_with_standoffs::rotor_0</link_name> |
| 29 | + </plugin> |
| 30 | + <plugin filename="gz-sim-lift-drag-system" |
| 31 | + name="gz::sim::systems::LiftDrag"> |
| 32 | + <a0>0.3</a0> |
| 33 | + <alpha_stall>1.4</alpha_stall> |
| 34 | + <cla>4.2500</cla> |
| 35 | + <cda>0.10</cda> |
| 36 | + <cma>0.0</cma> |
| 37 | + <cla_stall>-0.025</cla_stall> |
| 38 | + <cda_stall>0.0</cda_stall> |
| 39 | + <cma_stall>0.0</cma_stall> |
| 40 | + <area>0.002</area> |
| 41 | + <air_density>1.2041</air_density> |
| 42 | + <cp>-0.084 0 0</cp> |
| 43 | + <forward>0 -1 0</forward> |
| 44 | + <upward>0 0 1</upward> |
| 45 | + <link_name>iris_with_standoffs::rotor_0</link_name> |
| 46 | + </plugin> |
| 47 | + |
| 48 | + <plugin filename="gz-sim-lift-drag-system" |
| 49 | + name="gz::sim::systems::LiftDrag"> |
| 50 | + <a0>0.3</a0> |
| 51 | + <alpha_stall>1.4</alpha_stall> |
| 52 | + <cla>4.2500</cla> |
| 53 | + <cda>0.10</cda> |
| 54 | + <cma>0.0</cma> |
| 55 | + <cla_stall>-0.025</cla_stall> |
| 56 | + <cda_stall>0.0</cda_stall> |
| 57 | + <cma_stall>0.0</cma_stall> |
| 58 | + <area>0.002</area> |
| 59 | + <air_density>1.2041</air_density> |
| 60 | + <cp>0.084 0 0</cp> |
| 61 | + <forward>0 1 0</forward> |
| 62 | + <upward>0 0 1</upward> |
| 63 | + <link_name>iris_with_standoffs::rotor_1</link_name> |
| 64 | + </plugin> |
| 65 | + <plugin filename="gz-sim-lift-drag-system" |
| 66 | + name="gz::sim::systems::LiftDrag"> |
| 67 | + <a0>0.3</a0> |
| 68 | + <alpha_stall>1.4</alpha_stall> |
| 69 | + <cla>4.2500</cla> |
| 70 | + <cda>0.10</cda> |
| 71 | + <cma>0.0</cma> |
| 72 | + <cla_stall>-0.025</cla_stall> |
| 73 | + <cda_stall>0.0</cda_stall> |
| 74 | + <cma_stall>0.0</cma_stall> |
| 75 | + <area>0.002</area> |
| 76 | + <air_density>1.2041</air_density> |
| 77 | + <cp>-0.084 0 0</cp> |
| 78 | + <forward>0 -1 0</forward> |
| 79 | + <upward>0 0 1</upward> |
| 80 | + <link_name>iris_with_standoffs::rotor_1</link_name> |
| 81 | + </plugin> |
| 82 | + |
| 83 | + <plugin filename="gz-sim-lift-drag-system" |
| 84 | + name="gz::sim::systems::LiftDrag"> |
| 85 | + <a0>0.3</a0> |
| 86 | + <alpha_stall>1.4</alpha_stall> |
| 87 | + <cla>4.2500</cla> |
| 88 | + <cda>0.10</cda> |
| 89 | + <cma>0.0</cma> |
| 90 | + <cla_stall>-0.025</cla_stall> |
| 91 | + <cda_stall>0.0</cda_stall> |
| 92 | + <cma_stall>0.0</cma_stall> |
| 93 | + <area>0.002</area> |
| 94 | + <air_density>1.2041</air_density> |
| 95 | + <cp>0.084 0 0</cp> |
| 96 | + <forward>0 -1 0</forward> |
| 97 | + <upward>0 0 1</upward> |
| 98 | + <link_name>iris_with_standoffs::rotor_2</link_name> |
| 99 | + </plugin> |
| 100 | + <plugin filename="gz-sim-lift-drag-system" |
| 101 | + name="gz::sim::systems::LiftDrag"> |
| 102 | + <a0>0.3</a0> |
| 103 | + <alpha_stall>1.4</alpha_stall> |
| 104 | + <cla>4.2500</cla> |
| 105 | + <cda>0.10</cda> |
| 106 | + <cma>0.0</cma> |
| 107 | + <cla_stall>-0.025</cla_stall> |
| 108 | + <cda_stall>0.0</cda_stall> |
| 109 | + <cma_stall>0.0</cma_stall> |
| 110 | + <area>0.002</area> |
| 111 | + <air_density>1.2041</air_density> |
| 112 | + <cp>-0.084 0 0</cp> |
| 113 | + <forward>0 1 0</forward> |
| 114 | + <upward>0 0 1</upward> |
| 115 | + <link_name>iris_with_standoffs::rotor_2</link_name> |
| 116 | + </plugin> |
| 117 | + |
| 118 | + <plugin filename="gz-sim-lift-drag-system" |
| 119 | + name="gz::sim::systems::LiftDrag"> |
| 120 | + <a0>0.3</a0> |
| 121 | + <alpha_stall>1.4</alpha_stall> |
| 122 | + <cla>4.2500</cla> |
| 123 | + <cda>0.10</cda> |
| 124 | + <cma>0.0</cma> |
| 125 | + <cla_stall>-0.025</cla_stall> |
| 126 | + <cda_stall>0.0</cda_stall> |
| 127 | + <cma_stall>0.0</cma_stall> |
| 128 | + <area>0.002</area> |
| 129 | + <air_density>1.2041</air_density> |
| 130 | + <cp>0.084 0 0</cp> |
| 131 | + <forward>0 -1 0</forward> |
| 132 | + <upward>0 0 1</upward> |
| 133 | + <link_name>iris_with_standoffs::rotor_3</link_name> |
| 134 | + </plugin> |
| 135 | + <plugin filename="gz-sim-lift-drag-system" |
| 136 | + name="gz::sim::systems::LiftDrag"> |
| 137 | + <a0>0.3</a0> |
| 138 | + <alpha_stall>1.4</alpha_stall> |
| 139 | + <cla>4.2500</cla> |
| 140 | + <cda>0.10</cda> |
| 141 | + <cma>0.0</cma> |
| 142 | + <cla_stall>-0.025</cla_stall> |
| 143 | + <cda_stall>0.0</cda_stall> |
| 144 | + <cma_stall>0.0</cma_stall> |
| 145 | + <area>0.002</area> |
| 146 | + <air_density>1.2041</air_density> |
| 147 | + <cp>-0.084 0 0</cp> |
| 148 | + <forward>0 1 0</forward> |
| 149 | + <upward>0 0 1</upward> |
| 150 | + <link_name>iris_with_standoffs::rotor_3</link_name> |
| 151 | + </plugin> |
| 152 | + |
| 153 | + <plugin name="gz::sim::systems::JointController" |
| 154 | + filename="gz-sim-joint-controller-system"> |
| 155 | + <joint_name>iris_with_standoffs::rotor_0_joint</joint_name> |
| 156 | + <use_force_commands>1</use_force_commands> |
| 157 | + <topic>/model/iris_with_ardupilot_1/joint/rotor_0_joint/cmd_vel</topic> |
| 158 | + <initial_velocity>0.0</initial_velocity> |
| 159 | + <p_gain>0.2</p_gain> |
| 160 | + <d_gain>0</d_gain> |
| 161 | + <cmd_max>2.5</cmd_max> |
| 162 | + <cmd_min>-2.5</cmd_min> |
| 163 | + </plugin> |
| 164 | + |
| 165 | + <plugin name="gz::sim::systems::JointController" |
| 166 | + filename="gz-sim-joint-controller-system"> |
| 167 | + <joint_name>iris_with_standoffs::rotor_1_joint</joint_name> |
| 168 | + <use_force_commands>1</use_force_commands> |
| 169 | + <topic>/model/iris_with_ardupilot_1/joint/rotor_1_joint/cmd_vel</topic> |
| 170 | + <initial_velocity>0.0</initial_velocity> |
| 171 | + <p_gain>0.2</p_gain> |
| 172 | + <d_gain>0</d_gain> |
| 173 | + <cmd_max>2.5</cmd_max> |
| 174 | + <cmd_min>-2.5</cmd_min> |
| 175 | + </plugin> |
| 176 | + |
| 177 | + <plugin name="gz::sim::systems::JointController" |
| 178 | + filename="gz-sim-joint-controller-system"> |
| 179 | + <joint_name>iris_with_standoffs::rotor_2_joint</joint_name> |
| 180 | + <use_force_commands>1</use_force_commands> |
| 181 | + <topic>/model/iris_with_ardupilot_1/joint/rotor_2_joint/cmd_vel</topic> |
| 182 | + <initial_velocity>0.0</initial_velocity> |
| 183 | + <p_gain>0.2</p_gain> |
| 184 | + <d_gain>0</d_gain> |
| 185 | + <cmd_max>2.5</cmd_max> |
| 186 | + <cmd_min>-2.5</cmd_min> |
| 187 | + </plugin> |
| 188 | + |
| 189 | + <plugin name="gz::sim::systems::JointController" |
| 190 | + filename="gz-sim-joint-controller-system"> |
| 191 | + <joint_name>iris_with_standoffs::rotor_3_joint</joint_name> |
| 192 | + <use_force_commands>1</use_force_commands> |
| 193 | + <topic>/model/iris_with_ardupilot_1/joint/rotor_3_joint/cmd_vel</topic> |
| 194 | + <initial_velocity>0.0</initial_velocity> |
| 195 | + <p_gain>0.2</p_gain> |
| 196 | + <d_gain>0</d_gain> |
| 197 | + <cmd_max>2.5</cmd_max> |
| 198 | + <cmd_min>-2.5</cmd_min> |
| 199 | + </plugin> |
| 200 | + |
| 201 | + <plugin name="ArduPilotPlugin" |
| 202 | + filename="ArduPilotPlugin"> |
| 203 | + <!-- Port settings --> |
| 204 | + <fdm_addr>127.0.0.1</fdm_addr> |
| 205 | + <fdm_port_in>9002</fdm_port_in> |
| 206 | + <connectionTimeoutMaxCount>5</connectionTimeoutMaxCount> |
| 207 | + <lock_step>1</lock_step> |
| 208 | + <have_32_channels>0</have_32_channels> |
| 209 | + |
| 210 | + <!-- Frame conventions |
| 211 | + Require by ArduPilot: change model and gazebo from XYZ to XY-Z coordinates |
| 212 | + --> |
| 213 | + <modelXYZToAirplaneXForwardZDown degrees="true">0 0 0 180 0 0</modelXYZToAirplaneXForwardZDown> |
| 214 | + <gazeboXYZToNED degrees="true">0 0 0 180 0 90</gazeboXYZToNED> |
| 215 | + |
| 216 | + <!-- Sensors --> |
| 217 | + <imuName>iris_with_standoffs::imu_link::imu_sensor</imuName> |
| 218 | + |
| 219 | + <!-- |
| 220 | + incoming control command [0, 1] |
| 221 | + so offset it by 0 to get [0, 1] |
| 222 | + and divide max target by 1. |
| 223 | + offset = 0 |
| 224 | + multiplier = 838 max rpm / 1 = 838 |
| 225 | + --> |
| 226 | + <control channel="0"> |
| 227 | + <jointName>iris_with_standoffs::rotor_0_joint</jointName> |
| 228 | + <useForce>1</useForce> |
| 229 | + <multiplier>838</multiplier> |
| 230 | + <offset>0</offset> |
| 231 | + <servo_min>1000</servo_min> |
| 232 | + <servo_max>2000</servo_max> |
| 233 | + <type>COMMAND</type> |
| 234 | + <cmd_topic>/model/iris_with_ardupilot_1/joint/rotor_0_joint/cmd_vel</cmd_topic> |
| 235 | + </control> |
| 236 | + |
| 237 | + <control channel="1"> |
| 238 | + <jointName>iris_with_standoffs::rotor_1_joint</jointName> |
| 239 | + <useForce>1</useForce> |
| 240 | + <multiplier>838</multiplier> |
| 241 | + <offset>0</offset> |
| 242 | + <servo_min>1000</servo_min> |
| 243 | + <servo_max>2000</servo_max> |
| 244 | + <type>COMMAND</type> |
| 245 | + <cmd_topic>/model/iris_with_ardupilot_1/joint/rotor_1_joint/cmd_vel</cmd_topic> |
| 246 | + </control> |
| 247 | + |
| 248 | + <control channel="2"> |
| 249 | + <jointName>iris_with_standoffs::rotor_2_joint</jointName> |
| 250 | + <useForce>1</useForce> |
| 251 | + <multiplier>-838</multiplier> |
| 252 | + <offset>0</offset> |
| 253 | + <servo_min>1000</servo_min> |
| 254 | + <servo_max>2000</servo_max> |
| 255 | + <type>COMMAND</type> |
| 256 | + <cmd_topic>/model/iris_with_ardupilot_1/joint/rotor_2_joint/cmd_vel</cmd_topic> |
| 257 | + </control> |
| 258 | + |
| 259 | + <control channel="3"> |
| 260 | + <jointName>iris_with_standoffs::rotor_3_joint</jointName> |
| 261 | + <useForce>1</useForce> |
| 262 | + <multiplier>-838</multiplier> |
| 263 | + <offset>0</offset> |
| 264 | + <servo_min>1000</servo_min> |
| 265 | + <servo_max>2000</servo_max> |
| 266 | + <type>COMMAND</type> |
| 267 | + <cmd_topic>/model/iris_with_ardupilot_1/joint/rotor_3_joint/cmd_vel</cmd_topic> |
| 268 | + </control> |
| 269 | + |
| 270 | + </plugin> |
| 271 | + |
| 272 | + </model> |
| 273 | +</sdf> |
0 commit comments