This submodule repository contains the low-level control code for the Berkeley Humanoid Lite robot.
sudo apt install net-tools can-utils
pip install -r requirements.txt
The low-level computer connects to the joints via CAN.
Run this script to initialize the CAN interface:
sudo ./scripts/start_can_transports.sh
A Python script is provided to verify the CAN connection to all the joints of the robot:
python3 ./berkeley_humanoid_lite_lowlevel/robot/check_connection.py
The low-level computer also receives commands from the joystick.
To broadcast the joystick commands to other running nodes, run the following command:
python ./berkeley_humanoid_lite_lowlevel/policy/udp_joystick.py
Because the joint actuators only have single encoder on the motor shaft, we need to calibrate the zero position of the joints after each power cycle.
Run the following command to start the calibration:
python3 ./berkeley_humanoid_lite_lowlevel/robot/calibrate_joints.py
After the script is launched and running, manually move the robot joints to the mechanical position limits. After all the joints are moved, press q
or the B
button on the joystick to quit the calibration.
The calibration data will be saved in the ./calibration.yaml
file.
The main controller is implemented in C.
To run the controller, run the following command:
make run
Press LB
+ A
to enter RL init mode. Then, press RB
+ A
to enter RL running mode.
At any time, press B
or the thumb buttons to exit RL mode. The joints will enter passive damping mode.
Press Ctrl
+ C
to terminate the controller. Upon first termination, the joints will enter passive damping mode. Press Ctrl
+ C
again to completely stop the controller, which joints will return to unpowered idle state.