-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd9a686
commit 241961e
Showing
15 changed files
with
327 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Align Depth to Color | ||
This example shows how to start the camera node and align depth stream to color stream. | ||
``` | ||
ros2 launch realsense2_camera rs_align_depth_launch.py | ||
``` | ||
|
||
The aligned image will be published to the topic "/aligned_depth_to_color/image_raw" | ||
|
||
Also, align depth to color can enabled by following cmd: | ||
``` | ||
ros2 launch realsense2_camera rs_launch.py align_depth.enable:=true" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
# Launching Dual RS ROS2 nodes | ||
The following example lanches two RS ROS2 nodes. | ||
``` | ||
ros2 launch realsense2_camera rs_dual_camera_launch.py serial_no1:=<serial number of the first camera> serial_no2:=<serial number of the second camera> | ||
``` | ||
|
||
## Example: | ||
Let's say the serial numbers of two RS cameras are 207322251310 and 234422060144. | ||
``` | ||
ros2 launch realsense2_camera rs_dual_camera_launch.py serial_no1:="'207322251310'" serial_no2:="'234422060144'" | ||
``` | ||
or | ||
``` | ||
ros2 launch realsense2_camera rs_dual_camera_launch.py serial_no1:=_207322251310 serial_no2:=_234422060144 | ||
``` | ||
|
||
## How to know the serial number? | ||
Method 1: Using the rs-enumerate-devices tool | ||
``` | ||
rs-enumerate-devices | grep "Serial Number" | ||
``` | ||
|
||
Method 2: Connect single camera and run | ||
``` | ||
ros2 launch realsense2_camera rs_launch.py | ||
``` | ||
and look for the serial number in the log printed to screen under "[INFO][...] Device Serial No:". | ||
|
||
# Using Multiple RS camera by launching each in differnet terminals | ||
Make sure you set a different name and namespace for each camera. | ||
|
||
Terminal 1: | ||
``` | ||
ros2 launch realsense2_camera rs_launch.py serial_no:="'207322251310'" camera_name:='camera1' camera_namespace:='camera1' | ||
``` | ||
Terminal 2: | ||
``` | ||
ros2 launch realsense2_camera rs_launch.py serial_no:="'234422060144'" camera_name:='camera2' camera_namespace:='camera2' | ||
``` | ||
|
||
# Multiple cameras showing a semi-unified pointcloud | ||
The D430 series of RealSense cameras use stereo based algorithm to calculate depth. This mean, a couple of cameras can operate on the same scene. For the purpose of this demonstration, let's say 2 cameras can be coupled to look at the same scene from 2 different points of view. See image: | ||
|
||
![multi_cameras](https://user-images.githubusercontent.com/127019120/268692789-1b3d5d8b-a41f-4a97-995d-81d44b4bcacb.jpg) | ||
|
||
The schematic settings could be described as: | ||
X--------------------------------->cam_2 | ||
|    (70 cm) | ||
| | ||
| | ||
| (60 cm) | ||
| | ||
| | ||
/ | ||
cam_1 | ||
|
||
The cameras have no data regarding their relative position. Thats up to a third party program to set. To simplify things, the coordinate system of cam_1 can be considered as the refernce coordinate system for the whole scene. | ||
|
||
The estimated translation of cam_2 from cam_1 is 70(cm) on X-axis and 60(cm) on Y-axis. Also, the estimated yaw angle of cam_2 relative to cam_1 as 90(degrees) clockwise. These are the initial parameters to be set for setting the transformation between the 2 cameras as follows: | ||
|
||
``` | ||
ros2 launch realsense2_camera rs_dual_camera_launch.py serial_no1:=_207322251310 serial_no2:=_234422060144 tf.translation.x:=0.7 tf.translation.y:=0.6 tf.translation.z:=0.0 tf.rotation.yaw:=-90.0 tf.rotation.pitch:=0.0 tf.rotation.roll:=0.0 | ||
``` | ||
|
||
If the unified pointcloud result is not good, follow the below steps to fine-tune the calibaration. | ||
|
||
## Visualizing the pointclouds and fine-tune the camera calibration | ||
Launch 2 cameras in separate terminals: | ||
|
||
**Terminal 1:** | ||
``` | ||
ros2 launch realsense2_camera rs_launch.py serial_no:="'207322251310'" camera_name:='camera1' camera_namespace:='camera1' | ||
``` | ||
**Terminal 2:** | ||
``` | ||
ros2 launch realsense2_camera rs_launch.py serial_no:="'234422060144'" camera_name:='camera2' camera_namespace:='camera2' | ||
``` | ||
**Terminal 3:** | ||
``` | ||
rviz2 | ||
``` | ||
Open rviz and set 'Fixed Frame' to camera1_link | ||
Add Pointcloud2-> By topic -> /camera1/camera1/depth/color/points | ||
Add Pointcloud2 -> By topic -> /camera2/camera2/depth/color/points | ||
|
||
**Terminal 4:** | ||
Run the 'set_cams_transforms.py' tool. It can be used to fine-tune the calibaration. | ||
``` | ||
python src/realsense-ros/realsense2_camera/scripts/set_cams_transforms.py camera1_link camera2_link 0.7 0.6 0 -90 0 0 | ||
``` | ||
|
||
**Instructions printed by the tool:** | ||
``` | ||
Using default file /home/user_name/ros2_ws/src/realsense-ros/realsense2_camera/scripts/_set_cams_info_file.txt | ||
Use given initial values. | ||
Press the following keys to change mode: x, y, z, (a)zimuth, (p)itch, (r)oll | ||
For each mode, press 6 to increase by step and 4 to decrease | ||
Press + to multiply step by 2 or - to divide | ||
Press Q to quit | ||
``` | ||
|
||
Note that the tool prints the path of the current configuration file. It saves its last configuration automatically, all the time, to be used on the next run. | ||
|
||
After a lot of fiddling around, unified pointcloud looked better with the following calibaration: | ||
``` | ||
x = 0.75 | ||
y = 0.575 | ||
z = 0 | ||
azimuth = -91.25 | ||
pitch = 0.75 | ||
roll = 0 | ||
``` | ||
|
||
Now, use the above results in the launch file: | ||
``` | ||
ros2 launch realsense2_camera rs_dual_camera_launch.py serial_no1:=_207322251310 serial_no2:=_234422060144 tf.translation.x:=0.75 tf.translation.y:=0.575 tf.translation.z:=0.0 tf.rotation.yaw:=-91.25 tf.rotation.pitch:=0.75 tf.rotation.roll:=0.0 | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Launching RS ROS2 node from rosbag File | ||
The following example allows streaming a rosbag file, saved by Intel RealSense Viewer, instead of streaming live with a camera. It can be used for testing and repetition of the same sequence. | ||
``` | ||
ros2 launch realsense2_camera rs_launch_from_rosbag.py | ||
``` | ||
By default, the 'rs_launch_from_rosbag.py' launch file uses the "/rosbag/D435i_Depth_and_IMU_Stands_still.bag" rosbag file. | ||
|
||
User can also provide a different rosbag file through cmd line as follows: | ||
``` | ||
ros2 launch realsense2_camera rs_launch_from_rosbag.py rosbag_filename:="/full/path/to/rosbag/file" | ||
``` | ||
or | ||
``` | ||
ros2 launch realsense2_camera rs_launch.py rosbag_filename:="/full/path/to/rosbag/file" | ||
``` | ||
|
||
Check-out [sample-recordings](https://github.com/IntelRealSense/librealsense/blob/master/doc/sample-data.md) for a few recorded samples. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
realsense2_camera/examples/launch_params_from_file/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Get RS ROS2 node params from YAML file | ||
The following example gets the RS ROS2 node params from YAML file. | ||
``` | ||
ros2 launch realsense2_camera rs_launch_get_params_from_yaml.py | ||
``` | ||
|
||
By default, 'rs_launch_get_params_from_yaml.py' launch file uses the "/config/config.yaml" YAML file. | ||
|
||
User can provide a different YAML file through cmd line as follows: | ||
``` | ||
ros2 launch realsense2_camera rs_launch_get_params_from_yaml.py config_file:="/full/path/to/config/file" | ||
``` | ||
or | ||
``` | ||
ros2 launch realsense2_camera rs_launch.py config_file:="/full/path/to/config/file" | ||
``` | ||
|
||
## Syntax for defining params in YAML file | ||
``` | ||
param1: value | ||
param2: value | ||
``` | ||
|
||
Example: | ||
``` | ||
enable_color: true | ||
rgb_camera.profile: 1280x720x15 | ||
enable_depth: true | ||
align_depth.enable: true | ||
enable_sync: true | ||
publish_tf: true | ||
tf_publish_rate: 1.0 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# PointCloud Visualization | ||
The following example starts the camera and simultaneously opens RViz GUI to visualize the published pointcloud. | ||
``` | ||
ros2 launch realsense2_camera rs_pointcloud_launch.py | ||
``` | ||
|
||
Alternatively, start the camera terminal 1: | ||
``` | ||
ros2 launch realsense2_camera rs_launch.py pointcloud.enable:=true | ||
``` | ||
and in terminal 2 open rviz to visualize pointcloud. | ||
|
||
# PointCloud with different coordinate systems | ||
This example opens rviz and shows the camera model with different coordinate systems and the pointcloud, so it presents the pointcloud and the camera together. | ||
``` | ||
ros2 launch realsense2_camera rs_d455_pointcloud_launch.py | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.