User Tools

Site Tools


using_the_mesa_sr4000_with_ros_indigo

Using the Mesa Imaging SR4000 3D Sensor with ROS Indigo

Step 1 - Download the drivers

The drivers are available from http://www.mesa-imaging.ch/drivers.php

Make sure you download the right version.

I downloaded a file “libmesasr-dev-1.0.14-748.amd64.deb”

I installed it to my system as follows:

bash$ dpkg -i libmesasr-dev-1.0.14-748.amd64.deb

The contents of the .deb package file are shown below:

arwillis@visionlab16-pc:~/sr4000$ dpkg -L libmesasr-dev
/.
/usr
/usr/lib
/usr/lib/libmesasr.so.1.0.14
/usr/share
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/libMesaSRTester.1.gz
/usr/share/libmesasr
/usr/share/libmesasr/ipm_00_x3s0200_s_3_03.bit
/usr/share/libmesasr/shm_10_x2s0050_s_0_01.bit
/usr/share/libmesasr/shm_30_x3s0200_p_x_00.bit
/usr/share/libmesasr/camDataSR3k00.xml
/usr/share/libmesasr/ipm_00_x3s0200_s_4_05.bit
/usr/share/libmesasr/IPM_00_X3S0200_P_0_10.bit
/usr/share/libmesasr/camDataSR3k01.xml
/usr/share/libmesasr/ipm_00_x3s0200_s_0_03.bit
/usr/share/libmesasr/shm_10_x2s0050_s_2_01.bit
/usr/share/libmesasr/ipm_00_x3s0200_s_0_01.bit
/usr/share/libmesasr/ipm_00_x3s0200_s_6_05.bit
/usr/share/libmesasr/shm_10_x2s0050_s_0_03.bit
/usr/share/libmesasr/ipm_00_x3s0200_s_0_04.bit
/usr/share/libmesasr/ipm_00_x3s0200_s_2_01.bit
/usr/share/libmesasr/shm_10_x2s0050_s_1_01.bit
/usr/share/libmesasr/SHM_00_X2S0100_P_0_11.bit
/usr/share/libmesasr/shm_10_x2s0050_s_1_03.bit
/usr/share/libmesasr/driverData.xml
/usr/share/libmesasr/ipm_00_x3s0200_s_1_01.bit
/usr/share/libmesasr/ipm_00_x3s0200_s_2_03.bit
/usr/share/libmesasr/shm_10_x2s0050_s_3_03.bit
/usr/share/libmesasr/ipm_00_x3s0200_s_1_03.bit
/usr/share/libmesasr/camDataSR2B.xml
/usr/share/libmesasr/shm_10_x2s0050_s_2_03.bit
/usr/share/libmesasr/ipm_00_x3s0200_s_0_06.bit
/usr/share/doc
/usr/share/doc/libmesasr-dev
/usr/share/doc/libmesasr-dev/AUTHORS.gz
/usr/share/doc/libmesasr-dev/changelog.gz
/usr/share/doc/libmesasr-dev/sourceCode
/usr/share/doc/libmesasr-dev/sourceCode/srs-Streams.tar.gz
/usr/share/doc/libmesasr-dev/sourceCode/examples.tar.gz
/usr/share/doc/libmesasr-dev/copyright
/usr/share/doc/libmesasr-dev/README.gz
/usr/share/doc/libmesasr-dev/changelog.Debian.gz
/usr/bin
/usr/bin/libMesaSRTester
/usr/include
/usr/include/libMesaSR.h
/usr/include/MesaProtocol.h
/usr/include/definesSR.h
/etc
/etc/udev
/etc/udev/rules.d
/etc/udev/rules.d/46-mesa.rules
/usr/lib/libmesasr.so.1.0.14.748
/usr/lib/libmesasr.so

Note the program “/usr/bin/libMesaSRTester” is to test your sensor.

The file “/etc/udev/rules.d/46-mesa.rules” sets up user access for the sensor (discussed below).

Step 2 - Ensure you can access the sensor

Give the sensor power and plug the usb connector from the sensor to your linux box. Verify you have the correct udev rules file to be able to access the sensor. You can verify by looking for the file “/etc/udev/rules.d/46-mesa.rules”. It should contain the following:

BUS!="usb", SUBSYSTEM!=="usb_device", ACTION!="add", GOTO="kcontrol_rules_end"

