Skip to content

Unitree camera

Anthony Jiang edited this page Nov 2, 2023 · 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

Also MJPG isn't a rear format, but these cameras do not seem to work with the mainstream ros packages such as usb_cam or video_stream_opencv. With limited success, we found mjpeg_cam can work with some of these cameras, including the right side camera and rear bottom camera, which are /dev/video0 @ 192.168.123.14 and /dev/video0 @ 192.168.123.15.

To install:

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

To use:

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 unitree@192.168.123.15:.
  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
  • 03persontrack
  • imageai

Clone this wiki locally