# [MOOC] Autoware Course - Lecture 1 - Setup the environment

**Published:** February 9, 2021
**Tags:** Computer Vision, Apollo


---

This is my note for lesson 1 of MOOC course: Self-Driving Cars with ROS and Autoware. You should follow the instructions in the course. I only write some notes here to highlight the best practices and how to fix some errors.

- Autoware course: https://www.apex.ai/autoware-course
- Lecture 1 tutorial: [https://gitlab.com/ApexAI/autowareclass2020/-/blob/master/lectures/01_DevelopmentEnvironment/devenv.md](https://gitlab.com/ApexAI/autowareclass2020/-/blob/master/lectures/01_DevelopmentEnvironment/devenv.md).

## Docker

- This course uses [ADE Development Environment] to deploy examples. This will ensure that all students in the course have a common, consistent development environment.

- I added a command to checkout a right version of source code first. This will help avoid unnecessary errors.

```
git checkout avp-demo
```

```shell {linenos=table,hl_lines=[14],linenostart=199}
$ cd ${HOME}
$ mkdir adehome
$ cd adehome
$ wget https://gitlab.com/ApexAI/ade-cli/uploads/85a5af81339fe55555ee412f9a3a734b/ade+x86_64
$ mv ade+x86_64 ade
$ chmod +x ade
$ mv ade ~/.local/bin
$ which ade
# Update ade
$ ade update-cli
# Now setup ade
$ touch .adehome
$ git clone --recurse-submodules https://gitlab.com/autowarefoundation/autoware.auto/AutowareAuto.git
$ git checkout avp-demo
$ cd AutowareAuto/
$ ade start
# this will take awhile
$ ade enter
```

## Install ROS 2

`master` branch don't use ROS Dashing any more, you will need to switch to Foxy here if you run the source code from `master` branch. Only use these command if you don't switch to `avp-demo` with `git checkout avp-demo` below.

```
ade$ sudo apt update
ade$ sudo apt install ros-foxy-turtlesim
ade$ sudo apt install ros-foxy-rqt-*
ade$ sudo apt install byobu
```

## Install Terminator

Terminator is a terminal emulator

```
sudo apt install terminator
```

- **Fix:** `dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: /usr/bin/dbus-launch terminated abnormally without any error message` with following command:

```
sudo apt-get install dbus-x11
```

## Install Autoware.Auto

We need to install Autoware.Auto from scratch:

- [https://autowarefoundation.gitlab.io/autoware.auto/AutowareAuto/building.html](https://autowarefoundation.gitlab.io/autoware.auto/AutowareAuto/building.html).
- [https://autowarefoundation.gitlab.io/autoware.auto/AutowareAuto/installation-no-ade.html](https://autowarefoundation.gitlab.io/autoware.auto/AutowareAuto/installation-no-ade.html).

### Error

```
/home/vietanhdev/AutowareAuto/src/control/motion_testing/include/motion_testing/motion_testing.hpp:18:10: fatal error: autoware_auto_msgs/msg/trajectory.hpp: No such file or directory
   18 | #include <autoware_auto_msgs/msg/trajectory.hpp>
```

## Run object detection demo

There are some errors in the commands.

### Error

```
ros2 run velodyne_node velodyne_cloud_node_exe __ns:=/lidar_front __params:=/home/${USER}/autowareclass2020/code/src/01_DevelopmentEnvironment/velodyne_node.param.yaml
Package 'velodyne_node' not found
```

-> Use following command

```
ros2 run velodyne_nodes velodyne_cloud_node_exe --ros-args --remap "__ns:=/lidar_front" --params-file /home/${USER}/autowareclass2020/code/src/01_DevelopmentEnvironment/velodyne_node.param.yaml
```

ROS Foxy uses [a new way to pass parameters](https://index.ros.org/doc/ros2/Tutorials/Node-arguments/). We need to fix it also:

