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

DDynamic Reconfigure - Default Values #609

Closed
RhysMcK opened this issue Feb 10, 2019 · 10 comments
Closed

DDynamic Reconfigure - Default Values #609

RhysMcK opened this issue Feb 10, 2019 · 10 comments

Comments

@RhysMcK
Copy link
Contributor

RhysMcK commented Feb 10, 2019

Is there simple way to set the default values for the dynamic reconfigurable variables?

@stwirth
Copy link
Contributor

stwirth commented Feb 14, 2019

I'm running into the same problem. The "traditional" ROS dynamic reconfigure server reads all parameter values form the ROS parameter server on startup and sets the parameters to those values. When a dynamic reconfigure call is made, it also updates the values on the parameter server. This way, running a rosparam get / always gets the current configuration of the system, including dynamically configurable parameters. It would be nice if the camera driver behaved the same to be able to save and restore the parameter configuration state.

@stwirth
Copy link
Contributor

stwirth commented Feb 14, 2019

A workaround for this problem is to include a dynamic reconfigure call in the launch file:

  <node name="$(anon param_setter)" pkg="dynamic_reconfigure" type="dynparam"
        args="set /camera/Stereo_Module 'Visual Preset' 3" />

@stwirth
Copy link
Contributor

stwirth commented Feb 14, 2019

Another option is probably to use the JSON config file.

@stwirth
Copy link
Contributor

stwirth commented Feb 15, 2019

One problem with communicating the realsense ROS node parameters with the ROS parameter server is that in the current implementation some parameters have spaces in them (e.g. "Emitter Enabled") which is not a valid ROS parameter name (see http://wiki.ros.org/Names).

@doronhi
Copy link
Contributor

doronhi commented Feb 18, 2019

I'm running into the same problem. The "traditional" ROS dynamic reconfigure server reads all parameter values form the ROS parameter server on startup and sets the parameters to those values. When a dynamic reconfigure call is made, it also updates the values on the parameter server. This way, running a rosparam get / always gets the current configuration of the system, including dynamically configurable parameters. It would be nice if the camera driver behaved the same to be able to save and restore the parameter configuration state.

@stwirth
I don't really understand what is it that you suggest the driver (realsense2_wrapper ) should do?
Can you walk me through your case?

@stwirth
Copy link
Contributor

stwirth commented Feb 18, 2019

@doronhi this is actually a problem of ddynamic_reconfigure.
In dynamic_reconfigure, the initialization sequence is as follows:

Unfortunately ddynamic_reconfigure does not implement the same behavior, especially the read operation from the ROS parameter server is not done on startup (which this ticket is about).
The use case is simple: I start up the camera driver, fiddle with the parameters until I get the image as I want it and use rosparam dump to save the current parameter set. Then, before I launch the camera again, I use rosparam load to load the parameter set or use <rosparam> or <param> tags in a launch file together with the camera driver to restore the state I want.

@stwirth
Copy link
Contributor

stwirth commented Feb 18, 2019

Another thing that ddynamic_reconfigure does not support (and therefore the driver cannot support) is to give feedback about which parameter values have been accepted by the callback. The caller of the reconfigure service just has to believe that the requested parameters are applied.

@doronhi
Copy link
Contributor

doronhi commented Feb 28, 2019

@stwirth
Both issues sounds very valid to me. The ddynamic_reconfigure library gives the befit of revealing all the underlying options but its obviously not mature enough.
I will try to add the features you described in the future or merge a PR if one is available.

@stwirth
Copy link
Contributor

stwirth commented Mar 4, 2019

As a workaround to this problem we currently use the JSON format, we simply took the presets from here and adapted the values to match the ones we found by playing with dynamic reconfigure.

@RealSenseCustomerSupport
Copy link
Collaborator

[Please Ignore - RealSense system comment]

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

No branches or pull requests

4 participants