Skip to content

Commit d6b0f6d

Browse files
committed
quadrotor task
1 parent 9032ec2 commit d6b0f6d

File tree

4 files changed

+40
-61
lines changed

4 files changed

+40
-61
lines changed

mjpc/tasks/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,15 @@ add_custom_target(
3535
COMMAND ${CMAKE_COMMAND} -E copy_directory
3636
${menagerie_SOURCE_DIR}/robotiq_2f85
3737
${CMAKE_CURRENT_BINARY_DIR}/manipulation
38+
COMMAND ${CMAKE_COMMAND} -E copy
39+
${menagerie_SOURCE_DIR}/skydio_x2/x2.xml
40+
${CMAKE_CURRENT_BINARY_DIR}/quadrotor/quadrotor.xml
3841
COMMAND ${CMAKE_COMMAND} -E copy_directory
3942
${menagerie_SOURCE_DIR}/skydio_x2/assets
4043
${CMAKE_CURRENT_BINARY_DIR}/quadrotor/assets
44+
COMMAND patch -o ${CMAKE_CURRENT_BINARY_DIR}/quadrotor/quadrotor_modified.xml
45+
${CMAKE_CURRENT_BINARY_DIR}/quadrotor/quadrotor.xml
46+
<${CMAKE_CURRENT_SOURCE_DIR}/quadrotor/quadrotor.xml.patch
4147
COMMAND ${CMAKE_COMMAND} -E copy
4248
${menagerie_SOURCE_DIR}/robotis_op3/op3.xml
4349
${CMAKE_CURRENT_BINARY_DIR}/op3/op3.xml

mjpc/tasks/quadrotor/quadrotor.xml

Lines changed: 0 additions & 60 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
--- quadrotor.xml 2024-01-20 13:48:24
2+
+++ modified.xml 2024-01-20 13:48:07
3+
@@ -25,13 +25,12 @@
4+
<texture type="2d" file="X2_lowpoly_texture_SpinningProps_1024.png"/>
5+
<material name="phong3SG" texture="X2_lowpoly_texture_SpinningProps_1024"/>
6+
<material name="invisible" rgba="0 0 0 0"/>
7+
-
8+
<mesh class="x2" file="X2_lowpoly.obj"/>
9+
</asset>
10+
11+
<worldbody>
12+
<light name="spotlight" mode="targetbodycom" target="x2" pos="0 -1 2"/>
13+
- <body name="x2" pos="0 0 0.1" childclass="x2">
14+
+ <body name="x2" pos="0 0 0.1" quat="0 0 0 1" childclass="x2">
15+
<freejoint/>
16+
<camera name="track" pos="-1 0 .5" xyaxes="0 -1 0 1 0 2" mode="trackcom"/>
17+
<site name="imu" pos="0 0 .02"/>
18+
@@ -58,14 +57,4 @@
19+
<motor class="x2" name="thrust3" site="thrust3" gear="0 0 1 0 0 .0201"/>
20+
<motor class="x2" name="thrust4" site="thrust4" gear="0 0 1 0 0 -.0201"/>
21+
</actuator>
22+
-
23+
- <sensor>
24+
- <gyro name="body_gyro" site="imu"/>
25+
- <accelerometer name="body_linacc" site="imu"/>
26+
- <framequat name="body_quat" objtype="site" objname="imu"/>
27+
- </sensor>
28+
-
29+
- <keyframe>
30+
- <key name="hover" qpos="0 0 .3 1 0 0 0" ctrl="3.2495625 3.2495625 3.2495625 3.2495625"/>
31+
- </keyframe>
32+
</mujoco>

mjpc/tasks/quadrotor/task.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<mujoco model="Quadrotor Racing">
22
<include file="../common.xml"/>
3-
<include file="quadrotor.xml"/>
3+
<!-- modified from: https://github.com/google-deepmind/mujoco_menagerie/tree/main/skydio_x2 -->
4+
<include file="quadrotor_modified.xml"/>
45
<include file="gates.xml"/>
56

67
<size memory="100K"/>

0 commit comments

Comments
 (0)