#Swissranger SR3k(old),SR3k,SR4k
#SYSFS{idVendor}=="0852", SYSFS{idProduct}=="0074", MODE="0666", GROUP="video"
#SYSFS{idVendor}=="1ad2", SYSFS{idProduct}=="0074", MODE="0666", GROUP="video"
#SYSFS{idVendor}=="1ad2", SYSFS{idProduct}=="0075", MODE="0666", GROUP="video"

#Swissranger SR3k(old),SR3k,SR4k
SUBSYSTEM=="usb", ATTRS{idVendor}=="0852", ATTRS{idProduct}=="0074", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1ad2", ATTRS{idProduct}=="0074", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1ad2", ATTRS{idProduct}=="0075", MODE:="0666", OWNER:="root", GROUP:="video"

LABEL="kcontrol_rules_end"

If it doesn't exist, create it using sudo access and fill the contents with the text shown above.

The rules allow you to access the device if you are a member of the video group (or you are root of course). Make sure you are a member of the video group.

arwillis@visionlab16-pc:~/NRC/ROS_RGBD_Odometry/ros_ws/src$ cat /etc/group | grep video
video:x:44:arwillis

This shows my username “arwillis” next to the output line starting with “video” in the “/etc/groups” file. If you don't see your name next to the video group as above you must add yourself to the video group with the following command “sudo adduser <myusername> video”. Re-run the command above to verify you are now a member of the “video” group. If you are newly added to the “video” group, YOU MUST LOGOUT AND LOG BACK IN TO MAKE YOUR NEW GROUP ASSOCIATION/PERMISSIONS ACTIVE.

Run the Mesa Imaging test software: “/usr/bin/libMesaSRTester” I performed the following test:

  1. Press “1” for “Basic Test”
  2. Press “s” for “scan”
  3. Press “2” for “Camera '018':MESA 3D-SR4000 ' Serial: 4000032b'” (This tests my SR4000 camera)
  4. Press “x” for “exit”

Output for this test sequence is below:

arwillis@visionlab16-pc:~/NRC/ROS_RGBD_Odometry/ros_ws/src$ /usr/bin/libMesaSRTester 
-------------------------------------------------------
CTestSRCustomer:
 1: TestBasic
 2: TestDataDump
 3: TestContinousAcquire
 4: TestUserSrvCmd
 5: TestTrial
----------------
x: exit

press a key
****001**** Testing SR_GetVersion		
>>>>   >>>> Version 1.0.14.748
****001**** Testing SR_GetVersion		SUCCESS
****002**** Testing SR_OpenDlg			
>>>>   >>>> CMesaDeviceFactory::OpenLastCam() not supported in Linux
>>>>   >>>> CM_CAM_SELECT->CP_CS_OPENDLG
-------------------------------------------------------
x: exit
s: scan

press a key
>>>>   >>>> CM_CAM_SELECT->CP_SCAN_CAM
>>>>   >>>> CM_CAM_SELECT->CP_FOUND_CAM
Camera File Stream
usb_set_debug: Setting debugging level to 255 (on)
usb_os_find_busses: Found 009
usb_os_find_busses: Found 008
usb_os_find_busses: Found 007
usb_os_find_busses: Found 006
usb_os_find_busses: Found 005
usb_os_find_busses: Found 004
usb_os_find_busses: Found 003
usb_os_find_busses: Found 002
usb_os_find_busses: Found 001
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 009
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 008
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 007
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 006
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 005
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 004
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 003
error obtaining child information: Operation not permitted
usb_os_find_devices: Found 018 on 002
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 004 on 002
skipped 1 class/vendor specific interface descriptors
skipped 1 class/vendor specific interface descriptors
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 002 on 002
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 002
error obtaining child information: Inappropriate ioctl for device
error obtaining child information: Operation not permitted
error obtaining child information: Operation not permitted
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 002 on 001
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 001
error obtaining child information: Operation not permitted
error obtaining child information: Operation not permitted
>>>>   >>>> CM_CAM_SELECT->CP_FOUND_CAM
'018':MESA   3D-SR4000   ' Serial: 4000032b'
usb_set_debug: Setting debugging level to 0 (off)
-------------------------------------------------------
1: Camera Camera File Stream
2: Camera '018':MESA   3D-SR4000   ' Serial: 4000032b'
x: exit
s: scan

