Setting dynamic parameters

If a node implements a dynamic reconfigure parameter server, we can userqt_reconfigure to modify it on the fly. Run the following example, which implements a dynamic reconfigure server with several parameters (see thecfg file in the cfg folder of the package):

    $ roslaunch chapter3_tutorials example6.launch  

With the dynamic reconfigure server running, open the GUI with the following command:

    $ rosrun rqt_reconfigure rqt_reconfigure  

Select the example6 server in the left-hand side panel, and you will see its parameters, which you can modify directly. The parameter changes take effect immediately, running the code inside a callback method in the example source code, which checks for the validity of the values. In this example, the parameters are printed every time they are changed, that is, when the callback method is executed. The following screenshot is an example of the expected behavior:

Dynamic parameters were originally meant for drivers, in order to make it easier to modify them on the fly. For this reason, several drivers already implement them; nevertheless, they can be used for any other node. Examples of drivers that implement them are the hokuyo_node driver for the Hokuyo laser rangefinders or the Firewire camera1394 driver. Indeed, in the case of Firewire cameras, it is common for drivers to support changing configuration parameters of the sensor, such as the frame rate, shutter speed, and brightness, among others. The ROS driver for FireWire (IEEE 1394, a and b) cameras can be run with the following command:

    $ rosrun camera1394 camera1394_node
  

Once the camera is running, we can configure its parameters with rqt_reconfigure, and we should see something similar to what's shown in the following screenshot:

Note that we will cover how to work with cameras in Chapter 8, Computer Vision, where we will also explain these parameters from a developer's point of view.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.217.220