Skip to content

Commit

Permalink
Merge pull request #1502 from doronhi/feature-IR-RGB-fix
Browse files Browse the repository at this point in the history
Fix Option to enable infrared RGB frame
  • Loading branch information
doronhi authored Nov 16, 2020
2 parents 21bdd6b + 9a0aade commit 9c5d88b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Setting *unite_imu_method* creates a new topic, *imu*, that replaces the default
- **publish_tf**: boolean, publish or not TF at all. Defaults to True.
- **tf_publish_rate**: double, positive values mean dynamic transform publication with specified rate, all other values mean static transform publication. Defaults to 0
- **publish_odom_tf**: If True (default) publish TF from odom_frame to pose_frame.
- **infrargb**: When set to True (default: False), it configures the infrared camera to stream in RGB (color) mode, thus enabling the use of a RGB image in the same frame as the depth image, potentially avoiding frame transformation related errors. When this feature is required, you are additionally required to also enable `enable_infra:=true` for the infrared stream to be enabled.
- **infra_rgb**: When set to True (default: False), it configures the infrared camera to stream in RGB (color) mode, thus enabling the use of a RGB image in the same frame as the depth image, potentially avoiding frame transformation related errors. When this feature is required, you are additionally required to also enable `enable_infra:=true` for the infrared stream to be enabled.
- **NOTE** The configuration required for `enable_infra` is independent of `enable_depth`
- **NOTE** To enable the Infrared stream, you should enable `enable_infra:=true` NOT `enable_infra1:=true` nor `enable_infra2:=true`
- **NOTE** This feature is only supported by Realsense sensors with RGB streams available from the `infra` cameras, which can be checked by observing the output of `rs-enumerate-devices`
Expand Down
4 changes: 2 additions & 2 deletions realsense2_camera/launch/includes/nodelet.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<arg name="enable_infra" default="false"/>
<arg name="enable_infra1" default="false"/>
<arg name="enable_infra2" default="false"/>
<arg name="enable_infrargb" default="false"/>
<arg name="infra_rgb" default="false"/>

<arg name="color_width" default="640"/>
<arg name="color_height" default="480"/>
Expand Down Expand Up @@ -126,7 +126,7 @@
<param name="enable_infra" type="bool" value="$(arg enable_infra)"/>
<param name="enable_infra1" type="bool" value="$(arg enable_infra1)"/>
<param name="enable_infra2" type="bool" value="$(arg enable_infra2)"/>
<param name="infrargb" type="bool" value="$(arg enable_infrargb)"/>
<param name="infra_rgb" type="bool" value="$(arg infra_rgb)"/>

<param name="fisheye_fps" type="int" value="$(arg fisheye_fps)"/>
<param name="depth_fps" type="int" value="$(arg depth_fps)"/>
Expand Down
10 changes: 5 additions & 5 deletions realsense2_camera/launch/rs_camera.launch
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
<arg name="depth_height" default="480"/>
<arg name="enable_depth" default="true"/>

<arg name="infra_width" default="640"/>
<arg name="infra_height" default="480"/>
<arg name="infra_width" default="640"/>
<arg name="infra_height" default="480"/>
<arg name="enable_infra" default="false"/>
<arg name="enable_infra1" default="false"/>
<arg name="enable_infra2" default="false"/>
<arg name="enable_infrargb" default="false"/>
<arg name="infra_rgb" default="false"/>

<arg name="color_width" default="640"/>
<arg name="color_height" default="480"/>
Expand Down Expand Up @@ -86,10 +86,10 @@

<arg name="infra_width" value="$(arg infra_width)"/>
<arg name="infra_height" value="$(arg infra_height)"/>
<arg name="enable_infra" value="$(arg enable_infra)"/>
<arg name="enable_infra" value="$(arg enable_infra)"/>
<arg name="enable_infra1" value="$(arg enable_infra1)"/>
<arg name="enable_infra2" value="$(arg enable_infra2)"/>
<arg name="enable_infrargb" value="$(arg enable_infrargb)"/>
<arg name="infra_rgb" value="$(arg infra_rgb)"/>

<arg name="fisheye_fps" value="$(arg fisheye_fps)"/>
<arg name="depth_fps" value="$(arg depth_fps)"/>
Expand Down
6 changes: 3 additions & 3 deletions realsense2_camera/src/base_realsense_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,9 @@ void BaseRealSenseNode::getParameters()
ROS_INFO("getParameters...");

// Setup system to use RGB image from the infra stream if configured by user
bool infrargb;
_pnh.param("infrargb", infrargb, false);
if (infrargb)
bool infra_rgb;
_pnh.param("infra_rgb", infra_rgb, false);
if (infra_rgb)
{
_format[RS2_STREAM_INFRARED] = RS2_FORMAT_RGB8;
_image_format[RS2_STREAM_INFRARED] = CV_8UC3; // CVBridge type
Expand Down

0 comments on commit 9c5d88b

Please sign in to comment.