Skip to content
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

D405 how to turn auto exposure on while using ros2 launch realsense2_camera rs_launch.py #2598

Closed
EkamBehl opened this issue Jan 16, 2023 · 14 comments
Labels

Comments

@EkamBehl
Copy link

HI,
I've got a d405 camera .I subscribed to /camera/color/image_rect_raw and couldn't do detection(was trying to detect chessboard corners .I opened the image feed on realsense-viewer and it is all white due to lighting condition..The code works on the screenshot of the image after i turn auto exposure on in realsense-viewer.
Is the auto exposure on while running the launch file.If not,how do i turn it on?
i am running ros2 humble .
Thanks for any help

@MartyG-RealSense
Copy link
Collaborator

Hi @EkamBehl Auto-exposure should be enabled by default in both the realsense-viewer tool and the ROS wrapper.

@EkamBehl
Copy link
Author

Hi @MartyG-RealSense ,
For some reason the auto exposure is not on by default.
Is there a way to turn it on?
I've attached a few images one from rviz on the topic camera/colour/image_rect_raw
And one on real sense with auto exposure on:
16739255126592560896709862844584
16739255373838255031301006107102

@MartyG-RealSense
Copy link
Collaborator

Please try enabling the auto-exposure after launch during runtime with the ROS2 command below.

ros2 param set /camera/camera depth_module.enable_auto_exposure true

@EkamBehl
Copy link
Author

@MartyG-RealSense thanks it worked!!

@MartyG-RealSense
Copy link
Collaborator

That's excellent to hear, @EkamBehl - thanks very much for the update!

@MartyG-RealSense
Copy link
Collaborator

Case closed due to solution achieved and no further comments received.

@Adum888
Copy link

Adum888 commented Jan 23, 2023

How is this a sufficient solution?
a parameter not working when set during launch
Has to be set after launch (or depending on the initial configuration firstly turned false and then true again)
This is a mediocre workaround at best and not documented at all.
Edit: @EkamBehl thank you for your tipp. It works and has to do until there is an actual fix

@MartyG-RealSense MartyG-RealSense added the wait_to_close wait to see if problem is solved. label Jan 23, 2023
@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Jan 23, 2023

@Adum888 I will re-open the issue and keep it open so that other RealSense ROS users who may be experiencing a similar problem can add comments about it to this case.

@Adum888
Copy link

Adum888 commented Jan 23, 2023

Thank you

@SamerKhshiboun
Copy link
Contributor

See my comments in #2507 for more information.
The camera control of auto_exposure was turned off due other parameters in the launch file (e.g. depth_module.exposure.1)

@SamerKhshiboun
Copy link
Contributor

#2612

@MartyG-RealSense MartyG-RealSense removed the wait_to_close wait to see if problem is solved. label Mar 23, 2023
@MartyG-RealSense
Copy link
Collaborator

Hi @EkamBehl and @Adum888 Do you require further assistance after the fix implemented by @SamerKhshiboun at
#2612 and merged into the ros2_development ROS2 wrapper? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

@daichang01
Copy link

According to my attempts, commenting out the following can achieve automatic exposure
{'name': 'depth_module.exposure.1', 'default': '7500', 'description': 'Depth module first exposure value. Used for hdr_merge filter'},
{'name': 'depth_module.gain.1', 'default': '16', 'description': 'Depth module first gain value. Used for hdr_merge filter'},
{'name': 'depth_module.exposure.2', 'default': '1', 'description': 'Depth module second exposure value. Used for hdr_merge filter'},
{'name': 'depth_module.gain.2', 'default': '16', 'description': 'Depth module second gain value. Used for hdr_merge filter'},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants