Basler camera detected randomly in ROS
Hello,
I am trying to work with 4 Basler cameras (ac A640-120gm) and ROS and unfortunately when I launch pylon_camera_node.launch ROS connect with a random camera instead of the camera I ask in the config YAML file
Let's say I am working with 4 cameras with the following IDs: "Sun", "Moon", "Earth" & "Mars" (assigned to the cameras via IpConfigurator). When I try to connect to "Sun", I will use roslaunch to call its own launch file, but ROS instead of connect to "Sun" it will connect to another camera (for example "Moon" ) Message in ROS:
[ INFO] [1499291312.687715871]: No Device User ID set -> Will open the camera device found first
[ INFO] [1499291312.943262562]: Found camera with DeviceUserID Moon: acA640-120gm
The launch file in pylon_camera/launch has the following values:
<<?xml version="1.0"?>
<launch>
<arg name="respawn" default="false" />
<arg name="debug" default="false" />
<arg name="node_name" default="pylon_camera_node" />
<arg name="config_file" default="$(find pylon_camera)/config/default_camSun.yaml" />
<arg unless="$(arg debug)" name="launch_prefix" value="" />
<arg if="$(arg debug)" name="launch_prefix" value="gdb -ex run --args" />
<node name="$(arg node_name)" pkg="pylon_camera" type="pylon_camera_node" output="screen"
respawn="$(arg respawn)" launch-prefix="$(arg launch_prefix)">
<param name="camera_frame" value="$(arg node_name)" type="string" />
<param name="camera_info_url" value="file:///Path_to_/.ros/camera_info/Sun.yaml" type="string" />
<rosparam command="load" file="/Path_to_/.ros/camera_info/Sun.yaml" />
</node>
</launch>
The YAML file default_camSun.yaml (located in pylon_camera/config) has the following values
camera_frame: camera
device_user_id: "Sun"
camera_info_url: "/Path_to_/.ros/camera_info/sun.yaml"
image_encoding: "mono8"
frame_rate: 5.0
I can understand ROS choose a camera randomly if I have the value device_user_id with an empty value, but I am specifying to work with the camera "Sun". And the camera is OK because sometime ROS choose the "Sun" camera in its random selection. How is it possible? device_user_id need to be filled in another format?
Thank you in advance for your help.
Your launch file is confused- camera_info_url appears as a param in the launch file and the camSun yaml file, and the arg config_file is being ignored in favor of hard coding a location in the rosparam command load.
Try using rosparam get on the command line to see if device_user_id was set right.