press a key
>>>>   >>>> CM_CAM_SELECT->CP_CONNECT
usb_set_debug: Setting debugging level to 255 (on)
usb_os_find_busses: Found 009
usb_os_find_busses: Found 008
usb_os_find_busses: Found 007
usb_os_find_busses: Found 006
usb_os_find_busses: Found 005
usb_os_find_busses: Found 004
usb_os_find_busses: Found 003
usb_os_find_busses: Found 002
usb_os_find_busses: Found 001
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 009
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 008
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 007
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 006
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 005
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 004
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 003
error obtaining child information: Operation not permitted
usb_os_find_devices: Found 018 on 002
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 004 on 002
skipped 1 class/vendor specific interface descriptors
skipped 1 class/vendor specific interface descriptors
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 002 on 002
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 002
error obtaining child information: Inappropriate ioctl for device
error obtaining child information: Operation not permitted
error obtaining child information: Operation not permitted
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 002 on 001
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 001
error obtaining child information: Operation not permitted
error obtaining child information: Operation not permitted

done.
>>>>   >>>> CM_CAM_SELECT->CP_CS_CLOSEDLG
****002**** Testing SR_OpenDlg			SUCCESS
****003**** Testing SR_GetDeviceString		
>>>>   >>>> VendorID:0x1ad2, ProductID:0x0075, Manufacturer:'MESA   ', Product:'3D-SR4000   '
****003**** Testing SR_GetDeviceString		SUCCESS
****004**** Testing SR_SetTimeout (BLIND)	SUCCESS
****005**** Testing Get Rows/Cols		SUCCESS
****006**** Testing Get Rows/Cols		SUCCESS
****007**** Testing GetImageList		SUCCESS
****008**** Testing GetImage			SUCCESS
****009**** Testing GetImage			SUCCESS
****010**** Testing SR_SetMode			SUCCESS
****011**** Testing SR_SetMode			SUCCESS
****012**** Testing SR_Acquire			SUCCESS
****013**** Testing SR_Acquire			SUCCESS
****014**** Testing SR_Acquire			SUCCESS
****015**** Testing SR_Acquire			SUCCESS
****016**** Testing SR_Acquire			SUCCESS
****017**** Testing SR_Acquire			SUCCESS
****018**** Testing SR_Acquire			SUCCESS
****019**** Testing SR_Acquire			SUCCESS
****020**** Testing SR_Acquire			SUCCESS
****021**** Testing SR_Acquire			SUCCESS
****022**** Testing SR_CoordTrfUint16		SUCCESS
****023**** Testing SR_CoordTrfUint16		SUCCESS
****024**** Testing SR_CoordTrfUint16		SUCCESS
****025**** Testing SR_CoordTrfUint16		SUCCESS
****026**** Testing SR_CoordTrfUint16		SUCCESS
****027**** Testing SR_CoordTrfUint16		SUCCESS
****028**** Testing SR_CoordTrfUint16		SUCCESS
****029**** Testing SR_CoordTrfUint16		SUCCESS
****030**** Testing SR_CoordTrfUint16		SUCCESS
****031**** Testing SR_CoordTrfUint16		SUCCESS
****032**** Testing SR_CoordTrfUint16		SUCCESS
****033**** Testing SR_CoordTrfUint16		SUCCESS
****034**** Testing SR_CoordTrfUint16		SUCCESS
****035**** Testing SR_CoordTrfUint16		SUCCESS
****036**** Testing SR_CoordTrfUint16		SUCCESS
****037**** Testing SR_CoordTrfUint16		SUCCESS
****038**** Testing SR_CoordTrfUint16		SUCCESS
****039**** Testing SR_CoordTrfUint16		SUCCESS
****040**** Testing SR_CoordTrfUint16		SUCCESS
****041**** Testing SR_CoordTrfUint16		SUCCESS
****042**** Testing SR_CoordTrfFlt		SUCCESS
****043**** Testing SR_CoordTrfFlt		SUCCESS
****044**** Testing SR_CoordTrfFlt		SUCCESS
****045**** Testing SR_CoordTrfFlt		SUCCESS
****046**** Testing SR_CoordTrfFlt		SUCCESS
****047**** Testing SR_CoordTrfFlt		SUCCESS
****048**** Testing SR_CoordTrfFlt		SUCCESS
****049**** Testing SR_CoordTrfFlt		SUCCESS
****050**** Testing SR_CoordTrfFlt		SUCCESS
****051**** Testing SR_CoordTrfFlt		SUCCESS
****052**** Testing SR_CoordTrfFlt		SUCCESS
****053**** Testing SR_CoordTrfFlt		SUCCESS
****054**** Testing SR_CoordTrfFlt		SUCCESS
****055**** Testing SR_CoordTrfFlt		SUCCESS
****056**** Testing SR_CoordTrfFlt		SUCCESS
****057**** Testing SR_CoordTrfFlt		SUCCESS
****058**** Testing SR_CoordTrfFlt		SUCCESS
****059**** Testing SR_CoordTrfFlt		SUCCESS
****060**** Testing SR_CoordTrfFlt		SUCCESS
****061**** Testing SR_CoordTrfFlt		SUCCESS
****062**** Testing SR_CoordTrfDbl		SUCCESS
****063**** Testing SR_CoordTrfDbl		SUCCESS
****064**** Testing SR_CoordTrfDbl		SUCCESS
****065**** Testing SR_CoordTrfDbl		SUCCESS
****066**** Testing SR_CoordTrfDbl		SUCCESS
****067**** Testing SR_CoordTrfDbl		SUCCESS
****068**** Testing SR_CoordTrfDbl		SUCCESS
****069**** Testing SR_CoordTrfDbl		SUCCESS
****070**** Testing SR_CoordTrfDbl		SUCCESS
****071**** Testing SR_CoordTrfDbl		SUCCESS
****072**** Testing SR_CoordTrfDbl		SUCCESS
****073**** Testing SR_CoordTrfDbl		SUCCESS
****074**** Testing SR_CoordTrfDbl		SUCCESS
****075**** Testing SR_CoordTrfDbl		SUCCESS
****076**** Testing SR_CoordTrfDbl		SUCCESS
****077**** Testing SR_CoordTrfDbl		SUCCESS
****078**** Testing SR_CoordTrfDbl		SUCCESS
****079**** Testing SR_CoordTrfDbl		SUCCESS
****080**** Testing SR_CoordTrfDbl		SUCCESS
****081**** Testing SR_CoordTrfDbl		SUCCESS
****082**** Testing SR_CoordTrfPntUint16	SUCCESS
****083**** Testing SR_CoordTrfPntUint16	SUCCESS
****084**** Testing SR_CoordTrfPntUint16	SUCCESS
****085**** Testing SR_CoordTrfPntUint16	SUCCESS
****086**** Testing SR_CoordTrfPntUint16	SUCCESS
****087**** Testing SR_CoordTrfPntUint16	SUCCESS
****088**** Testing SR_CoordTrfPntUint16	SUCCESS
****089**** Testing SR_CoordTrfPntUint16	SUCCESS
****090**** Testing SR_CoordTrfPntUint16	SUCCESS
****091**** Testing SR_CoordTrfPntUint16	SUCCESS
****092**** Testing SR_CoordTrfPntUint16	SUCCESS
****093**** Testing SR_CoordTrfPntUint16	SUCCESS
****094**** Testing SR_CoordTrfPntUint16	SUCCESS
****095**** Testing SR_CoordTrfPntUint16	SUCCESS
****096**** Testing SR_CoordTrfPntUint16	SUCCESS
****097**** Testing SR_CoordTrfPntUint16	SUCCESS
****098**** Testing SR_CoordTrfPntUint16	SUCCESS
****099**** Testing SR_CoordTrfPntUint16	SUCCESS
****100**** Testing SR_CoordTrfPntUint16	SUCCESS
****101**** Testing SR_CoordTrfPntUint16	SUCCESS
****102**** Testing SR_CoordTrfPntFlt		SUCCESS
****103**** Testing SR_CoordTrfPntFlt		SUCCESS
****104**** Testing SR_CoordTrfPntFlt		SUCCESS
****105**** Testing SR_CoordTrfPntFlt		SUCCESS
****106**** Testing SR_CoordTrfPntFlt		SUCCESS
****107**** Testing SR_CoordTrfPntFlt		SUCCESS
****108**** Testing SR_CoordTrfPntFlt		SUCCESS
****109**** Testing SR_CoordTrfPntFlt		SUCCESS
****110**** Testing SR_CoordTrfPntFlt		SUCCESS
****111**** Testing SR_CoordTrfPntFlt		SUCCESS
****112**** Testing SR_CoordTrfPntFlt		SUCCESS
****113**** Testing SR_CoordTrfPntFlt		SUCCESS
****114**** Testing SR_CoordTrfPntFlt		SUCCESS
****115**** Testing SR_CoordTrfPntFlt		SUCCESS
****116**** Testing SR_CoordTrfPntFlt		SUCCESS
****117**** Testing SR_CoordTrfPntFlt		SUCCESS
****118**** Testing SR_CoordTrfPntFlt		SUCCESS
****119**** Testing SR_CoordTrfPntFlt		SUCCESS
****120**** Testing SR_CoordTrfPntFlt		SUCCESS
****121**** Testing SR_CoordTrfPntFlt		SUCCESS
****122**** Testing SR_CoordTrfPntDbl		SUCCESS
****123**** Testing SR_CoordTrfPntDbl		SUCCESS
****124**** Testing SR_CoordTrfPntDbl		SUCCESS
****125**** Testing SR_CoordTrfPntDbl		SUCCESS
****126**** Testing SR_CoordTrfPntDbl		SUCCESS
****127**** Testing SR_CoordTrfPntDbl		SUCCESS
****128**** Testing SR_CoordTrfPntDbl		SUCCESS
****129**** Testing SR_CoordTrfPntDbl		SUCCESS
****130**** Testing SR_CoordTrfPntDbl		SUCCESS
****131**** Testing SR_CoordTrfPntDbl		SUCCESS
****132**** Testing SR_CoordTrfPntDbl		SUCCESS
****133**** Testing SR_CoordTrfPntDbl		SUCCESS
****134**** Testing SR_CoordTrfPntDbl		SUCCESS
****135**** Testing SR_CoordTrfPntDbl		SUCCESS
****136**** Testing SR_CoordTrfPntDbl		SUCCESS
****137**** Testing SR_CoordTrfPntDbl		SUCCESS
****138**** Testing SR_CoordTrfPntDbl		SUCCESS
****139**** Testing SR_CoordTrfPntDbl		SUCCESS
****140**** Testing SR_CoordTrfPntDbl		SUCCESS
****141**** Testing SR_CoordTrfPntDbl		SUCCESS
****142**** Testing Get/Set Reg			SUCCESS
****143**** Testing Get/Set Reg			SUCCESS
****144**** Testing Get/Set Reg			SUCCESS
****145**** Testing Get/Set Reg			SUCCESS
****146**** Testing Get/Set Reg			SUCCESS
****147**** Testing Get/Set IntegrationTime	SUCCESS
****148**** Testing Get/Set IntegrationTime	SUCCESS
****149**** Testing Get/Set IntegrationTime	SUCCESS
****150**** Testing Get/Set IntegrationTime	SUCCESS
****151**** Testing Get/Set IntegrationTime	SUCCESS
****152**** Testing SR_SetDualIntegrationTime	SUCCESS
****153**** Testing SR_SetDualIntegrationTime	SUCCESS
****154**** Testing SR_SetDualIntegrationTime	SUCCESS
****155**** Testing SR_SetDualIntegrationTime	SUCCESS
****156**** Testing Get/SetAmplitudeThreshold	SUCCESS
****157**** Testing Get/SetAmplitudeThreshold	SUCCESS
****158**** Testing Get/SetAmplitudeThreshold	SUCCESS
****159**** Testing Get/SetAmplitudeThreshold	SUCCESS
****160**** Testing Get/SetAmplitudeThreshold	SUCCESS
****161**** Testing Get/SetDistanceOffset	SUCCESS
****162**** Testing Get/SetDistanceOffset	SUCCESS
****163**** Testing Get/SetDistanceOffset	SUCCESS
****164**** Testing Get/SetDistanceOffset	SUCCESS
****165**** Testing Get/SetDistanceOffset	SUCCESS
****166**** Testing SR_SetAutoExposure		SUCCESS
****167**** Testing Non Ambiguity test		SUCCESS
****168**** Testing Non Ambiguity test		SUCCESS
****169**** Testing SR_Close			SUCCESS
-------------------------------------------------------
LibMesaSR_InterfaceTest Result: 169/169 passed, 0 skipped
-------------------------------------------------------
-------------------------------------------------------
CTestSRCustomer:
 1: TestBasic
 2: TestDataDump
 3: TestContinousAcquire
 4: TestUserSrvCmd
 5: TestTrial
