Choose one to follow depending on your OS.
With conda available but NO conda env (e.g., base) activated, run one of the following.
If no ROS-related utilities are used:
./install.sh --name <env_name>
If ROS is needed in running pipelines:
./install.sh --ros --name <env_name>
To remove installed environment:
conda remove --name <env_name> --all
Follow the same steps as the instruction above for Ubuntu 20.04. Use mjpython
instead of python
to run scripts which use Mujoco.
# Clone and install the unitree_sdk2_python package separately
cd ~ # Move to the home directory or any other directory outside SafeG1
git clone https://github.com/unitreerobotics/unitree_sdk2_python.git
cd unitree_sdk2_python
pip install -e .
After installation, try running a implemented pipeline in Pipeline Overview. A quick example is:
python example/run_g1_safe_teleop_sim.py
Task | Policy | Safety | Agent | |
---|---|---|---|---|
Safe G1 teleoperation | Hands-only teleop; obstacles (ROS, debug) | IK + PID | SSA/CBF/etc. | G1 real, G1 mujoco |
Safe G1 benchmark | Dynamic goal tracking with collision avoidance | IK + PID | SSA/CBF/etc. | G1 mujoco |
Environment wrapper aligning with env-algo structure. Composed of the following two modules.
Task class, receiving additional sensory data and generating objectives. Returns global info (e.g., robot base in world frame). Task runs for a maximal number of steps (-1 for continuous tasks).
Ultimate interface to the robot for both sim and real. Each agent implements robot-specific interfaces for receiving observations (e.g., robot states, sensory data) and publishing control (e.g., robot joint positions) for both simulation and real robots. Returns local info (e.g., robot state). Global info can also be returned if available (e.g., global localization by robot).
Algorithm wrapper aligning with env-algo structure. Composed of the following two modules if model-based safe control is used.
Policies fulfilling task-specific objectives.
safe_algo
: core module implementing safe control methods and energy functions.safe_controller
: interface to safe control algorithms.
For end-to-end safe algorithms, set safe_controller
in pipeline configuration to ByPassSafeControl
and implement safe algorithms in spark_policy
. An example of disabling safe_controller
is
python example/run_g1_unsafe_teleop_sim.py
The script is essentially Safe G1 teleoperation without safe control module.
Robot library containing robot config (e.g., state, dofs, urdf).
Top level pipelines for safe robotic tasks. Pipeline runs for a maximal number of steps (-1 for unlimited). When env is done, pipeline can choose to reset the env or exit.