In the previous article in our RACECAR/J Build Series, we finished the initial assembly of the base robot. Now it is time for the Software Install.
FOCBOX replaced by VESC6 Plus
Important Note: Currently the RACECAR/J Kits are shipping with the VESC 6 Plus.
There are two installation scripts in the Github repository. In the video, we use installMITRACECAR.sh which installs the VESC driver software for version 4.12 hardware (FOCBOX, earlier versions of VESC). The script installMITRACECARVESC6.sh installs the VESC driver software for version 6.X hardware such as the VESC 6 Plus.
The format of some of the data structures have changed for the 6.X hardware, make sure that you match the installer to the version of VESC that you are using.
In the video, we install the software for the “MIT Hardware Configuration – Version 2.5” of RACECAR/J. This includes support for the following:
- VESC 4.12 hardware compatible electronic speed controller
- Sparkfun SEN-14001 IMU
- Stereolabs ZED Camera
- Hokuyo UST-10LX Scanning Laser Range Finder
The VESC and SEN-14001 are part of the RACECAR/J Base hardware configuration, the ZED and UST-10LX are additional.
The base RACECAR/J uses some new code for the Sparkfun IMU. Note that this is transition code in the RACECAR/J racecar Repository (the RacecarJTransitory branch). A different code base for the IMU is now under submission to the OSRF to become an official package. As such, we’ll publish updates as new code becomes available.
The software install is for the Jetson on the RACECAR/J. In the video a Jetson TX2 is used, connected to a monitor, keyboard, mouse and ethernet connection. The only difference in the code bases is the version of the ZED Camera driver. The version for the Jetson TX2 is in the folder ‘JetsonTX2’ and the version for the Jetson TX1 is in the folder ‘JetsonTX1’.
Note that version 2.2.1 of the ZED Camera driver installs to match the CUDA 8.0 package.
The current software stack runs on the Jetson TX1 and Jetson TX2 running L4T 28.1. Use JetPack 3.1 to install L4T 28.1, and at a minimum:
- CUDA 8.0
- cuDNN 6.0
- OpenCV4Tegra 2.4.13
Note that the next version of L4T will release in the next few weeks from this writing, at which time we’ll start to update the code.
The installRACECARJ repository on the RACECARJ Github account contains the scripts necessary to install the software stack. First, clone the repository and switch to the repository directory:
$ git clone https://github.com/RacecarJ/installRACECARJ.git
$ cd installRACECARJ
Next, install the appropriate ZED camera driver for the Jetson in use. If possible, plug the ZED camera into the RACECAR/J USB hub (in one of the FAST ports, they are full speed USB 3.0). If the ZED is present during installation, the ZED driver installer will download the cameras’ calibration file. To install the Jetson TX2 driver for example:
$ cd JetsonTX2
Then, return to the installRACECARJ directory:
$ cd ..
We’re now ready to install the Robot Operating System (ROS) software and the rest of the RACECAR/J software stack. The installation script does the following:
- L4T 28.1 does not have a cdc-acm driver. The script installs a pre-built cdc-acm driver. The driver expects a stock kernel (4.4.38-tegra)
- Because the electronic speed controller and the IMU both report as ttyACM, a udev rule is installed which names them as vesc and imu respectively.
- ROS is configured and rosbase is installed
- One of the dependencies is missing in the package specifications, so ros-kinetic-opencv3 is installed.
- The MIT RACECAR packages are installed, which includes the ZED v2.2.x ROS wrapper.
To start the installation (use installMITRACECAR.sh for earlier 4.X version VESC hardware):
The directory ‘~/racecar-ws’ is the default workspace directory name; it can be specified on the command line after the script name. Because there is such a large amount of messages during installation, you may want to log everything to a log file:
$ ./installMITRACECARVESC6.sh |& tee softinstall.log
The log will be placed in the file ‘softinstall.log’ for review. This is useful in case there are installation issues.
ROS Environment Variables
Worth noting is that the scripts also set up two environment variables in the .bashrc, namely ROS_MASTER_URI and ROS_IP. These are placeholders, you should replace them with values appropriate to your network layout. Also, while the normal ROS setup.bash is sourced, you may want to source the devel/setup.bash of your workspace.
After installation, you should be able to run the teleoperation launch file if the VESC is programmed. If you buy the RACECAR/J kit, the VESC should already be programmed. You are ready to tele-operate the robot: RACECAR/J – ROS Teleoperation
If you buy the VESC separately, program the VESC next: RACECAR/J – Programming the Electronic Speed Controller
The installation of the entire ROS software stack for RACECAR/J can be a complicated affair. However, these installation scripts should make things fairly simple.