----------------
x: exit

press a key

You should do the same to verify you can access your sensor and that your sensor is in good health.

Step 3 - Get the ROS driver for the SR4000/Compile it and run it

I had a bunch of issues finding the ROS driver for this sensor. I detail one dead-end to avoid at the end of this article.

I found a project which included the original swissranger_camera code written as part of the experimental camera drivers in older ROS versions. This was the OpenPTrack project which uses this sensor for tracking people. The git repository is here: https://github.com/OpenPTrack/open_ptrack.git

I cloned the git repository. Deleted all of the folders except the folder titled “swissranger_camera” (the only sub-package I want) and then compiled the source. At first it was failing to compile. This was due to the fact that the “cfg/SwissRanger.cfg” file did not have the executable flag set. After I set these flags the compile worked normally.

The commands are below assuming you start from your ROS workspace folder (for me “<proj>/ros_ws).

bash$ cd src
bash$ git clone https://github.com/OpenPTrack/open_ptrack.git
bash$ cd open_ptrack
bash$ rm -rf bayes detection docs open_ptrack opt_calibration opt_msgs opt_utils scripts tracking
bash$ chmod 755 cfg/SwissRanger.cfg
bash$ cd ../..
bash$ catkin_make

This finally compiled a ROS driver for this sensor! I then made a launch file to try the node. The launch file is below:

<?xml version="1.0"?>
<launch>

  <!-- start tof camera viewer -->
  <node pkg="swissranger_camera" type="swissranger_camera" name="swissranger_camera" cwd="node" respawn="false" output="screen">
	
  </node>

</launch>

Here's my run of the launch file:

arwillis@visionlab16-pc:~/NRC/ROS_RGBD_Odometry$ roslaunch rgbd_odometry test_sr4000_1.launch
... logging to /home.old/arwillis/.ros/log/bbfa604e-5e2d-11e5-b539-7071bc9c0f9e/roslaunch-visionlab16-pc-2598.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://visionlab16-pc:49069/

SUMMARY
========

PARAMETERS
 * /rosdistro: indigo
 * /rosversion: 1.11.13

NODES
  /
    swissranger_camera (swissranger_camera/swissranger_camera)

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

setting /run_id to bbfa604e-5e2d-11e5-b539-7071bc9c0f9e
process[rosout-1]: started with pid [2645]
started core service [/rosout]
process[swissranger_camera-2]: started with pid [2674]
[ INFO] [1442598624.057998817]: using default calibration URL
[ INFO] [1442598624.058107352]: camera calibration URL: file:///home.old/arwillis/.ros/camera_info/swissranger.yaml
[ INFO] [1442598624.058189690]: Unable to open camera calibration file [/home.old/arwillis/.ros/camera_info/swissranger.yaml]
[ WARN] [1442598624.058230734]: Camera calibration file /home.old/arwillis/.ros/camera_info/swissranger.yaml not found.
usb_set_debug: Setting debugging level to 255 (on)
usb_os_find_busses: Found 009
usb_os_find_busses: Found 008
usb_os_find_busses: Found 007
usb_os_find_busses: Found 006
usb_os_find_busses: Found 005
usb_os_find_busses: Found 004
usb_os_find_busses: Found 003
usb_os_find_busses: Found 002
usb_os_find_busses: Found 001
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 009
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 008
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 007
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 006
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 005
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 004
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 003
error obtaining child information: Operation not permitted
usb_os_find_devices: Found 018 on 002
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 004 on 002
skipped 1 class/vendor specific interface descriptors
skipped 1 class/vendor specific interface descriptors
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 002 on 002
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 002
error obtaining child information: Inappropriate ioctl for device
error obtaining child information: Operation not permitted
error obtaining child information: Operation not permitted
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 002 on 001
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 001
error obtaining child information: Operation not permitted
error obtaining child information: Operation not permitted

done.
[ INFO] [1442598624.108839312]: [SwissRanger device::open] Number of images available: 3
[ INFO] [1442598624.109300945]: [swissranger] Connected to device with ID: 3D-SR4000   
[ INFO] [1442598624.109344234]: [swissranger] libmesasr version: 1.0.14.748

Success!

I ran RViz to check the topics being published. In particular I displayed at the ”/swissranger_camera/distance/image_raw“ topic which shows distance as an image.

For me, the topics published were as follows:

/rosout
/rosout_agg
/swissranger_camera/camera_info
/swissranger_camera/confidence/image_raw
/swissranger_camera/confidence/image_raw/compressed
/swissranger_camera/confidence/image_raw/compressed/parameter_descriptions
/swissranger_camera/confidence/image_raw/compressed/parameter_updates
/swissranger_camera/confidence/image_raw/compressedDepth
/swissranger_camera/confidence/image_raw/compressedDepth/parameter_descriptions
/swissranger_camera/confidence/image_raw/compressedDepth/parameter_updates
/swissranger_camera/confidence/image_raw/theora
/swissranger_camera/confidence/image_raw/theora/parameter_descriptions
/swissranger_camera/confidence/image_raw/theora/parameter_updates
/swissranger_camera/distance/image_raw
/swissranger_camera/distance/image_raw/compressed
/swissranger_camera/distance/image_raw/compressed/parameter_descriptions
/swissranger_camera/distance/image_raw/compressed/parameter_updates
/swissranger_camera/distance/image_raw/compressedDepth
/swissranger_camera/distance/image_raw/compressedDepth/parameter_descriptions
/swissranger_camera/distance/image_raw/compressedDepth/parameter_updates
/swissranger_camera/distance/image_raw/theora
/swissranger_camera/distance/image_raw/theora/parameter_descriptions
/swissranger_camera/distance/image_raw/theora/parameter_updates
/swissranger_camera/distance/image_raw16
/swissranger_camera/distance/image_raw16/compressed
/swissranger_camera/distance/image_raw16/compressed/parameter_descriptions
/swissranger_camera/distance/image_raw16/compressed/parameter_updates
/swissranger_camera/distance/image_raw16/compressedDepth
/swissranger_camera/distance/image_raw16/compressedDepth/parameter_descriptions
/swissranger_camera/distance/image_raw16/compressedDepth/parameter_updates
/swissranger_camera/distance/image_raw16/theora
/swissranger_camera/distance/image_raw16/theora/parameter_descriptions
/swissranger_camera/distance/image_raw16/theora/parameter_updates
/swissranger_camera/intensity/image_raw
/swissranger_camera/intensity/image_raw/compressed
/swissranger_camera/intensity/image_raw/compressed/parameter_descriptions
/swissranger_camera/intensity/image_raw/compressed/parameter_updates
/swissranger_camera/intensity/image_raw/compressedDepth
/swissranger_camera/intensity/image_raw/compressedDepth/parameter_descriptions
/swissranger_camera/intensity/image_raw/compressedDepth/parameter_updates
/swissranger_camera/intensity/image_raw/theora
/swissranger_camera/intensity/image_raw/theora/parameter_descriptions
/swissranger_camera/intensity/image_raw/theora/parameter_updates
/swissranger_camera/parameter_descriptions
/swissranger_camera/parameter_updates
/swissranger_camera/pointcloud2_raw
/swissranger_camera/pointcloud_raw
arwillis@visionlab16-pc:~/NRC/ROS_RGBD_Odometry$ 

