B1Py is a collection of tools and tutorials for getting started with the Unitree B1 robot. It aims to bring simplicity by providing a modular and as much as possible Pythonic toolchain for this robot. It features:
- High-level interface abstraction with safety features to communicate with the onboard controller.
- Low-level joint interface abstraction with safety features to control the robot's actuators.
- A set of docker files to automate the launch of all the sensors and interfaces of the robot on startup.
- A set of tutorials for calibrating the sensors and running basic computational components such as VIO, elevation mapping, etc...
We provide a simple simulation environment based on the Isaac Sim. This simulation environment follows the exact interfacing API (low-level joint control) as the one used for communicating with the real robot, and is designed to simulate the experience of using the real-robot as closely as possible.
To use the simulator, first install the Isaac Sim as described here and create a link to the builtin Python interpreter provided by the simulator:
cd B1Py
ln -s ${ISAACSIM_PATH} _isaac_sim
where ISAACSIM_PATH
points to the installation path of the simulator. Then install the B1Py for the Python interpreter provided by Isaac Sim:
./b1py.sh -i
After installation, run the simulation node simply by running the b1py.sh
with the --sim
option:
./fr3py.sh --sim
Then communicate with the robot through three simple API calls:
from B1Py.sim.interface import B1IsaacSim
robot = B1IsaacSim(robot_id='b1')
images = robot.readCameras()
state = robot.getStates()
robot.sendCommands(kp, kd, q_des, dq_des, tau_ff)
Note that to call the above commands, B1Py must have been installed for the Python interpreter of interest. This interpreter does not essentially required to be the same as the builtin version provided by Isaac Sim.
Note: The simulation scene and configuration can be changed through the modification of the B1Py/sim/isaac/sim_config.yaml
file. Note that after modification, the package must be installed again through ./b1py.sh -i
.
Example Demo: An example of controlling the robot through an RL controller (walk these ways) is provided here.
Follow through the following steps to setup and calibrate the robot.
Now that the robot is operational, we can use installed nodes and Python classes to communicate with the robot and use it in research.
Following is a list of tutorials to get your hands dirty:
- Joystick Control
- Vicon-Based Position Control
- VIO-Based Position Control
- Walk These Ways RL Controller
- Nonlinear-MPC Whole Body Control