This repository provides a Dockerfile and a DevContainer setup for working with the Point Cloud Library (PCL) in an Ubuntu 20.04 environment. The setup allows you to build your own Docker image and use it with VS Code for development. It also supports XServer for rendering point clouds or visualizations from within Docker.
- Getting Started
- Prerequisites
- Setup Instructions
- Using XServer for Visualization
- Developing with VS Code
- Known Issues
- References
This repository allows you to set up a Docker-based development environment for the Point Cloud Library (PCL) using an Ubuntu 20.04 base image. The provided setup supports XServer for graphical output and can be easily integrated with VS Code through its DevContainers feature.
Before starting, ensure you have the following installed:
- Docker: Install Docker
- VS Code: Download Visual Studio Code
- Remote Containers Extension: Install the Remote - Containers extension
- XServer: Ensure you have an XServer running for graphical applications.
First, clone this repository to your local machine:
git clone https://github.com/wambitz/pcl-devcontainer
cd pcl-devcontainer
Use the provided Dockerfile to build the image:
docker build -t pcl-dev .
The provided Docker setup supports graphical applications, such as those required for 3D point cloud visualization. To use XServer, ensure you have it installed and running on your host machine.
If you're using macOS or Windows, make sure to configure XQuartz
or VcXsrv
correctly and allow connections from the Docker container.
NOTE: If you need help with X-Server and Docker you can visit this page where I explain it depth how to run GUI apps with Docker containers.
You can do this either from the command line or use the devcontainer
configuration provided in this repository:
Run the container with XServer access enabled:
docker run -it --rm \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
pcl-dev
Ensure XServer is running on your host machine and allows connections from the Docker container. On Linux, you may need to run the following:
xhost +local:docker
If you're using VS Code for development, this repository includes a devcontainer.json
configuration file. This allows you to work inside the container with all necessary dependencies set up.
Steps:
- Open this repository in VS Code.
- Press
F1
, then select Remote-Containers: Reopen in Container. - VS Code will automatically open the repository inside the Docker container using the settings from
devcontainer.json
.
cmake -S . -B build
cmake --build build
- VTK Rendering Issues: There is a known issue with VTK on Ubuntu 22.04. To avoid problems with
vtkXRenderWindowInteractor
, we are using Ubuntu 20.04 in this setup. For more information, see this GitHub issue.