Download scripts/debug_panda.py from codewithyug/certified-safe-neural-control: direct link, hf CLI and curl.
- Browser
- Download file 517 Bytes
-
https://huggingface.co/codewithyug/certified-safe-neural-control/resolve/main/scripts/debug_panda.py
- Command line
-
hf download hf://codewithyug/certified-safe-neural-control/scripts/debug_panda.py
-
curl -L -o debug_panda.py https://huggingface.co/codewithyug/certified-safe-neural-control/resolve/main/scripts/debug_panda.py
517 Bytes
| import gymnasium as gym | |
| import mani_skill.envs | |
| import numpy as np | |
| env = gym.make("PickCube-v1", robot_uids="panda", obs_mode="state", control_mode="pd_joint_pos", sim_backend="cpu", render_backend="cpu") | |
| obs, _ = env.reset(seed=42) | |
| robot = env.unwrapped.agent.robot | |
| q = robot.get_qpos()[0].numpy() | |
| ql = robot.get_qlimits()[0].numpy() | |
| print("Panda Initial qpos:", q) | |
| print("Panda qmin:", ql[:, 0]) | |
| print("Panda qmax:", ql[:, 1]) | |
| print("Margin to min:", q - ql[:, 0]) | |
| print("Margin to max:", ql[:, 1] - q) | |
| env.close() | |