From b14d8e33f962580644d9e623f76b221e621dfed8 Mon Sep 17 00:00:00 2001 From: Dave Kroezen Date: Fri, 22 Nov 2024 14:43:47 +0100 Subject: [PATCH] remove user / workspace setup --- .devcontainer/scancontrol/devcontainer.json | 23 ----------- .docker/docker-compose.yml | 43 --------------------- README.md | 38 ++++++------------ 3 files changed, 12 insertions(+), 92 deletions(-) delete mode 100644 .devcontainer/scancontrol/devcontainer.json delete mode 100644 .docker/docker-compose.yml diff --git a/.devcontainer/scancontrol/devcontainer.json b/.devcontainer/scancontrol/devcontainer.json deleted file mode 100644 index a514fa9..0000000 --- a/.devcontainer/scancontrol/devcontainer.json +++ /dev/null @@ -1,23 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.217.4/containers/go -{ - "name": "scancontrol-devcontainer", - "dockerComposeFile": [ - "../../src/scancontrol/.docker/docker-compose.yml" - ], - "service": "scancontrol-service", - "remoteUser": "ros", - "workspaceFolder": "/home/ros/workspace/", - "customizations": { - "vscode": { - // Set *default* container specific settings.json values on container create. - "settings": { - }, - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - ] - } - } - // "postCreateCommand": "printenv | grep ROS" - // "forwardPorts": [], -} \ No newline at end of file diff --git a/.docker/docker-compose.yml b/.docker/docker-compose.yml deleted file mode 100644 index ba5bf6c..0000000 --- a/.docker/docker-compose.yml +++ /dev/null @@ -1,43 +0,0 @@ -version: '3' - -name: scancontrol-compose -services: - scancontrol-service: - container_name: scancontrol-container - build: - context: . - dockerfile: Dockerfile - user: ros - working_dir: /home/ros/workspace - # command: > - # sh -c "sudo apt-get update && - # rosdep update && - # rosdep install --from-paths . --ignore-src -y && - # source /opt/ros/humble/setup.bash && - # colcon build --merge-install --symlink-install --cmake-args "-DCMAKE_BUILD_TYPE=RelWithDebInfo" "-DCMAKE_EXPORT_COMPILE_COMMANDS=On" -Wall -Wextra -Wpedantic && - # . install/setup.bash" - # Uncomment to expose graphic card drivers - # deploy: - # resources: - # reservations: - # devices: - # - driver: nvidia - # count: 1 - # capabilities: [gpu] - environment: - - DISPLAY=${DISPLAY} - - QT_X11_NO_MITSHM=1 - - XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR} - # Uncomment to expose graphic card drivers - # - NVIDIA_DRIVER_CAPABILITIES=all - volumes: - - ../../../:/home/ros/workspace - - /var/run/docker.sock:/var/run/docker.sock - - /tmp/.X11-unix:/tmp/.X11-unix:rw - - ${XAUTHORITY:-$HOME/.Xauthority}:/root/.Xauthority - # Uncomment to use git within the devcontainer - # - ~/.ssh/:/home/ros/.ssh/ - network_mode: "host" #TODO: UNSAFE, change to specific port! - tty: true - init: true - \ No newline at end of file diff --git a/README.md b/README.md index 2b73d7d..e11acdb 100644 --- a/README.md +++ b/README.md @@ -17,43 +17,29 @@ Maintainers: ## Installation #### Dependencies +It is assumed the following dependencies are installed on your systems already. - [Aravis 0.8.x](https://github.com/AravisProject/aravis/releases) [[docs]](https://aravisproject.github.io/aravis/) - [scanCONTROL Linux C++ SDK 1.0.x](https://www.micro-epsilon.com/2D_3D/laser-scanner/Software/downloads/) +Alternatively, a `Dockerfile` is provided to build a ROS image with the dependencies installed. + #### Building -To build from source, clone the latest version from this repository into your workspace and compile the package: +To build from source, clone the latest version from this repository into your workspace: ```bash -mkdir -p ros2_ws/src && cd ros2_ws -git clone git@github.com:sam-xl/scancontrol.git -b ros2-devel src +cd ros_ws +git clone https://github.com/sam-xl/scancontrol.git ``` -To build locally, after installing Aravis and the SDK: + +Install the dependencies of the cloned packages using `rosdep`: ```bash -sudo apt-get update -rosdep update rosdep install --from-paths src --ignore-src -y -colcon build --merge-install --symlink-install --cmake-args "-DCMAKE_BUILD_TYPE=RelWithDebInfo" "-DCMAKE_EXPORT_COMPILE_COMMANDS=On" -Wall -Wextra -Wpedantic ``` -And source the installation + +Finally, build all packages in the workspace: ```bash -. install/setup.bash +colcon build ``` -## Development setup -For anyone having access to scanCONTROL hardware and not wanting to install dependencies locally, follow the setup below to work with docker compose or in a devcontainer environment. - -#### Docker compose: -- `cd src/scancontrol/.docker` -- `docker compose up -d --build` -- If using VSCode, you can attach a shell or VSCode and work from there. -- Or you can use other dev IDEs? **TODO**: - - Add [watch](https://docs.docker.com/compose/file-watch/) sections to one or more services in compose.yaml - - Run docker compose watch to build and launch a Compose project and start the file watch mode. - - Edit service source files using your preferred IDE or editor -#### devcontainer: -- Link the `.devcontainer` folder - - cd to your `ros2_ws` - - `cp src/scancontrol/.devcontainer/ .` - - Hit `F1` in VSCode and select `build and reaopen in container` ## Nodes ### scancontrol_description_node @@ -176,4 +162,4 @@ Please report bugs and request features using the [Issue Tracker](https://github [micro_epsilon_scancontrol_msgs/GetResolution]: https://github.com/sam-xl/scancontrol/blob/master/micro_epsilon_scancontrol_msgs/srv/GetResolution.srv [micro_epsilon_scancontrol_msgs/SetFeature]: https://github.com/sam-xl/scancontrol/blob/master/micro_epsilon_scancontrol_msgs/srv/SetFeature.srv [micro_epsilon_scancontrol_msgs/SetResolution]: https://github.com/sam-xl/scancontrol/blob/master/micro_epsilon_scancontrol_msgs/srv/SetResolution.srv -[std_srvs/SetBool]: http://docs.ros.org/api/std_srvs/html/srv/SetBool.html \ No newline at end of file +[std_srvs/SetBool]: http://docs.ros.org/api/std_srvs/html/srv/SetBool.html