How to setup industrial_ci locally and test Autoware

industrial_ci will build, install and test every package in an isolated manner inside a clean Docker image. In this way, missing dependencies(system and other packages) can be easily spotted and fixed before publishing a package. This eases the deployment of Autoware (or any ROS package).

Running locally instead of on the cloud (travis-ci) speeds up the build time.

Autoware and industrial_ci require two different catkin workspaces.

Requirements:

  • Docker installed and working.
  • Direct connection to the Internet (No proxy). See below for proxy instructions.

Instructions:

  1. Install catkin tools:$ sudo apt-get install python-catkin-tools.
  2. Clone Autoware (if you don’t have it already):$ git clone https://github.com/CPFL/Autoware. (if you wish to test an specific branch change to that branch or use -b).
  3. Create a directory to hold a new workspace at the same level as Autoware, and subdirectory src. (In this example catkin_ws and base dir being home ~).
    ~/$ mkdir -p catkin_ws/src && cd catkin_ws/src.
  4. Initialize that workspace running catkin_init_workspace inside src of catkin_ws.
    ~/catkin_ws/src$ catkin_init_workspace
  5. Clone industrial_ci inside the catkin_ws/src.
    ~/catkin_ws/src$ git clone https://github.com/ros-industrial/industrial_ci.
  6. The directory structure should look as follows:
~
├── Autoware
│   ├── ros
│   │   └── src
│   └── .travis.yml
├── catkin_ws
          └── src
               └── industrial_ci
  1. Go to catkin_ws and build industrial_ci. ~/catkin_ws$ catkin config --install && catkin b industrial_ci && source install/setup.bash.
  2. Once finished, move to Autoware directory ~/catkin_ws$ cd ~/Autoware.
  3. Run industrial_ci:

– Using rosrun industrial_ci run_ci ROS_DISTRO=kinetic ROS_REPO=ros or rosrun industrial_ci run_ci ROS_DISTRO=indigo ROS_REPO=ros. This method will manually specify the distribution and repositories sources.
~/Autoware$ rosrun industrial_ci run_travis .. This will parse the .travis.yml and run in a similar fashion to travis-ci.

For more detailed info: https://github.com/ros-industrial/industrial_ci/blob/master/doc/index.rst#run-industrial-ci-on-local-host

How to run behind a proxy

