Skip to content

Commit

Permalink
PR #3056 from SamerKhshiboun: Add documentation for RealSense ROS2 Wr…
Browse files Browse the repository at this point in the history
…apper Windows installation
  • Loading branch information
Nir-Az authored Mar 26, 2024
2 parents b28dd00 + 1d5de35 commit 2ac1f8b
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 4 deletions.
80 changes: 76 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<h1 align="center">
<img src="https://www.intelrealsense.com/wp-content/uploads/2020/09/intel-realsense-logo-360px.png" alt="Intel® RealSense™" title="Intel® RealSense™" />
</h1>
Expand All @@ -24,7 +25,8 @@

## Table of contents
* [ROS1 and ROS2 legacy](#ros1-and-ros2-legacy)
* [Installation](#installation)
* [Installation on Ubuntu](#installation-on-ubuntu)
* [Installation on Windows](#installation-on-windows)
* [Usage](#usage)
* [Starting the camera node](#start-the-camera-node)
* [Camera name and namespace](#camera-name-and-camera-namespace)
Expand Down Expand Up @@ -78,7 +80,7 @@
</details>


# Installation
# Installation on Ubuntu

<details>
<summary>
Expand All @@ -88,14 +90,14 @@
- #### Ubuntu 22.04:
- [ROS2 Iron](https://docs.ros.org/en/iron/Installation/Ubuntu-Install-Debians.html)
- [ROS2 Humble](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html)

</details>

<details>
<summary>
Step 2: Install latest Intel&reg; RealSense&trade; SDK 2.0
</summary>

**Please choose only one option from the 3 options below (in order to prevent multiple versions installation and workspace conflicts)**

- #### Option 1: Install librealsense2 debian package from Intel servers
- Jetson users - use the [Jetson Installation Guide](https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_jetson.md)
- Otherwise, install from [Linux Debian Installation Guide](https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md#installing-the-packages)
Expand Down Expand Up @@ -161,6 +163,76 @@

<hr>

# Installation on Windows
**PLEASE PAY ATTENTION: RealSense ROS2 Wrapper is not meant to be supported on Windows by our team, since ROS2 and its packages are still not fully supported over Windows. We added these installation steps below in order to try and make it easier for users who already started working with ROS2 on Windows and want to take advantage of the capabilities of our RealSense cameras**

<details>
<summary>
Step 1: Install the ROS2 distribution
</summary>

- #### Windows 10/11
**Please choose only one option from the two options below (in order to prevent multiple versions installation and workspace conflicts)**
- Manual install from ROS2 formal documentation:
- [ROS2 Iron](https://docs.ros.org/en/iron/Installation/Windows-Install-Binary.html)
- [ROS2 Humble](https://docs.ros.org/en/humble/Installation/Windows-Install-Binary.html)
- Microsoft IOT binary installation:
- https://ms-iot.github.io/ROSOnWindows/GettingStarted/SetupRos2.html
- Pay attention that the examples of install are for Foxy distro (which is not supported anymore by RealSense ROS2 Wrapper)
- Please replace the word "Foxy" with Humble or Iron, as you choose
</details>

<details>
<summary>
Step 2: Download RealSense&trade; ROS2 Wrapper and RealSense&trade; SDK 2.0 source code from github:
</summary>

- Download Intel&reg; RealSense&trade; ROS2 Wrapper source code from [Intel&reg; RealSense&trade; ROS2 Wrapper Releases](https://github.com/IntelRealSense/realsense-ros/releases)
- Download the corrosponding supported Intel&reg; RealSense&trade; SDK 2.0 source code from the **"Supported RealSense SDK" section** of the specific release you chose fronm the link above
- Place the librealsense folder inside the realsense-ros folder, to make the librealsense package set beside realsense2_camera, realsense2_camera_msgs and realsense2_description packages
</details>

<details>
<summary>
Step 3: Build
</summary>

1. Before starting building of our packages, make sure you have OpenCV for Windows installed on your machine. If you choose the Microsoft IOT way to install it, it will be installed automatically. Later, when colcon build, you might need to expose this installation folder by setting CMAKE_PREFIX_PATH, PATH, or OpenCV_DIR environment variables
2. Run "x64 Native Tools Command Prompt for VS 2019" as administrator
3. Setup ROS2 Environment (Do this for every new terminal/cmd you open):
- If you choose the Microsoft IOT Binary option for installation
```
> C:\opt\ros\humble\x64\setup.bat
```
- If you choose the ROS2 formal documentation:
```
> call C:\dev\ros2_iron\local_setup.bat
```
4. Change directory to realsense-ros folder
```bash
> cd C:\ros2_ws\realsense-ros
```
5. Build librealsense2 package only
```bash
> colcon build --packages-select librealsense2 --cmake-args -DBUILD_EXAMPLES=OFF -DBUILD_WITH_STATIC_CRT=OFF -DBUILD_GRAPHICAL_EXAMPLES=OFF
```
- User can add `--event-handlers console_direct+` parameter to see more debug outputs of the colcon build
6. Build the other packages
```bash
> colcon build --packages-select realsense2_camera_msgs realsense2_description realsense2_camera
```
- User can add `--event-handlers console_direct+` parameter to see more debug outputs of the colcon build
7. Setup environment with new installed packages (Do this for every new terminal/cmd you open):
```bash
> call install\setup.bat
```
</details>
<hr>
# Usage
## Start the camera node
Expand Down
5 changes: 5 additions & 0 deletions realsense2_camera/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ find_package(nav_msgs REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(tf2 REQUIRED)
find_package(diagnostic_updater REQUIRED)
find_package(OpenCV REQUIRED COMPONENTS core)

find_package(realsense2 2.54.1)
if (BUILD_ACCELERATE_GPU_WITH_GLSL)
Expand All @@ -127,6 +128,8 @@ endif()
#set(CMAKE_NO_SYSTEM_FROM_IMPORTED true)
include_directories(include)

include_directories(${OpenCV_INCLUDE_DIRS}) # add OpenCV includes to the included dirs

set(node_plugins "")

set(SOURCES
Expand Down Expand Up @@ -220,6 +223,8 @@ else()
set(link_libraries ${realsense2_LIBRARY})
endif()

list(APPEND link_libraries ${OpenCV_LIBS}) # add OpenCV libs to link_libraries

target_link_libraries(${PROJECT_NAME}
${link_libraries}
)
Expand Down

0 comments on commit 2ac1f8b

Please sign in to comment.