Autoware V2X
Our lab is co-leading the AutowareV2X project, and has successfully set up smart intersection devices to enhance real-world testing environments. We've incorporated scenarios involving walking pedestrians to simulate realistic urban traffic conditions. Autoware V2X project aims to innovate vehicular communication systems, focusing on improving safety and efficiency at urban intersections through vehicle-to-everything (V2X) communications.
OpenAD Kit
We are also actively involved in the OpenAD Kit project, focusing on containerizing algorithms to facilitate rapid and timely updates. The OpenAD Kit project aims to democratize autonomous driving (AD) systems by enhancing integration between cloud and edge computing, thus bringing the best practices of Software Defined Vehicle (SDV) development into real world. This approach significantly lowers the threshold for developing and deploying the related software stack, making it more accessible for broader adoption and innovation in the field of autonomous driving technology.
AutowareUniverse-CARLA Bridge
The AutowareUniverse-CARLA Bridge connects the AutowareUniverse autonomous driving system with the CARLA simulator. It enables real-time data exchange between simulation and perception/planning modules. This bridge allows testing and development of autonomous driving features in a virtual environment. It serves as a foundation for integrating simulation-based workflows with real-world autonomous software stacks.
Let's start with installing brew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
And then let's install docker through brew:
brew install cmake coreutils wget git
brew install --cask docker
brew install –-cask xquartz
I would suggest to use conda to create a virtual environment first.
conda create -n tutorial python==3.10 (mac can't directly install python version as early as 3.7)
Start the docker daemon, and try this command to see if it works:
docker run hello-world
Now let's do a little bit work for forwarding visulization from inside the docker:
xhost +local:root
However, comparing with Ubuntu system, MacOS doesn't support to use CARLA docker unless built from source, but Mac doesn't have a GPU to accelerate relevant units. So we need to jump through the CARLA section.
Before we start to do the compiling work, open docker engine, and go to:
Settings - Resources - Advanced - Memory Limit, set to 16gb, otherwise the compilation will fail due to fatal error: cc1plus.
And please change the screen resolution as high as possible for better visualization.
Download the UDAutoware, autoware_map, cri node ( You may download AutowareUniverse-Carla and use Ubuntu section's commands, but it will not be used for MacOS showcase) , unzip them (if the downloaded files aren't folders) using:
unzip ~/Downloads/UDAutoware.zip -d ~/Desktop/UDAutoware
unzip ~/Downloads/autoware_map.zip -d ~/Desktop/autoware_map
unzip ~/Downloads/cri_node.zip -d ~/Desktop/cri_node
and use this command:
docker pull bytian/autoware_mac_aarch64:v1
And before launching the docker, please goto:
docker desktop 👉 Settings 👉 Resources 👉 Advanced 👉 Memory limit
and change it to 16 GB.
And it would be much easier for you to run the demo if you go to your laptop's:
System settings 👉 Displays 👉 Set the resolution as high as possible
Launch the docker with the following command (make sure to mount the UDAutoware, autoware_map from the right folders):
docker run -it --rm \
-p 6080:80 \
--security-opt seccomp=unconfined \
--shm-size=512m \
-v ~/Desktop/UDAutoware:/home/carla/UDAutoware \
-v ~/Desktop/autoware_map:/home/carla/autoware_map \
-v ~/Desktop/cri_node:/home/carla/cri_node \
bytian/autoware_mac_aarch64:v1
Open Safari and goto:
localhost:6080
Then press the "connect" button. From now on, all the commands will be used in this window.
cd to the UDAutoware folder and start the compiling process with:
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release --parallel-workers 4
( in case of short of memory)
Then after finish building autoware, you can also try to build cri_node, by:
cd ../cri_node && colcon build
Don't forget to do the sourcing each time we attach to or launch the docker:
source /home/carla/UDAutoware/install/setup.bash && source /home/carla/cri_node/install/setup.bash
and start autoware using:
ros2 launch autoware_launch autoware.launch.xml map_path:=/home/carla/autoware_map/carla_map/Town10 vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kit
Now we will use:
ros2 run cri tracked_objects_subscriber
And now the CRI node is working.
Uninstalling xquartz (used for X11 forwarding):
brew uninstall xquartz --cask
You can use this command to check all the docker images in your laptop:
docker image list
And use this command to purge all the images:
docker rmi -f $(docker images -aq)
or only purge the demoed one:
docker rmi bytian/autoware_mac_aarch64:v1
Close docker desktop and uninstall through applications on your mac, and then use:
brew uninstall docker
to cleanly uninstall docker.
Finally, clean the downloaded files.
Begin by updating your package list to ensure you have the latest information on available packages:
sudo apt update
Install the necessary packages to allow apt to use repositories over HTTPS:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
Add Docker's GPG key to your system to verify the authenticity of the packages:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
Add the Docker repository to your system's apt sources:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Update your package index to include Docker's repository:
sudo apt update
Install Docker Engine:
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Check if Docker is installed and running:
sudo systemctl status docker
Verify that Docker is working correctly by running the hello-world image:
docker run hello-world
Use command:
exit
to close this sample docker.
Install rocker for better docker launching: rocker github link and CARLA python package:
sudo apt-get install python3-rocker && pip3 install carla
Download the required Autoware src code, Autoware_maps and AutowareUniverse-Carla, and unzip them to your $HOME directory.
Google drive link for Autoware, Autoware_map, AutowareUniverse-Carla, cri node, PythonAPI for Carla files.
Pull CARLA docker to host machine:
docker pull carlasim/carla:0.9.15
Docker run CARLA command:
docker run --privileged --gpus all --net=host -e DISPLAY=$DISPLAY carlasim/carla:0.9.15 /bin/bash ./CarlaUE4.sh --quality-level=low -carla-rpc-port=2000
Pull the docker image with built-in environment for Autoware compilation and launch
docker pull bytian/autoware_ubuntu_amd64:v1
Now we are going to do the compilation but first you need to use this command on your terminal (for display connecting), and WHENEVER you open a terminal in this tutorial, please use this command:
xhost +local:root
Start the docker with built environments and load all the files into the docker by using this command:
rocker --x11 --nvidia --network=host --volume ~/autoware:/home/carla/autoware --volume ~/autoware_map:/home/carla/autoware_map --volume ~/AutowareUniverse-Carla:/home/carla/AutowareUniverse-Carla --volume ~/cri_node:/home/carla/cri_node -- bytian/autoware_ubuntu_amd64:v1
Start compiling Autoware by cd to the directory and use:
colcon build
And then, please source install/setup.bash
Next, please cd to the AutowareUniverse-Carla directory and use:
colcon build
And then, please source install/setup.bash
Next, please cd to the cri_node directory and use:
colcon build
And then, please source install/setup.bash
Now we may bring up the Autoware GUI:
ros2 launch autoware_launch autoware.launch.xml map_path:=/home/carla/autoware_map/carla_map/Town10 vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kit
Open a new terminal, and use these command first:
xhost +local:root
docker ps
Now please check your docker ID, and fill it into this command:
docker exec -it _____ /bin/bash
Now you are attached to the current running Autoware docker, please remember to:
source /home/carla/autoware/install/setup.bash && source /home/carla/AutowareUniverse-Carla/install/setup.bash && source /home/carla/cri_node/install/setup.bash
to source the environment first.
Then please use the command:
ros2 run vehicle host_vehicle
And you may see a little vehicle spawned at a fixed point on the CARLA map, and Autoware.universe is publishing topics about surrounding environment.
Now we are going to repeat several steps from previous section. Starting with opening a new terminal, and use these command first:
xhost +local:root
docker ps
Now please check your docker ID, and fill it into this command:
docker exec -it _____ /bin/bash
Now you are attached to the current running Autoware docker, please remember to:
source /home/carla/autoware/install/setup.bash && source /home/carla/AutowareUniverse-Carla/install/setup.bash && source /home/carla/cri_node/install/setup.bash
to source the environment first.
Now we will use:
ros2 run cri tracked_objects_subscriber
And now the CRI node is working.
You may use this command to start ego_vehicle autonomous driving:
ros2 topic pub /hv_controls std_msgs/String "{data: 'Autoware on'}" --once