wavelab / ximea_ros_cam

Ximea ROS Camera
MIT License
14 stars 12 forks source link

No ROS messages, thus no images #46

Open BestVanRome opened 3 years ago

BestVanRome commented 3 years ago

Hi guys,

I cannot get an output in ROS with your package. The xiCamTool from Ximea works, with no issues, but when I start your package, I cannot get any messages out.

Can you help out with that?

Here is my launch_file:

<launch>
    <node pkg="ximea_ros_cam" type="ximea_ros_cam_node" name="ximea_cam" output="screen">
        <param name="serial_no"       type="string" value="25980251" />
        <param name="cam_name"        type="string" value="ximea_cam_one" />
        <param name="calib_file"      type="string" value=""         />
        <param name="frame_id"        type="string" value="0"        />
        <param name="num_cams_in_bus" type="int"    value="2"        />
        <param name="bw_safetyratio"  type="double" value="1.0"      />
        <param name="publish_xi_image_info" type="bool" value="true"/>
        <param name="poll_time"       type="double" value="2.0"/>
        <param name="poll_time_frame" type="double" value="0.001"/>
        <rosparam command="load" file="$(find ximea_ros_cam)/config/first_cam_config.yaml" />
    </node>
</launch>

The config_file:

####################
# General Configuration Parameters Go Here!
####################

# directory to save images (make sure that directory exists and that it is an absolute path).
image_directory: "/opt/"  # must be absolute path, not relative path (i.e. '~')

# save images to the disk
save_disk: false

# save images on trigger (calibration only)
calib_mode: false

####################
# Diagnostics Configuration Parameters Go Here!
####################

enable_diagnostics: true
data_age_max: 0.1
pub_frequency: 10.0
pub_frequency_tolerance: 1.0

####################
# Camera Configuration Parameters Go Here!
####################

# image_transport compressed image parameters
image_transport_compressed_format: "png"
image_transport_compressed_jpeg_quality: 100
image_transport_compressed_png_level: 5

# colour format
format: "XI_RGB24"

# triggering (0 - none, 1 - software trigger (NOT IMPLMENTED YET),
# 2 - hardware trigger)
cam_trigger_mode: 0
hw_trigger_edge: 0            # if hw trigger, 0/1 = rising/falling edge trigger

# for camera frame rate
frame_rate_control: true      # enable or disable frame rate control
                              # (works if no triggering is enabled)
frame_rate_set: 10            # for trigger mode, fps limiter (0 for none)
img_capture_timeout: 1000     # timeout in milliseconds for xiGetImage()

# exposure settings
auto_exposure: false          # auto exposure on or off
exposure_time: 6000           # manual exposure time in microseconds
manual_gain: 5                # manual exposure gain
auto_exposure_priority: 0.8   # auto exposure to gain ratio (1 = use only exposure)
auto_time_limit: 30000        # auto exposure time limit in microseconds
auto_gain_limit: 2.0          # auto exposure gain limit

# camera coloring
# white balance mode: 0 - none, 1 - use coefficients, 2 = auto
white_balance_mode: 2
white_balance_coef_red: 3.0   # white balance red coefficient (0 to 8)
white_balance_coef_green: 0.0 # white balance green coefficient (0 to 8)
white_balance_coef_blue: 4.0  # white balance blue coefficient (0 to 8)

# region of interest
roi_left: 0                   # top left corner in pixels
roi_top: 0
roi_width: 1280               # width height in pixels
roi_height: 1024

Now, when I launch the package via:
roslaunch ximea_ros_cam first_cam.launch,
I get the following outputs on the console:

SUMMARY
========

