-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjusting the range of the 6dof in the mjcf file.
First test with mujoco simulator to validate ranges. To confirm with the builder of the robot.
- Loading branch information
Showing
6 changed files
with
112 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import time | ||
|
||
import mujoco | ||
import mujoco.viewer | ||
|
||
|
||
def do_interactive_sim_5dof(): | ||
m = mujoco.MjModel.from_xml_path("gym_lowcostrobot/assets/scene_one_cube.xml") | ||
data = mujoco.MjData(m) | ||
|
||
with mujoco.viewer.launch_passive(m, data) as viewer: | ||
# Run the simulation | ||
while viewer.is_running(): | ||
step_start = time.time() | ||
|
||
# Step the simulation forward | ||
mujoco.mj_step(m, data) | ||
viewer.sync() | ||
|
||
# Rudimentary time keeping, will drift relative to wall clock. | ||
time_until_next_step = m.opt.timestep - (time.time() - step_start) | ||
if time_until_next_step > 0: | ||
time.sleep(time_until_next_step) | ||
|
||
def do_interactive_sim_6dof(): | ||
m = mujoco.MjModel.from_xml_path("gym_lowcostrobot/assets/scene_so_arm_6dof_one_cube.xml") | ||
data = mujoco.MjData(m) | ||
|
||
with mujoco.viewer.launch_passive(m, data) as viewer: | ||
# Run the simulation | ||
while viewer.is_running(): | ||
step_start = time.time() | ||
|
||
# Step the simulation forward | ||
mujoco.mj_step(m, data) | ||
viewer.sync() | ||
|
||
# Rudimentary time keeping, will drift relative to wall clock. | ||
time_until_next_step = m.opt.timestep - (time.time() - step_start) | ||
if time_until_next_step > 0: | ||
time.sleep(time_until_next_step) | ||
|
||
|
||
if __name__ == "__main__": | ||
do_interactive_sim_6dof() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters