-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ROS2] Emitter On-Off option - D435i #1657
Comments
Hi @SBarzz I believe that the equivalent librealsense function for emitter per-frame strobing would be RS2_EMITTER_ON_OFF, as demonstrated in the link below (warning: flashing image at the top of the page). IntelRealSense/librealsense#3066 Whilst in ROS, the emitter_on_off function would control it. If this function works in ROS1 but not in ROS2, I would speculate that the ZJU-FAST system may be activating it with dynamic_reconfigure like in the link above. There are apparently differences in how ROS2 handles dynamic parameters: IntelRealSense/librealsense#5825 (comment) @doronhi mentions in the above link about being able to watch and modify parameter events on ROS2 using rqt with the parameter reconfigure plugin. I wonder if you could also set emitter_on_off in a ROS2 launch file as a rosparam or in a roslaunch statement with emitter_on_off:=true |
I don't understand, only by setting the RS2_EMITTER_ON_OFF to 1 will not give me the effect that the infra images wont have the emitter pattern within them, right? (Of course, while allowing the device to output high quality depth images with the help of emitter) |
It sounds as though what you actually want to do is remove the dot pattern from the infrared images and avoid laser speckle black dots on the depth image. You also do not want to turn the emitter off and remove the dot pattern but lose depth detail. Is that correct please? If it is correct, some possible options may be: *. Reduce the Laser Power value to reduce the visibility of the dot pattern on the IR image whilst still keeping the projector active. This will reduce the amount of depth detail, but you may be able to fill in some of the holes by applying a post-processing filter that has hole filling capability. You may even find that a hole filling filter fills in depth holes well enough to not need to reduce the dots' visibility with the Laser Power setting. *. Change camera model to a D455. Intel have been working on providing the D415's dot pattern removal ability for D455 via color correction. I am not certain about the current status of development on that feature though. IntelRealSense/librealsense#7149 (comment)
https://dev.intelrealsense.com/docs/projectors *. Turn off the camera's built-in emitter and use a patternless external IR illuminator lamp to provide an IR light source for the camera to use. |
|
A circumstance where depth accuracy could be affected by reduction of dot visibility though is if the surfaces that the camera is observing have low texture or no texture. In the absence of dots being cast into those surfaces to provide the camera with a texture source to.analyze for depth information, the camera may have difficulty with taking accurate depth measurements from those surfaces. |
Update: |
Update: I'm interested in publishing point cloud data that is using the emitter in order to get high quality depth accuracy. |
I shall refer the above information to @doronhi as I am not involved in development. @doronhi Essentually, @SBarzz is asking whether it would be possible to create a system for the ROS wrapper that replicates changes to the wrapper that the project in the link below has done. Namely, "to enable the laser emitter strobe every other frame, allowing the device to output high quality depth images with the help of emitter, and along with binocular images free from laser interference". https://github.com/ZJU-FAST-Lab/ego-planner#improved-ros-realsense-driver |
Meanwhile, I want to understand the emitter on\off feature.
Another update: I would love to have an opinion from you about that |
@SBarzz , it sounds like a valid change request. |
Hi @RoboRoboRoboRobo Do you require further assistance with this case, please? Thanks! |
Case closed due to no further comments received. |
Although this issue is already closed I would like to give an update. I uploaded another branch - foxy-beta. Some of the parameter names are a bit different there but it is more flexible, you turn the infrared stream on and off in run-time and the sequence_id filter is available regardless of the hdr_merge filter:
Using rqt_image_view you can now see an infrared image without the laser pattern. |
@doronhi is there a way to do this selection in the ROS1 wrapper? |
Hi @martinakos You should be able to at least set emitter_on_off to true in ROS1 rosrun during runtime. rosrun dynamic_reconfigure dynparam set /camera/stereo_module emitter_on_off 1 |
Yes, the hdr_merge and alongside it the sequence_id_filter are available in the ROS1 version. |
I can't seem to get the infra1 image without the laser pattern. I'm using ros melodic with a launch file with depth and ir streams enabled then I've set these parameters in the launch file:
I'm trying to visualise the infra1 and depth images in rviz but I can see the ir pattern in the infra1 image. |
Hi @martinakos You could disable the IR dot pattern with emitter_enabled, as described in #1379 (comment) I would recommend setting emitter_enabled to '0' to disable the IR dot projection instead of '2' like the code in the above link does though. '2' (Auto mode) will make the pattern non-visible, but '0' (Off) is the technically correct one for disabling the emitter. |
I've added Also a suspicious thing is that if I check the dynamic reconfigure parameters I can't see any emitter_on_off, filter_by_sequence_id/enable or emitter_on_off/sequence.
I can, however, see the parameters that I've set in the launch file in the parameter server.
|
@martinakos The pattern would not be able to alternate on-off if the IR emitter has been disabled by setting emitter_enabled to '0'. Do you mean that you were actually aiming for the pattern to alternate on-off on a per-frame basis but there never seemed to be a frame in which the pattern was in the 'off' state and instead seemed to be permanently on? As the 400 Series cameras can use ambient light in a scene instead of the dot pattern to analyze surfaces for depth detail, you may not need to have the pattern enabled anyway so long as the scene is well lit, as the camera can make use of that light for generating depth detail. |
I thought this thread was about the usage of emitter_on_off option and selection of the depth image having the IR pattern on and selection of the stereo pair (infra1, infra2) having the IR pattern off. That's why I asked @doronhi if it was possible to do the same in ROS1, he said yes, however my configuration is not working and that's why I asked more showing the parameters I set. So yes, I'm aiming for the pattern to alternate on-off on a per-frame basis. |
@martinakos I believe that the confusion may stem from your original comment at #1657 (comment) that said "I can't seem to get the infra1 image without the laser pattern", suggesting that you desired to turn the pattern off to eliminate it from the image. I apologize if I drew the wrong conclusion from that. |
I am not sure it is possible to set all the parameters in the launch file. The reason is that you can't set "emitter_on_off" while "hdr_merge" is on. However, in the current wrapper, you don't have the "filter_by_sequence_id" option if "hdr_merge" is not set. Set the following commands in the launch file:
Launch realsense-ros using the following command After the node start turn the "hdr_enabled" option to false and then start the "emitter_on_off". Run the following command: I should note here that I am not sure in what order the parameters are actually set. It might be safer to use 2 consecutive commands:
|
@doronhi I'm still not getting this feature working. I'd explained what I've tried:
Then launch my modified res_camera.launch with:
and then disable hdr_enable and enable emitter_on_off as suggested:
After following these steps, what I expect is to be able to visualise in rviz an infra1/infra2 images without laser pattern and a depth map calculated with the laser pattern. However, what I see in rviz is an infra1/infra2 images with the laser pattern and a depth map, which I assume has used the laser pattern too. Note that despite I launched with filters:=hdr_merge and I can verify that hdr_enabled=true in the dynamic_reconfigure parameters, I can't see the filter_by_sequence_id parameter among the dynamic_reconfigure parameters. So I've also tried to set it in the launch file with these variations:
but still can't see it among the dynamic_reconfigure parameters. Then I searched in the realsense-ros github repo and the only reference to filter_by_sequence_id I found is in this issue, none in the code. So the parameter must have a different name. Then I found the sequence_id_filter parameter and I tried to set this one instead of the filter_by_sequence_id. I tried all the following variations:
but none of the worked to show a sequence_id_filter parameter in the dynamic reconfigure either, and in any combination I got the results I look for in rviz. What am I missing to get this feature working? also is my way of testing whether it works, by visualising in rviz, the correct way of testing this feature? I don't see how rviz could differentiate video frames in a stream based on sequence_id |
I usually test with rqt_image_view but I guess rviz is just fine for that too. What versions do you use? (librealsense2, realsense2-camera and firmware) |
It seems like I was wrong and you can't have what you want out of the box. |
Oh, that's a shame. Do you have any estimate if/when the ros wrapper will implement a way of doing what I want so that I can just subscribe to a depth topic (with ir pattern) and subscribe to the infra topics (without ir pattern)?
Maybe this field is a new addition? My versions are: RealSense ROS v2.2.24 Built with LibRealSense v2.44.0 Device FW version: 05.12.13.50 |
Oh! I see the metadata is not available until RealSense ROS v2.3.2. I'll try this version. |
I am sorry but currently, there are no plans to add this functionality to the wrapper. |
Hi,
I'm trying to migrate the functionality to enable the laser emitter strobe every other frame, allowing the device to output high quality depth images with the help of emitter, and along with binocular images free from laser interference:
This functionality is mentioned here:
https://github.com/ZJU-FAST-Lab/ego-planner#improved-ros-realsense-driver
But for some reason it's working only using ROS1 and when I'm trying to take the code to ROS2 it does not work.
Is it possible to release an official support for this feature? or any help on how to implement it in ROS2?
Thanks
The text was updated successfully, but these errors were encountered: