anqixu / ueye_cam

A ROS nodelet and node that wraps the driver API for UEye cameras by IDS Imaging Development Systems GMBH.
Other
60 stars 102 forks source link

add check_ueye_api and run within rgb8.launch #27

Closed k-okada closed 8 years ago

k-okada commented 8 years ago

this may help people who confused without install driver (#21)

this will outputs like

k-okada@kokada-t440s:/tmp/hoge/src/ueye_cam$ roslaunch launch/rgb8.launch ... logging to /home/k-okada/.ros/log/fefbfe9e-b5c5-11e5-aa92-68f728079ca1/roslaunch-kokada-t440s-10735.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
WARNING: disk usage in log directory [/home/k-okada/.ros/log] is over 1GB.
It's recommended that you use the 'rosclean' command.

[ERROR] [1452399057.321138428]: The official IDS uEye driver (libueye_api.so) were not detected on your machine.
[ERROR] [1452399057.321196612]: You (or a system administrator) MUST still download and install the official IDS uEye drivers (http://en.ids-imaging.com/download-ueye.html).
[ERROR] [1452399057.321216126]: Also make sure that the IDS daemon (/etc/init.d/ueyeusbdrc) is running.
Invalid <param> tag: Cannot load command parameter [check_ueye_api]: command [rosrun ueye_cam check_ueye_api] returned with code [1]. 

Param xml is <param command="rosrun ueye_cam check_ueye_api" name="check_ueye_api"/>
The traceback for the exception was written to the log file
130s commented 8 years ago

+1. This looks helpful and I confirmed the message gets printed on a machine that the proprietary library is not installed.

Notice that as you see at the bottom of the output below, the lib file libueye_api.so that's used for checking in this PR actually exists in devel space. If I understand correctly, the check didn't find libueye_api.so because the path is not in LD_LIBRARY_PATH.

$ rm -fr .catkin_tools/
$ catkin config --no-install
------------------------------------------------------------------------------------
Profile:                     default
Extending:             [env] /home/rosegg/cws_drivers/install:/home/rosegg/cws_drivers/devel:/opt/ros/indigo
Workspace:                   /home/rosegg/cws_drivers
Source Space:       [exists] /home/rosegg/cws_drivers/src
Build Space:       [missing] /home/rosegg/cws_drivers/build
Devel Space:       [missing] /home/rosegg/cws_drivers/devel
Install Space:     [missing] /home/rosegg/cws_drivers/install
DESTDIR:                     None
-----------------------------------------------------------------------------------
Isolate Develspaces:         False
Install Packages:            False
Isolate Installs:            False
-----------------------------------------------------------------------------------
Additional CMake Args:       None
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
-----------------------------------------------------------------------------------
Whitelisted Packages:        None
Blacklisted Packages:        None
-----------------------------------------------------------------------------------
Workspace configuration appears valid.
-----------------------------------------------------------------------------------
$ catkin build ueye_cam
-----------------------------------------------------------------------------------
Profile:                     default
Extending:             [env] /home/rosegg/cws_drivers/install:/home/rosegg/cws_drivers/devel
Workspace:                   /home/rosegg/cws_drivers
Source Space:       [exists] /home/rosegg/cws_drivers/src
Build Space:        [exists] /home/rosegg/cws_drivers/build
Devel Space:        [exists] /home/rosegg/cws_drivers/devel
Install Space:     [missing] /home/rosegg/cws_drivers/install
DESTDIR:                     None
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Isolate Develspaces:         False
Install Packages:            False
Isolate Installs:            False
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Additional CMake Args:       None
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Whitelisted Packages:        None
Blacklisted Packages:        None
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Workspace configuration appears valid.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
Found '33' packages in 0.0 seconds. 
Starting ==> ueye_cam                                                                                                                                                                                                
Finished <== ueye_cam [ 13.7 seconds ]                                                                                                                                                                               
[build] Finished.                                                                                                                                                                                                    
[build] Runtime: 13.8 seconds 
$ ls
build  devel  src  tmp
$ source devel/setup.bash 
$ roslaunch ueye_cam rgb8.launch 
... logging to /home/rosegg/.ros/log/38e69e26-ba25-11e5-b9b3-5c514f208280/roslaunch-130s-t440s-6415.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://130s-t440s:58066/

SUMMARY
========

PARAMETERS
 * /check_ueye_api: 
:

NODES
  /
    nodelet_manager (nodelet/nodelet)
    ueye_cam_nodelet (nodelet/nodelet)

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

setting /run_id to 38e69e26-ba25-11e5-b9b3-5c514f208280
process[rosout-1]: started with pid [6448]
started core service [/rosout]
process[nodelet_manager-2]: started with pid [6458]
process[ueye_cam_nodelet-3]: started with pid [6465]
[ INFO] [1452710475.160934881]: Initializing nodelet with 4 worker threads.
[ INFO] [1452710475.482643212]: Unable to open camera calibration file [/home/rosegg/.ros/camera_info/camera.yaml]
[ERROR] [1452710475.753006366]: No UEye cameras are connected

[ERROR] [1452710475.753071807]: Hint: make sure that the IDS camera daemon (/etc/init.d/ueyeusbdrc) is running

[ERROR] [1452710475.753139060]: Failed to initialize [camera]
^C[ueye_cam_nodelet-3] killing on exit
[nodelet_manager-2] killing on exit
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done
$ sudo updatedb
[sudo] password for rosegg: 
$ locate libueye_api.so
/home/rosegg/cws_drivers/devel/share/ueye_cam/amd64/libueye_api.so
$
$ echo $LD_LIBRARY_PATH
/home/rosegg/cws_drivers/install/lib/x86_64-linux-gnu:/home/rosegg/cws_drivers/devel/lib/x86_64-linux-gnu:/opt/ros/indigo/lib/x86_64-linux-gnu:/home/rosegg/cws_drivers/install/lib:/home/rosegg/cws_drivers/devel/lib:/opt/ros/indigo/lib
n130s@130s-t440s:~/link/ROS/indigo_trusty/cws_drivers$ ll
total 64K
drwxr-xr-x  5 n130s n130s2 4.0K Jan 13 10:51 devel/
drwxr-xr-x  4 n130s n130s2 4.0K Jan 13 10:51 build/
drwxr-xr-x  7 n130s n130s2 4.0K Jan 13 10:51 ./
drwxr-xr-x  3 n130s n130s2 4.0K Jan 13 10:51 .catkin_tools/
drwxr-xr-x 18 n130s n130s2 4.0K Jan  8 09:28 ../
drwxr-xr-x  8 n130s n130s2 4.0K Dec  7 18:40 src/
drwxr-xr-x  4 n130s n130s2 4.0K Sep  7 23:47 tmp/
-rw-r--r--  1 n130s n130s2   98 Mar 22  2015 .catkin_workspace
anqixu commented 8 years ago

The code changes all seem sensible, although I don't have a uEye cam with me for testing.

Just one question before merging: why was check_ueye_api executed as the args of a rosparam, vs via a tag? Is it because s are resolved before s?

k-okada commented 8 years ago

i used rosparam because that runs before node tag. see #28 for another implementation using node + required tag, that would outputs like

setting /run_id to c0df492c-ba52-11e5-a10d-28b2bde75e69
process[rosout-1]: started with pid [26146]
started core service [/rosout]
process[check_ueye_api-2]: started with pid [26157]
process[nodelet_manager-3]: started with pid [26161]
[ERROR] [1452730029.672937836]: The official IDS uEye driver (libueye_api.so) were not detected on your machine.
[ERROR] [1452730029.673009710]: You (or a system administrator) MUST still download and install the official IDS uEye drivers (http://en.ids-imaging.com/download-ueye.html).
process[ueye_cam_nodelet-4]: started with pid [26164]
[ INFO] [1452730029.732105880]: Initializing nodelet with 4 worker threads.
================================================================================REQUIRED process [check_ueye_api-2] has died!
process has died [pid 26157, exit code 1, cmd /tmp/hoge/devel/lib/ueye_cam/check_ueye_api __name:=check_ueye_api __log:=/home/k-okada/.ros/log/c0df492c-ba52-11e5-a10d-28b2bde75e69/check_ueye_api-2.log].
log file: /home/k-okada/.ros/log/c0df492c-ba52-11e5-a10d-28b2bde75e69/check_ueye_api-2*.log
Initiating shutdown!
================================================================================
[ueye_cam_nodelet-4] killing on exit
[nodelet_manager-3] killing on exit
[check_ueye_api-2] killing on exit
[rosout-1] killing on exit
[master] killing on exit
k-okada commented 8 years ago

the error @130s seeing (pasted below) is not related to this PR, just because you do not connect real camera.

[ERROR] [1452710475.753006366]: No UEye cameras are connected
[ERROR] [1452710475.753071807]: Hint: make sure that the IDS camera daemon (/etc/init.d/ueyeusbdrc) is running
[ERROR] [1452710475.753139060]: Failed to initialize [camera]

if you remove libueye_api.so, you'll catch message like

[ERROR] [1452730029.672937836]: The official IDS uEye driver (libueye_api.so) were not detected on your machine.
[ERROR] [1452730029.673009710]: You (or a system administrator) MUST still download and install the official IDS uEye drivers (http://en.ids-imaging.com/download-ueye.html).

, which I introduced in this PR

k-okada commented 8 years ago
If I understand correctly, the check didn't find libueye_api.so because the path is not in LD_LIBRARY_PATH.

My guess is during devel phase, cmake tells location https://github.com/k-okada/ueye_cam/blob/add_check_ueye_api/CMakeLists.txt#L99, and running time libueye_api.so is installed at /usr/lib

k-okada commented 8 years ago

BTW, I do not have a camera neither, so did not tested on real setting, how about asking manufacture to donate cameras to the maintainers?