PARAMETERS
 * /rosdistro: noetic
 * /rosversion: 1.15.9
 * /ximea_cam/auto_exposure: False
 * /ximea_cam/auto_exposure_priority: 0.8
 * /ximea_cam/auto_gain_limit: 2.0
 * /ximea_cam/auto_time_limit: 30000
 * /ximea_cam/bw_safetyratio: 1.0
 * /ximea_cam/calib_file: 
 * /ximea_cam/calib_mode: False
 * /ximea_cam/cam_name: ximea_cam_one
 * /ximea_cam/cam_trigger_mode: 0
 * /ximea_cam/data_age_max: 0.1
 * /ximea_cam/enable_diagnostics: True
 * /ximea_cam/exposure_time: 6000
 * /ximea_cam/format: XI_RGB24
 * /ximea_cam/frame_id: 0
 * /ximea_cam/frame_rate_control: True
 * /ximea_cam/frame_rate_set: 10
 * /ximea_cam/hw_trigger_edge: 0
 * /ximea_cam/image_directory: /opt/
 * /ximea_cam/image_transport_compressed_format: png
 * /ximea_cam/image_transport_compressed_jpeg_quality: 100
 * /ximea_cam/image_transport_compressed_png_level: 5
 * /ximea_cam/img_capture_timeout: 1000
 * /ximea_cam/manual_gain: 5
 * /ximea_cam/num_cams_in_bus: 2
 * /ximea_cam/poll_time: 2.0
 * /ximea_cam/poll_time_frame: 0.001
 * /ximea_cam/pub_frequency: 10.0
 * /ximea_cam/pub_frequency_tolerance: 1.0
 * /ximea_cam/publish_xi_image_info: True
 * /ximea_cam/roi_height: 1024
 * /ximea_cam/roi_left: 0
 * /ximea_cam/roi_top: 0
 * /ximea_cam/roi_width: 1280
 * /ximea_cam/save_disk: False
 * /ximea_cam/serial_no: 25980251
 * /ximea_cam/white_balance_coef_blue: 4.0
 * /ximea_cam/white_balance_coef_green: 0.0
 * /ximea_cam/white_balance_coef_red: 3.0
 * /ximea_cam/white_balance_mode: 2

NODES
  /
    ximea_cam (ximea_ros_cam/ximea_ros_cam_node)

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

