ros-drivers / libuvc_ros

http://www.ros.org/wiki/libuvc_ros
81 stars 97 forks source link

camera freezes when trying to set dynamic_parameters #38

Open ppm-tahi opened 7 years ago

ppm-tahi commented 7 years ago

Hi,

I would like to change resolution and frame rate when it is running. I see that it is possible to do it with dynamic paramters.

In my launch file I am starting the camera 5FPS FullHd yuyv, but with the above script I would like to set 640x480 resolution and 20FPS:

rosrun dynamic_reconfigure dynparam set /camera/c920 "{'width':640, 'height':480, 'frame_rate': 20}" 

The code runs just fine (without error), but the image stops and I have to restart libuvc camera driver to be able to use again.

Am I doing anything wrong?

Thanks!

davelkan-zz commented 7 years ago

Where did you find an indication that these values can be dynamically reconfigured?

The reconfigure block in the code only indicates the following:

    PARAM_INT(scanning_mode, scanning_mode, new_config.scanning_mode);
    PARAM_INT(auto_exposure, ae_mode, 1 << new_config.auto_exposure);
    PARAM_INT(auto_exposure_priority, ae_priority, new_config.auto_exposure_priority);
    PARAM_INT(exposure_absolute, exposure_abs, new_config.exposure_absolute * 10000);
    PARAM_INT(auto_focus, focus_auto, new_config.auto_focus ? 1 : 0);
    PARAM_INT(focus_absolute, focus_abs, new_config.focus_absolute);
    PARAM_INT(gain, gain, new_config.gain);
    PARAM_INT(iris_absolute, iris_abs, new_config.iris_absolute);
    PARAM_INT(brightness, brightness, new_config.brightness);

in general settings such as resolution are no re configurable on cameras, and will require stopping and resuming the feed to change.

ppm-tahi commented 7 years ago

Thanks for your feedback.

Please check this site: http://wiki.ros.org/libuvc_camera 5.1.3 Parameters - Dynamically Reconfigurable Parameters

This chapter has a list with the params, and there is width and height.

If they are not in the "dynamically reconf parameters" why are they there? Someone should correct the documentation: remove the not dyn conf params, mark the dyn conf params or remove the first line after 5.1.3 title.

davelkan-zz commented 7 years ago

I agree. Unfortunately it doesn't look like anybody is actively maintaining this library