Skip to content

Unitree camera

Anthony Jiang edited this page Jan 17, 2024 · 9 revisions

Overview

The Go1 has five cameras, including one head camera, two side cameras (left and right) and two bottom cameras (front and rear). These are all stereo cameras from Sunplusit, as shown under Bus 001 Device 003:

$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 1bcf:2cd1 Sunplus Innovation Technology Inc. 
Bus 001 Device 008: ID 19d2:1405 ZTE WCDMA Technologies MSM 
Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

UnitreeCameraSdk

UnitreeCameraSdk can be found in the ~/Unitree/sdk folder in each of the Nano PCs.

The SDK provides a pre-compiled library as well as several c/c++ examples. Users can use these examples as the base to develop custom software, including ROS integration.

ROS integration

The ros package for these cameras can be found in the Unitree folder in each of the Nano PCs:

$ ls ~/Unitree/autostart/camerarosnode/cameraRosNode
build  devel  kill.sh  patch  src  startNode.sh

However, the package only provides the code for pointcloud. To make use of the RGB feed, users are left alone to find their own solutions.

pointcloud

To launch the pointcloud node, we suggest you to run the startNode.sh script. It will load the correct parameters and calibrations.

cd ~/Unitree/autostart/camerarosnode/cameraRosNode
./startNode.sh

RGB image

The image feed of the camera is in MJPG format:

$ v4l2-ctl -d /dev/video0 --list-formats
ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'MJPG' (compressed)
	Name        : Motion-JPEG

It is well supported by the mjpeg_cam package with one caveat that the cameras need to be unlocked using the SDK.

To install:

cd unitree_ws/src
git clone https://github.com/rsmohamad/mjpeg_cam.git
cd ..
catkin_make

To unlock the camera, you can run example_getRawFrame once and kill it:

cd ${HOME}/Unitree/sdk/UnitreeCameraSdk/bins
./example_getRawFrame 1
# take a short break until the software loads up or `sleep 10`
pid=`ps ux | grep ./example_getRawFrame | grep bash | grep -v grep | head -1 " awk '{print $2}'`
kill ${pid}

Then you may launch the ros package:

source devel/setup.bash
roslaunch mjpeg_cam mjpeg_cam_run.launch

Dependencies

You may need to install v4l-utils to allow changing camera configurations.

With internet connection:

sudo apt install v4l-utils

Without internet connection:

  1. Download the package from a PC with internet connection from https://launchpad.net/ubuntu/bionic/+package/v4l-utils. Look for one for arm64 (Release).
  2. SCP the package into the Nano PC, e.g.:
scp ~/Downloads/v4l-utils_1.14.2-1_arm64.deb [email protected]:.
  1. From the Nano PC or SSH terminal:
sudo dpkg -i ~/v4l-utils_1.14.2-1_arm64.deb

Disable autostart

You may need first to disable some autostart scripts. We suggest you follow Disable individual items.

The necessary items you need to disable are:

  • camerarosnode
  • imageai