ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Dynamic Recongure callback seems to happen spontaneously

asked 2023-04-02 20:52:41 -0600

pitosalas gravatar image

I know that's imposible. Help me spot my mistake. I think I am just launching the camera (raspicam_node) and suddenly out of nowhere comes a dynamic reconfigure. I was playing with that before but now to troubleshoot as far as I can tell, everything is off and all I have is:

/base_link_to_camera
/raspicam_node
/rosout

And yet, see the call too dynamic reconfigure in this log. I know I am not understanding some detail, but I can't figure out what!.

Thanks,

Pito

PARAMETERS
 * /raspicam_node/camera_frame_id: raspicam
 * /raspicam_node/camera_id: 0
 * /raspicam_node/camera_info_url: package://raspica...
 * /raspicam_node/camera_name: camerav2_1280x960
 * /raspicam_node/enable_imv: False
 * /raspicam_node/enable_raw: False
 * /raspicam_node/exposure_mode: antishake
 * /raspicam_node/framerate: 10
 * /raspicam_node/height: 960
 * /raspicam_node/private_topics: True
 * /raspicam_node/shutter_speed: 0
 * /raspicam_node/vFlip: 0
 * /raspicam_node/width: 1280
 * /rosdistro: noetic
 * /rosversion: 1.15.14

NODES
  /
    base_link_to_camera (tf/static_transform_publisher)
    raspicam_node (raspicam_node/raspicam_node)

auto-starting new master
process[master]: started with pid [2579]
ROS_MASTER_URI=http://100.64.81.29:11311

setting /run_id to 15542e90-d1c1-11ed-a130-518a9bdbf4c9
process[rosout-1]: started with pid [2589]
started core service [/rosout]
process[raspicam_node-2]: started with pid [2596]
process[base_link_to_camera-3]: started with pid [2597]
[ INFO] [1680486285.632388511]: splitter component done

[ INFO] [1680486285.872005087]: camera calibration URL: package://raspicam_node/camera_info/camerav2_1280x960.yaml
[ INFO] [1680486286.080336951]: Camera successfully calibrated from default file
[ INFO] [1680486286.080749447]: using default calibration URL
[ INFO] [1680486286.081100851]: camera calibration URL: file:///home/ubuntu/.ros/camera_info/camerav2_1280x960.yaml
[ INFO] [1680486286.081757617]: Unable to open camera calibration file [/home/ubuntu/.ros/camera_info/camerav2_1280x960.yaml]
[ WARN] [1680486286.082066000]: Camera calibration file /home/ubuntu/.ros/camera_info/camerav2_1280x960.yaml not found.
[ INFO] [1680486286.082351102]: No device specifc calibration found
[ INFO] [1680486286.222915249]: Reconfigure Request: contrast 0, sharpness 0, brightness 50, saturation 0, ISO 400, exposureCompensation 0, videoStabilisation 0, vFlip 1, hFlip 0, zoom 1.00, exposure_mode antishake, awb_mode auto, shutter_speed 0
[ INFO] [1680486286.290719372]: Starting video capture (1280, 960, 80, 10)

[ INFO] [1680486286.292337641]: Video capture started!!
edit retag flag offensive close merge delete

Comments

PS: for future questions: please always either link to the wiki page for the package you are using, or a source repository.

There are multiple raspicam_node packages with the exact same name, but in completely disconnected repositories. Without more information from you to uniquely identify which one you are using, it's impossible to be certain.

gvdhoorn gravatar image gvdhoorn  ( 2023-04-03 02:50:29 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2023-04-03 02:47:54 -0600

gvdhoorn gravatar image

updated 2023-04-03 02:54:15 -0600

I think I am just launching the camera (raspicam_node) and suddenly out of nowhere comes a dynamic reconfigure.

I'm almost certain this is the default behaviour for dynamic_reconfigure servers.

See #q28327 fi (also the answer by @joq ), #q250134 and finally the source of dynamic_configure's Server::setCallback(..) itself (from here):

void setCallback(const CallbackType &callback)
{
  boost::recursive_mutex::scoped_lock lock(mutex_);
  callback_ = callback;
  callCallback(config_, ~0); // At startup we need to load the configuration with all level bits set. (Everything has changed.)
  updateConfigInternal(config_);
}

Notice how it calls callCallback(..) right after storing the callback is assigned to callback_ (ie: the member variable).

This lets the server load the default values for all parameters using the same callback that is used to handle any incoming reconfigure requests from actual clients.

edit flag offensive delete link more

Comments

You're correct. The surprising thing is that this overrides parameters set in the launch file in favor of the default parameters specified in the dynamic configure setup.

pitosalas gravatar image pitosalas  ( 2023-04-03 10:24:10 -0600 )edit
1

That's discussed in #q250134.

Seems to be a problem in the node, not of dynamic_reconfigure itself.

gvdhoorn gravatar image gvdhoorn  ( 2023-04-03 10:31:37 -0600 )edit
0

answered 2023-04-03 06:01:15 -0600

It appears the dynamic reconfigure request for raspicam_node is being initiated by the node itself. We can observe in the log that after calibrating, the node tries to load a device-specific calibration file but is unable to locate one, so default calibration parameters are used and then sent as part of a reconfigure request with these default values.

[ INFO] [1680486286.081100851]: camera calibration URL: file:///home/ubuntu/.ros/camera_info/camerav2_1280x960.yaml
[ INFO] [1680486286.081757617]: Unable to open camera calibration file [/home/ubuntu/.ros/camera_info/camerav2_1280x960.yaml]
[ WARN] [1680486286.082066000]: Camera calibration file /home/ubuntu/.ros/camera_info/camerav2_1280x960.yaml not found.
[ INFO] [1680486286.082351102]: No device specifc calibration found
[ INFO] [1680486286.222915249]: Reconfigure Request: contrast 0, sharpness 0, brightness 50, saturation 0, ISO 400, exposureCompensation 0, videoStabilisation 0, vFlip 1, hFlip 0, zoom 1.00, exposure_mode antishake, awb_mode auto, shutter_speed 0

Therefore, the dynamic reconfigure request isn't initiated by itself but instead triggers by raspicam_node as a fallback mechanism when it cannot locate a device-specific calibration file.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-04-02 20:52:41 -0600

Seen: 79 times

Last updated: Apr 03 '23