From 3ddc9b6d8c250d5750b2783fd9177422d7960b42 Mon Sep 17 00:00:00 2001 From: hbuurmei Date: Mon, 30 Sep 2024 15:53:07 -0700 Subject: [PATCH] docs cam ws setup description --- docs/index.md | 2 +- docs/ros2_workspaces.md | 52 ++++++++++++++++++++++++++++++++--------- docs/video_streaming.md | 24 ------------------- 3 files changed, 42 insertions(+), 36 deletions(-) diff --git a/docs/index.md b/docs/index.md index cfa7166..5a45ff3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -6,5 +6,5 @@ This documentation provides a detailed guide to the setup, configuration, and us ## Contents - **Design:** Documentation for full-system software, electrical, and mechanical design. Inlcudes BOM, CAD assets, circuit diagram, and design considerations. - **Setup:** Instructions for setting up the hardware and software. This shall be referenced for repairs, upgrades, and new installations. -- **Usage:** Description on how to use the Trunk Robot. +- **Usage:** Description on how to use the Trunk Robot, with details on each subcomponents and the overall data collection pipeline. - **Contributing:** Guidelines for contributing to the development of the Trunk Robot project. diff --git a/docs/ros2_workspaces.md b/docs/ros2_workspaces.md index b4d8dd9..57b65ce 100644 --- a/docs/ros2_workspaces.md +++ b/docs/ros2_workspaces.md @@ -18,11 +18,7 @@ For actually building the workspace, we use Colcon, i.e. run: ```bash colcon build ``` -in the `main/` directory and subsequently source the new install: -```bash -source install/setup.bash -``` -Check that the build process runs without any errors. +in the `main/` directory and check that the build process runs without any errors. ??? note "General note" @@ -41,11 +37,12 @@ For completeness, we also list the steps here. Enter the `src/` directory. Download the plugin's repository: -``` +```bash +cd src/ git clone https://github.com/MOCAP4ROS2-Project/mocap4ros2_optitrack.git ``` Install dependencies: -``` +```bash rosdep install --from-paths src --ignore-src -r -y vcs import < mocap4ros2_optitrack/dependency_repos.repos ``` @@ -54,18 +51,20 @@ Specifically, the `server_address` should be equal to the address that Motive is Once that information is entered correctly, compile the workspace: ```bash -cd .. # enter 'mocap' dir. +cd .. colcon build --symlink-install ``` Do make sure that ROS2 Humble is sourced again before building. Certain warnings can come up but may be ignored. Then, check that the Optitrack configuration works fine and is connected by running it once: ```bash +source install/setup.bash ros2 launch mocap4r2_optitrack_driver optitrack2.launch.py ``` This should say "Configured!" as a last message. -As the driver node is a lifecycle node, you should transition to activate: -``` +As the driver node is a lifecycle node, you should transition to activate by running in a separate terminal: +```bash +source install/setup.bash ros2 lifecycle set /mocap4r2_optitrack_driver_node activate ``` which should return "Transitioning successful". @@ -88,6 +87,37 @@ Note that the launch script `trunk.launch.py` is also being version controlled, Again, build the workspace: ```bash -cd .. # enter 'motors' dir. +cd .. colcon build --symlink-install ``` + +## Camera Workspace +**Note:** This workspace runs on the Raspberry Pi. + +First, change directory into the `camera/` folder. + +We closely follow [this tutorial](https://medium.com/swlh/raspberry-pi-ros-2-camera-eef8f8b94304) to install the camera driver, with the difference being that the Pi has Ubuntu 20.04 installed, not Raspberry Pi OS (previously Raspbian). +Specifically, once ROS2 is installed, the following commands can be used to install the camera packages: +```bash +cd src/ +git clone --branch foxy https://gitlab.com/boldhearts/ros2_v4l2_camera.git +git clone --branch foxy https://github.com/ros-perception/vision_opencv.git +git clone --branch foxy https://github.com/ros-perception/image_common.git +git clone --branch foxy-devel https://github.com/ros-perception/image_transport_plugins.git +cd .. +rosdep install --from-paths src -r -y +colcon build +``` +You may need allow the camera to be accessed by the user, which can be done by adding the user to the `video` group, or by adding the following udev rule: +```bash +sudo nano /etc/udev/rules.d/99-webcam.rules +KERNEL=="video[0-9]*", MODE="0666" # add this to the file +sudo udevadm control --reload-rules +sudo udevadm trigger +``` + +## Gripper Workspace +**Note:** This workspace runs on the Raspberry Pi. + +## Setup Testing +To test the correct workings of the ROS2 workspaces, it is recommended to diff --git a/docs/video_streaming.md b/docs/video_streaming.md index 2d5a911..8bc071a 100644 --- a/docs/video_streaming.md +++ b/docs/video_streaming.md @@ -20,27 +20,3 @@ ros2 run rqt_image_view rqt_image_view ``` and select the appropriate topic to view the video stream, e.g. `/image/theora`. This can also be viewed directly with all the other data, as described in the [telemetry viewer](telemetry_viewer.md) page. - -## Re-installing -For instance, [this tutorial](https://medium.com/swlh/raspberry-pi-ros-2-camera-eef8f8b94304) can be followed to re-install the camera driver. -However, note that we installed Ubuntu 20.04 on the Pi, not Raspberry Pi OS (previously Raspbian), such that the ROS2 installation is different (much simpler). -Specifically, once ROS2 is installed, the following commands can be used to install the camera packages: -```bash -mkdir -p Documents/cam_ws/src && cd Documents/cam_ws/src -git clone --branch foxy https://gitlab.com/boldhearts/ros2_v4l2_camera.git -git clone --branch foxy https://github.com/ros-perception/vision_opencv.git -git clone --branch foxy https://github.com/ros-perception/image_common.git -git clone --branch foxy-devel https://github.com/ros-perception/image_transport_plugins.git -cd .. -rosdep install --from-paths src -r -y -colcon build -source install/setup.bash -``` -Then, the camera can be started as described above. -You may need allow the camera to be accessed by the user, which can be done by adding the user to the `video` group, or by adding the following udev rule: -```bash -sudo nano /etc/udev/rules.d/99-webcam.rules -KERNEL=="video[0-9]*", MODE="0666" # add this to the file -sudo udevadm control --reload-rules -sudo udevadm trigger -```