Don't Try the cob_driver Package

In my research I found that this sensor is offered as part of the sensor package for the Care-O-bot. This bot has a suite of packages in ROS (having the cob prefix generically). I initially tried to get the driver from this package suite. I found it exceedingly difficult and I detail below my process.

It turns out that the driver is now packaged as part of the “cob_driver” package (in the “cob_camera_sensors” sub-package). I first installed this package and several “ros-indigo-cob-XXXX” dependencies (I can't recall all of them – since this is a dead-end I won't go into detail).

bash$ sudo apt-get install ros-indigo-cob-driver

I then tried to find out how initiate the node that would access the sensor and publish data from the sensor. I could not find any way to pull the data from the installed package. Dead-end 1.

Next, I decided to download the source from the git repository at:

https://github.com/ipa320/cob_driver.git

In my ROS workspace source (for me ”<proj>/ros_ws/src“) folder I issued this command:

bash$ git clone https://github.com/ipa320/cob_driver.git

I then did a clean build. From the ROS workspace folder (for me ”<proj>/ros_ws“) I did the following: CAREFUL – I am deleting the folders “build” and “devel” in the commmand below.

bash$ rm -rf build devel
bash$ catkin_make

This worked OK for me but unfortunately the driver for the SR4000 was not built. As far as I can tell, the package “cob_camera_sensors” has a node in it with the name “tof_camera_viewer”. This did not get built so I had no way to know how to access the SR4000. This was dead-end 2 and the end of my time with the “cob_driver” package. I did read some about this software but these packages seem empty and their structure is not standard ROS. Very confusing…. who's got time for that?

using_the_mesa_sr4000_with_ros_indigo.txt · Last modified: 2016/05/18 11:03 by arwillis