Skip to content

Commit fda7804

Browse files
committed
Add box collision type
1 parent 3eef2b2 commit fda7804

4 files changed

Lines changed: 31 additions & 14 deletions

File tree

drone_models/data/cf21B_500.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@
4343
<geom mesh="connector-pins" material="gold" class="visual" />
4444
<geom mesh="battery" material="light-gray" class="visual" />
4545
<geom mesh="battery-holder" material="black" class="visual" />
46+
4647
<!-- Collision geometry is estimated based on the visual mesh. We use a sphere for maximum
47-
computational efficiency with larger swarms. -->
48-
<geom type="sphere" size="0.082" class="collision" name="col" />
48+
computational efficiency with larger swarms. Used by default-->
49+
<geom name="col_sphere" type="sphere" size="0.086" pos="0 0 0.02" class="collision" contype="1" conaffinity="1" />
50+
<!-- For higher accuracy with lower performance, you can use a box. By default off. -->
51+
<geom name="col_box" type="box" size="0.07 0.07 0.02" class="collision" rgba="0.5 0.5 0.5 0" contype="0" conaffinity="0" />
52+
4953
<site name="CoM" />
5054
<site name="motor0" pos="0.03536 -0.03536 0.0" />
5155
<site name="motor1" pos="-0.03536 -0.03536 0.0" />

drone_models/data/cf2x_L250.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@
4343
<geom mesh="connector-pins" material="gold" class="visual" />
4444
<geom mesh="battery" material="light-gray" class="visual" />
4545
<geom mesh="battery-holder" material="black" class="visual" />
46+
4647
<!-- Collision geometry is estimated based on the visual mesh. We use a sphere for maximum
47-
computational efficiency with larger swarms. -->
48-
<geom type="sphere" size="0.055" class="collision" name="col" />
48+
computational efficiency with larger swarms. Used by default-->
49+
<geom name="col_sphere" type="sphere" size="0.07" pos="0 0 0.005" class="collision" contype="1" conaffinity="1" />
50+
<!-- For higher accuracy with lower performance, you can use a box. By default off. -->
51+
<geom name="col_box" type="box" size="0.055 0.055 0.02" class="collision" rgba="0.5 0.5 0.5 0" contype="0" conaffinity="0" />
52+
4953
<site name="CoM" />
5054
<site name="motor0" pos="0.0325 -0.0325 0.0" />
5155
<site name="motor1" pos="-0.0325 -0.0325 0.0" />

drone_models/data/cf2x_P250.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@
4343
<geom mesh="connector-pins" material="gold" class="visual" />
4444
<geom mesh="battery" material="light-gray" class="visual" />
4545
<geom mesh="battery-holder" material="black" class="visual" />
46+
4647
<!-- Collision geometry is estimated based on the visual mesh. We use a sphere for maximum
47-
computational efficiency with larger swarms. -->
48-
<geom type="sphere" size="0.055" class="collision" name="col" />
48+
computational efficiency with larger swarms. Used by default-->
49+
<geom name="col_sphere" type="sphere" size="0.07" pos="0 0 0.005" class="collision" contype="1" conaffinity="1" />
50+
<!-- For higher accuracy with lower performance, you can use a box. By default off. -->
51+
<geom name="col_box" type="box" size="0.055 0.055 0.02" class="collision" rgba="0.5 0.5 0.5 0" contype="0" conaffinity="0" />
52+
4953
<site name="CoM" />
5054
<site name="motor0" pos="0.0325 -0.0325 0.0" />
5155
<site name="motor1" pos="-0.0325 -0.0325 0.0" />

drone_models/data/cf2x_T350.xml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
<mesh name="pcb" file="cf2x/cf2x_pcb.stl" scale="0.001 0.001 0.001"/>
1313
<mesh name="motors" file="cf2x/cf2xT_motors.stl" scale="0.001 0.001 0.001"/>
1414
<mesh name="motor-holder" file="cf2x/cf2x_motor-holder.stl" scale="0.001 0.001 0.001"/>
15-
<mesh name="propL" file="cf2x/cf2xT_PropL.stl" scale="0.001 0.001 0.001"/>
16-
<mesh name="propR" file="cf2x/cf2xT_PropR.stl" scale="0.001 0.001 0.001"/>
15+
<!-- Using the wrong propellers for now. Correct ones not available -->
16+
<mesh name="propL" file="cf21B/cf21B_PropL.stl" scale="0.001 0.001 0.001"/>
17+
<mesh name="propR" file="cf21B/cf21B_PropR.stl" scale="0.001 0.001 0.001"/>
1718
<mesh name="connectors" file="cf2x/cf2x_connectors.stl" scale="0.001 0.001 0.001"/>
1819
<mesh name="connector-pins" file="cf2x/cf2x_connector-pins.stl" scale="0.001 0.001 0.001"/>
1920
<mesh name="battery" file="cf2x/cf2x_battery.stl" scale="0.001 0.001 0.001"/>
@@ -43,26 +44,30 @@
4344
<geom mesh="connector-pins" material="gold" class="visual" />
4445
<geom mesh="battery" material="light-gray" class="visual" />
4546
<geom mesh="battery-holder" material="black" class="visual" />
47+
4648
<!-- Collision geometry is estimated based on the visual mesh. We use a sphere for maximum
47-
computational efficiency with larger swarms. -->
48-
<geom type="sphere" size="0.055" class="collision" name="col" />
49+
computational efficiency with larger swarms. Used by default-->
50+
<geom name="col_sphere" type="sphere" size="0.0725" pos="0 0 0.01" class="collision" contype="1" conaffinity="1" />
51+
<!-- For higher accuracy with lower performance, you can use a box. By default off. -->
52+
<geom name="col_box" type="box" size="0.0575 0.0575 0.02" class="collision" rgba="0.5 0.5 0.5 0" contype="0" conaffinity="0" />
53+
4954
<site name="CoM" />
5055
<site name="motor0" pos="0.0325 -0.0325 0.0" />
5156
<site name="motor1" pos="-0.0325 -0.0325 0.0" />
5257
<site name="motor2" pos="-0.0325 0.0325 0.0" />
5358
<site name="motor3" pos="0.0325 0.0325 0.0" />
5459

5560
<!-- Propellers -->
56-
<body name="prop0" pos="0.0325 -0.0325 0.012" euler="0 0 45">
61+
<body name="prop0" pos="0.0325 -0.0325 0.015" euler="0 0 45">
5762
<geom mesh="propL" material="black" class="visual"/>
5863
</body>
59-
<body name="prop1" pos="-0.0325 -0.0325 0.012" euler="0 0 135">
64+
<body name="prop1" pos="-0.0325 -0.0325 0.015" euler="0 0 135">
6065
<geom mesh="propR" material="black" class="visual"/>
6166
</body>
62-
<body name="prop2" pos="-0.0325 0.0325 0.012" euler="0 0 225">
67+
<body name="prop2" pos="-0.0325 0.0325 0.015" euler="0 0 225">
6368
<geom mesh="propL" material="black" class="visual"/>
6469
</body>
65-
<body name="prop3" pos="0.0325 0.0325 0.012" euler="0 0 315">
70+
<body name="prop3" pos="0.0325 0.0325 0.015" euler="0 0 315">
6671
<geom mesh="propR" material="black" class="visual"/>
6772
</body>
6873
</body>

0 commit comments

Comments
 (0)