A lab exercise designed to explore autonomous systems design via vehicle simulation in Gazebo and ROS. This repository has been forked from osrf/car_demo.
To start, you'll have to install a ROS/Gazebo environment on your local system. There are various ways to do this. Our recommended way of creating a neatly packaged installation is through Docker, Visual Studio Code and the provided devcontainer.
While less performant due to lack of hardware acceleration, the devcontainer may provide a better development experience than a native install. It requires you to install Docker Engine and offers full language server support for vscode. To get up and running with the devcontainer follow these steps:
-
Install Docker Engine, by following the steps listed for your OS/distro.
- On Linux installation of Docker is fairly straightforward (see instructions linked above).
- On Windows, since Docker Engine requires WSL2, which in turn requires Hyper-V, you might run into conflicts with other virtualization software such as VMware or VirtualBox (see details). We recommend using the latest versions of VMware/VirtualBox (those that support Hyper-V). If -- and only if -- that's impossible you have the following three other options:
- Create a Linux VM (running in VMware or VirtualBox) and install Docker inside there. (difficulty: easy)
- Use Docker Machine instead of Docker Engine and launch the Docker Daemon inside a VMware/VirtualBox VM. This way your local
docker
command will connect to a remote Docker Daemon (the thing that builds, manages, and runs Docker containers) running inside a conventional VM. This option is quite involved. Only recommended for users with a thorough understanding of the Docker ecosystem. (difficulty: hard) - Create a Ubuntu 20.04 LTS Linux VM (running in VMware or VirtualBox) and install ROS natively inside there. Check out the provided
Dockerfile
for required packages and userosdep
to install additional dependencies. (difficulty: medium)
-
In vscode install the Remote - Containers extension.
-
After installation hit
Ctrl + Shift + P
and run>Remote-Containers: Rebuild and Reopen in Container
from the command palette. This will instruct Docker to build the providedDockerfile
, inside of which, we will be able to develop and test our application. Installation may take a few minutes, but only has to be done once. -
The dev-image comes with a light desktop environment (via VNC and noVNC), meaning we can run GUI applications inside the container. To view them open a webbrowser of your choice, or use
>Simple Browser: Show
from the vscode command palette, and connect tohttp://localhost:6080
(password:vscode
). Alternatively, use a VNC viewer to connect to port5901
. -
To build the application follow the usual steps:
cd /workspace catkin_make # NOTE: use setup.zsh when using zsh source "devel/setup.bash"
-
Launch the demo:
cd /workspace roslaunch car_demo demo_keyboard.launch
You should now see several GUI applications pop up on noVNC.
The provided devcontainer comes with a few tools to help with development.
The above animation shows how to compile the project and start a simulation from inside vscode.
-
First open the noVNC page in a browser. Run
>Ports: Focus on Ports View
from the command palette and hit the preview button on Local Addresslocalhost:6080
. This will open a browser window inside vscode, connecting to noVNC inside the devcontainer (password:vscode
). -
Open the terminal panel and run the following commands:
catkin_make -C /workspace # build the project source /workspace/devel/setup.bash # load project into ROS environment roslaunch car_demo demo_keyboard.launch # launch simulation
-
After starting the simulation switch back to noVNC. There you'll see the Rviz GUI. If the window is out of view, right-click the taskbar and hit
Maximize
.
This project is a fork of osrf/car_demo with its respective authors. Light desktop environment script by microsoft/vscode-dev-containers.
Main contributors sorted by lastname:
- Andreas Baulig
- Wolfgang Bradfisch
- Sungeeta Singh
Under supervision by:
- Prof. Thao Dang