Skip to content

Commit

Permalink
Added meshes and xml for sim example.
Browse files Browse the repository at this point in the history
  • Loading branch information
senthurayyappan committed Jan 3, 2025
1 parent c1636a8 commit b32737d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,7 @@ tests/**/*.json
examples/**/*.xml

playground

# dont ignore the stl and xml files within the simulation folder
!examples/simulation/**/ball.stl
!examples/simulation/**/ball.xml
6 changes: 6 additions & 0 deletions examples/simulation/ball.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<body name="ball" pos="0 0 0.132" quat="1 0 0 0">
<freejoint name="ball" />
<inertial pos="0 0 -0.0075" quat="0.5 0.5 -0.5 0.5" mass="0.524" diaginertia="0.073541512 0.07356916 0.073543931" />
<geom name="Part-1-1-collision" type="mesh" rgba="1 0.55 0 1" mesh="Part-1-1" condim="3" contype="1" conaffinity="1" density="0" group="0" friction="0.1 0.05 0.001"/>
<geom type="mesh" rgba="1 0.55 0 1" mesh="Part-1-1" conaffinity="0" condim="1" contype="0" density="0" group="1"/>
</body>
Binary file added examples/simulation/meshes/ball.stl
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/simulation/mods.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def modify_ballbot(ballbot: Robot) -> Robot:
sensor=Gyro(name="gyro-1", site="imu", noise=0.001, cutoff=34.9),
)

ballbot_mesh = ET.Element("mesh", attrib={"file": "meshes/Part-1-1.stl"})
ballbot_mesh = ET.Element("mesh", attrib={"name": "Part-1-1", "file": "meshes/ball.stl"})
ballbot.add_custom_element_by_tag(name="ballbot", parent_tag="asset", element=ballbot_mesh)
ball = load_element("ball.xml")
ballbot.add_custom_element_by_tag(name="ball", parent_tag="worldbody", element=ball)
Expand Down

0 comments on commit b32737d

Please sign in to comment.