Configure your docker to use proxy (from https://stackoverflow.com/questions/26550360/docker-ubuntu-behind-proxy and https://docs.docker.com/config/daemon/systemd/#httphttps-proxy):

Ubuntu 14.04

Edit the file /etc/default/docker, go to the proxy section, and change the values:

# If you need Docker to use an HTTP proxy, it can also be specified here.
export http_proxy="http://proxy.address:port"
export https_proxy="https://proxy.address:port"

Execute in a terminal sudo service docker restart.

Ubuntu 16.04

  1. Create config container directory:
    $ sudo mkdir -p /etc/systemd/system/docker.service.d

  2. Create the http-conf.d file inside:
    $ sudo nano /etc/systemd/system/docker.service.d/http-proxy.conf

  3. Paste the following text and edit with your proxy values:

[Service]
Environment="HTTP_PROXY=http://proxy.address:port"
Environment="HTTPS_PROXY=https://proxy.address:port"
  1. Save the file

Modifications to industrial_ci

  1. Add the following lines in ~/catkin_ws/src/industrial_ci/industrial_ci/src/docker.sh at line 217:

Original:

FROM $DOCKER_BASE_IMAGE
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections

Change to:

FROM $DOCKER_BASE_IMAGE
ENV http_proxy "http://proxy.address:port"
ENV https_proxy "https://proxy.address:port"
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
  1. Change line 80 of ~/catkin_ws/src/industrial_ci/industrial_ci/src/tests/source_test.sh

Original:

# Setup rosdep
rosdep --version
if ! [ -d /etc/ros/rosdep/sources.list.d ]; then
    sudo rosdep init
fi

Change to:

# Setup rosdep
rosdep --version
if ! [ -d /etc/ros/rosdep/sources.list.d ]; then
    rosdep init
fi
  1. In ~/catkin_ws/src/industrial_ci/industrial_ci/src/tests/source_test.sh line 56:

Original:

ici_time_start setup_apt

sudo apt-get update -qq

# If more DEBs needed during preparation, define ADDITIONAL_DEBS variable where you list the name of DEB(S, delimitted by whitespace)
if [ "$ADDITIONAL_DEBS" ]; then
    sudo apt-get install -qq -y $ADDITIONAL_DEBS || error "One or more additional deb installation is failed. Exiting."
fi
source /opt/ros/$ROS_DISTRO/setup.bash

ici_time_end  # setup_apt

if [ "$CCACHE_DIR" ]; then
    ici_time_start setup_ccache
    sudo apt-get install -qq -y ccache || error "Could not install ccache. Exiting."
    export PATH="/usr/lib/ccache:$PATH"
    ici_time_end  # setup_ccache
fi

ici_time_start setup_rosdep

Change to:

ici_time_start setup_apt

apt-get update -qq

# If more DEBs needed during preparation, define ADDITIONAL_DEBS variable where you list the name of DEB(S, delimitted by whitespace)
if [ "$ADDITIONAL_DEBS" ]; then
    apt-get install -qq -y $ADDITIONAL_DEBS || error "One or more additional deb installation is failed. Exiting."
fi
source /opt/ros/$ROS_DISTRO/setup.bash

ici_time_end  # setup_apt

if [ "$CCACHE_DIR" ]; then
    ici_time_start setup_ccache
    apt-get install -qq -y ccache || error "Could not install ccache. Exiting."
    export PATH="/usr/lib/ccache:$PATH"
    ici_time_end  # setup_ccache
fi

ici_time_start setup_rosdep
  1. In the same way change line 70 ~/catkin_ws/src/industrial_ci/industrial_ci/src/tests/abi_check.sh:

Original:

    # Setup rosdep
    rosdep --version
    #if ! [ -d /etc/ros/rosdep/sources.list.d ]; then
        sudo rosdep init
    #fi

Change to:

    # Setup rosdep
    rosdep --version
    #if ! [ -d /etc/ros/rosdep/sources.list.d ]; then
        rosdep init
    #fi

Compile again with catkin, then you can run industrial_ci as indicated above.

How to create a map using NDT Mapping

  1. Go to Autoware/ros directory
  2. Run Autoware using “./run” command
  3. Go to Simulation tab and Load a ROSBAG
  4. Click Play and immediately PAUSE
  5. Click Computing tab and select ndt_mapping
  6. Click RViz button at the bottom
  7. In Rviz click File menu and then click Open Config to select visualization template for ndt_mapping.rviz located in Autoware/src/.config/rviz
  8. ndt_mapping will read from /points_raw
    IF the pointcloud is being published in a different topic, use the relay tool in a new terminal window
    rosrun topic_tools relay /front/velodyne_points /points_raw
    This will forward the topic /front/velodyne_points to /points_raw
  9. Go back to Simulation tab and click Pause to start mapping
  10. Mapping process can be seen from Rviz
  11. Once the desired area is mapped. Click [app] button next to ndt_mapping
  12. Select the desired path specified using the Ref button
  13. Press the PCD OUTPUT to generate the file.
  14. Uncheck the ndt_mapping node to stop.

DONE

How to verify Map

  1. Select Map tab in runtime Manager and click on Ref button
  2. Select the recently created file
  3. Click on the PointCloud button and wait until the progress bar reaches Loading… 100%
  4. Open RVIZ, Click the ADD button
  5. Select the By Topic Tab
  6. Double Click on /points_map PointCloud2
  7. The map will be displayed (remember to set the frame to map)

Run Autoware full stack

Nodes required to run the autonomous car

RuntimeManager Tab Path Following (PF) Nodes + Traffic Signal
Setup TF
Map PointCloud,VectorMap,TF VectorMap, TF
Sensing LiDAR, VoxelGrid filter Camera, Calibration Publisher
Computing Euclidean Cluster or Ground Filtering (Ray or Ring)
Computing/Localization NDT Matching, vel_pose_connect
Computing/Mission Planning lane_rule, lane_stop, lane_select, astar_navi
Computing/Motion Planning obstacle_avoid, velocity_set, way_point_loader, pure_pursuit, twist_filter
Computing/Detection feat_proj, region_tlr
Interface,(if ZMP) vehicle_gateway
Interface,(if AStuff) pac_mod

* (if lane change is required)