The On-board Computer
We are almost done!
The last step before running policy on the real robot is to set up the environment on the on-board NUC computer.
Install Ubuntu 22.04
We find that Ubuntu 22.04 works well with our software and hardware stack on the robot. Follow Ubuntu tutorial to install Ubuntu 22.04 on the NUC computer.
Install Dependencies
sudo apt install build-essential cmake net-tools can-utils python3-pip
Test connection with joint actuators
As the first step, we need to initialize the CAN transport on the Linux side. To do this, we have prepared a script:
source ./scripts/start_can_transports.sh
To test connection to individual actuator, run this command.
python ./berkeley_humanoid_lite_lowlevel/motor/ping.py --port can0 --id 1
--port
corresponds to the port of the CAN device on linux. With the two arms and legs all connected, it should be can[0,1,2,3]
--id
corresponds to the CAN ID of the device. It should be in range [1..14]
.
Alternatively, to test connection to all the motors, run this script.
python ./berkeley_humanoid_lite_lowlevel/robot/anyonehere.py
Test connection with IMU
To test connection to the IMU, run this command.
python ./berkeley_humanoid_lite_lowlevel/robot/test_imu.py
Test connection with Joystick
Run this script to launch the Python program that reads the joystick and broadcast the reading on UDP port.
python ./berkeley_humanoid_lite_lowlevel/policy/udp_joystick.py
Run everything together
There are two ways to run the lowlevel code: C codebase and Python codebase.
C codebase
For locomotion tasks, we recommend to use the C codebase for better realtime gaurantee. The C codebase is under ./csrc/
directory.
On the on-board computer, do the following:
make
./build/real_humanoid
Real-time kernel performance
If running into performance issues where the USB-CAN adapter cannot maintain the required communication frequency, we can use the https://xanmod.org/ real-time kernel instead.
Python codebase
[Coming soon]
Last updated