setting /run_id to 14b05f36-b936-11eb-9d7c-3c970ee9a9ac
process[rosout-1]: started with pid [87]
started core service [/rosout]
process[ximea_cam-2]: started with pid [90]
[ INFO] [1621492749.761442786]: Initializing nodelet with 8 worker threads.
[ INFO] [1621492749.950669629]: Initializing Nodelet ... 
[ INFO] [1621492749.950711055]: Loading Node Handles ... 
[ INFO] [1621492749.950726704]: ... Node Handles Loaded. 
[ INFO] [1621492749.950741085]: Loading Camera Configuration
[ INFO] [1621492749.951465679]: cam_name: ximea_cam_one
[ INFO] [1621492749.952235434]: serial number: 25980251
[ INFO] [1621492749.952762650]: frame id: 0
[ INFO] [1621492749.953288439]: calibration file: 
[ INFO] [1621492749.954261878]: poll_time: 2
[ INFO] [1621492749.954882396]: poll_time_frame: 0.001
[ INFO] [1621492749.955476061]: enable_diagnostics: 1
[ INFO] [1621492749.956070467]: pub_frequency: 10
[ INFO] [1621492749.956656329]: pub_frequency_tolerance: 1
[ INFO] [1621492749.957246049]: data_age_max: 0.1
[ INFO] [1621492749.957854014]: image_transport_compressed_format: png
[ INFO] [1621492749.958473381]: image_transport_compressed_jpeg_quality: 100
[ INFO] [1621492749.959030098]: image_transport_compressed_png_level: 5
[ INFO] [1621492749.959596524]: format: XI_RGB24
[ INFO] [1621492749.959660561]: format_int: 2
[ INFO] [1621492749.959681415]: cam_bytesperpixel_: 3
[ INFO] [1621492749.959731534]: cam_encoding_: bgr8
[ INFO] [1621492749.960316768]: cam_num_in_bus_: 2
[ INFO] [1621492749.960810048]: cam_bw_safetyratio_: 1
[ INFO] [1621492749.961298515]: cam_trigger_mode_: 0
[ INFO] [1621492749.961804509]: cam_hw_trigger_edge_: 0
[ INFO] [1621492749.962334847]: cam_framerate_control_: 1
[ INFO] [1621492749.962882357]: cam_framerate_set_: 10
[ INFO] [1621492749.963345592]: cam_img_cap_timeout_: 1000
[ INFO] [1621492749.963828030]: cam_autoexposure_: 0
[ INFO] [1621492749.964452636]: cam_manualgain_: 5
[ INFO] [1621492749.965081993]: cam_exposure_time_: 6000
[ INFO] [1621492749.965575529]: cam_autoexposure_priority_: 0.8
[ INFO] [1621492749.966192122]: cam_autotime_limit_: 30000
[ INFO] [1621492749.966700474]: cam_autogain_limit_: 2
[ INFO] [1621492749.967183467]: cam_white_balance_mode_: 2
[ INFO] [1621492749.967653515]: cam_white_balance_coef_r_: 3
[ INFO] [1621492749.968134889]: cam_white_balance_coef_g_: 0
[ INFO] [1621492749.968609688]: cam_white_balance_coef_b_: 4
[ INFO] [1621492749.969091456]: cam_roi_left_: 0
[ INFO] [1621492749.969575702]: cam_roi_top_: 0
[ INFO] [1621492749.970056319]: cam_roi_width_: 1280
[ INFO] [1621492749.970529650]: cam_roi_height_: 1024
[ INFO] [1621492750.017916811]: using default calibration URL
[ INFO] [1621492750.017975358]: camera calibration URL: file:///root/.ros/camera_info/ximea_cam_one.yaml
[ INFO] [1621492750.018072517]: Unable to open camera calibration file [/root/.ros/camera_info/ximea_cam_one.yaml]
[ WARN] [1621492750.018274475]: Camera calibration file /root/.ros/camera_info/ximea_cam_one.yaml not found.
[ INFO] [1621492750.019962491]: Loading Publishers ... 
[ INFO] [1621492750.020978691]: publish_xi_image_info: 1
[ INFO] [1621492750.021424057]: ... Publishers Loaded. 
[ INFO] [1621492750.021450790]: Loading Timers ... 
[ INFO] [1621492750.021643459]: xi_open_device_cb_: 0x1
[ INFO] [1621492750.021679102]: t_frame_cb_: 0x1
[ INFO] [1621492750.021696162]: ... Timers Loaded.
[ INFO] [1621492750.021720052]: Loading Image Storage ... 
[ INFO] [1621492750.022268553]: image_directory: /opt/
[ INFO] [1621492750.022777119]: save_disk: 0
[ INFO] [1621492750.023268072]: calib_mode_: 0
[ INFO] [1621492750.023296247]: Image Storage Loaded.
[ INFO] [1621492750.023353374]: ... Nodelet Initialized. Waiting for Input...
[ INFO] [1621492752.021777247]: Polling Ximea Cam. Serial #: 25980251
xiAPI: ---- xiOpenDeviceBy API:V4.23.02.00 started ----
xiAPI: XIMEA Camera API V4.23.02.00
xiAPI: Adding camera context: dwID=25980251  ptr=A6B5E000 processID=0000005A
xiAPI: Create handles 1 Process 0000005A
xiAPI: Enable sensor
xiAPI: Calib data: Freq 0030 BL 3FD5 ADC 002B bData 2B
xiAPI: OK retrains 0
xiAPI: xiReadFileFFS Time needed to read file SensFPNCorrections :262ms
xiAPI: xiReadFileFFS Time needed to read file SensFPNCorrections :262ms
xiAPI: Sensor SetExposure freq=48MHz exp=0us regexp=x1
xiAPI: Time needed to read BPL:15ms
xiAPI: Successfully parsed BPL file, 210 total corrected pixels
xiAPI: Sensor SetExposure freq=48MHz exp=0us regexp=x1
xiAPI: AutoSetBandwidth measurement
xiAPI: CalculateResources : Context A6B5E000 ID 25980251 m_maxBytes=1024 m_maxBufferSize=1048576
xiAPI: PoolAllocUSB30: zerocopy not available
xiAPI: AutoSetBandwidth measured 3626Mbps. Safe margin 10% will be used.
xiAPI: Current bandwidth limit auto-set to 3263 Mbps (min:80Mbps,max:3626Mbps)
xiAPI: Sensor SetExposure freq=48MHz exp=28us regexp=x2
xiAPI: Sensor SetExposure freq=48MHz exp=28us regexp=x2
xiAPI: ---- Device opened. Model:MQ042CG-CM SN:25980251 FwF1: API:V4.23.02.00 ----
[ INFO] [1621492757.845665242]: Poll successful. Loading serial #: 25980251
xiAPI: Calib data: Freq 0030 BL 3FD5 ADC 002B bData 2B
xiAPI: OK retrains 0
xiAPI: Sensor SetExposure freq=48MHz exp=28us regexp=x2
xiAPI: Sensor SetExposure freq=48MHz exp=28us regexp=x2
[ INFO] [1621492757.948077322]: WHITE BALANCE MODE SET TO AUTO.
xiAPI: Sensor SetExposure freq=48MHz exp=33us regexp=x4
[ INFO] [1621492757.971144045]: Setting manual exposure: EXPOSURE AMOUNT: 6000 GAIN: 5
xiAPI: Sensor SetExposure freq=48MHz exp=6000us regexp=x8B0
[ INFO] [1621492757.981202231]: MAX WIDTH: 1280
[ INFO] [1621492757.981243220]: MAX HEIGHT: 1024
xiAPI: Calib data: Freq 0026 BL 3FD5 ADC 002E bData 2E
xiAPI: OK retrains 0
xiAPI: Sensor SetExposure freq=38MHz exp=6000us regexp=x6DF
xiAPI: CalculateResources : Context A6B5E000 ID 25980251 m_maxBytes=1024 m_maxBufferSize=1048576
xiAPI: PoolAllocUSB30: zerocopy not available
[ INFO] [1621492759.307825148]: Limiting bandwidth to: 1813 Mbits/sec
xiAPI: Calib data: Freq 002D BL 3FD5 ADC 002C bData 2C
xiAPI: OK retrains 0
xiAPI: Sensor SetExposure freq=45MHz exp=6000us regexp=x825
xiAPI: Sensor SetExposure freq=45MHz exp=6000us regexp=x825
xiAPI: XIA(92f0):xiSetParam (limit_bandwidth_mode) Finished with ERROR: 100
[ INFO] [1621492759.410757772]: Setting frame rate control to: 10 Hz
xiAPI: Sensor SetExposure freq=45MHz exp=6010us regexp=x828
xiAPI: Sensor SetExposure freq=45MHz exp=6010us regexp=x828
[ INFO] [1621492759.455184745]: Starting Acquisition...
xiAPI: Sensor SetExposure freq=45MHz exp=6010us regexp=x828
xiAPI: CalculateResources : Context A6B5E000 ID 25980251 m_maxBytes=1024 m_maxBufferSize=1048576
xiAPI: PoolAllocUSB30: zerocopy not available
xiAPI: StartVideoStream
xiAPI: WorkerThread is up
[ INFO] [1621492759.543589054]: Acquisition started...

Apart from the _limit_bandwidthmode error, I cannot see any problems, with that. And this one I got allready solved and still I see no improvement.
When I check if new messages arrive, with:
rostopic hz /ximea_cam/image_raw I get the following output:

subscribed to [/ximea_cam/image_raw]
no new messages
no new messages
no new messages
no new messages
no new messages
no new messages
no new messages
no new messages
no new messages
no new messages

Ofcourse I cannot see any images when I try to visualize.
If you'll need more info, I'll try to provide anything.

Thanks in advance.l