## page was renamed from camera1394/Cturtle/Tutorials/UsingMultipleIEEE1394Cameras ## page was renamed from camera1394/Tutorials/UsingMultipleIEEE1394Cameras ## For instruction on writing tutorials ## http://www.ros.org/wiki/WritingTutorials #################################### ##FILL ME IN #################################### ## for a custom note with links: ## note = ## for the canned note of "This tutorial assumes that you have completed the previous tutorials:" just add the links ## note.0= [[camera1394/Tutorials/CalibratingIEEE1394Camera|Camera Calibration]] ## descriptive title for the tutorial ## title = How to Use Multiple IEEE 1394 Cameras ## multi-line description to be displayed in search ## description = This tutorial explains how to handle multiple IEEE 1394 camera streams with ROS. ## the next tutorial description (optional) ## next = ## links to next tutorial (optional) ## next.0.link= ## next.1.link= ## what level user is this tutorial for ## level= IntermediateCategory ## keywords = #################################### <> <> === Multiple ROS Namespaces === One reasonable approach is to run each camera in its own namespace using $ROS_NAMESPACE or the [[roslaunch]] `ns` parameter. That gives all the topics and parameters unique names so they can be accessed without (much) confusion. === Unique Frame IDs === Each camera needs a unique [[tf]] frame of reference identifier. Set it using the `frame_id` parameter. === Example Launch File === This example assumes the local `/cameras` directory contains calibration files. {{{ }}} === Grouping Common Elements === With multiple cameras, it is often convenient to group the parameters for each camera in a separate [[rosparam#YAML_Format|rosparam YAML file]]. We can pass equivalent parameters to the first camera by defining `/cameras/unibrain.yaml` like this: {{{ guid: 08144361026320a0 video_mode: 640x480_yuv411 frame_id: unibrain camera_info_url: file:///cameras/unibrain_calibration.yaml }}} For the second camera, define `/cameras/sony.yaml` like this: {{{ guid: 0800461000821fa2 video_mode: 1280x960_mono8 frame_id: sony camera_info_url: file:///cameras/sony_calibration.yaml bayer_pattern: gbrg }}} It is generally a good idea to organize launch files hierarchically. So, let's create a common launch file for the [[image_pipeline]] in `/cameras/image_pipeline.launch`: {{{ }}} Now, the equivalent launch looks like this: {{{ }}} === Setting Feature Values === So far, we started the cameras with whatever feature settings were currently defined in the devices. Sometimes that is useful, but we often want to set them explicitly. The [[camera1394/Tutorials/ConfiguringIEEE1394CameraFeatures|configuring camera features tutorial]] explained how to do that. My Sony XCD-SX90CR works better if I set several features in `/cameras/sony.yaml` explicitly: {{{ guid: 0800461000821fa2 video_mode: 1280x960_mono8 frame_id: sony camera_info_url: file:///cameras/sony_calibration.yaml bayer_pattern: gbrg # set some feature values: auto_gamma: 3 # Manual gamma: 2 auto_shutter: 2 # Auto auto_white_balance: 2 # Auto }}} === Stereo Cameras === The `camera1394` driver does not handle stereo cameras directly. It is possible to combine two monocular 1394 cameras to produce a stereo image if they are configured to trigger at the same time. Some IIDC cameras provide hardware trigger synchronization for this purpose. Since the timestamps of the left and right images will be close, but not identical, use the `~approximate_sync` parameter for the [[stereo_image_proc]] nodelets and for [[camera_calibration]]. The previous examples did not publish the topic names expected for stereo processing. The stereo [[image_pipeline]] components expect the published topic names to be grouped as `left/image_raw` and `right/image_raw`. That can be achieved by remapping the topic names as shown in this launch file: {{{ }}} Note the unique node names assigned to each driver instance. ## AUTOGENERATED DO NOT DELETE ## TutorialCategory ## FILL IN THE STACK TUTORIAL CATEGORY HERE