Re: [ros-users] camera1394 and swissranger

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Patrick Beeson
Date:  
To: Radu Bogdan Rusu, ros-users
Subject: Re: [ros-users] camera1394 and swissranger
OK. The libMesa headers lead me to believve that (at least some) sr3k
devices will return 3 images. I'll change this part of the code.

Radu Bogdan Rusu wrote:
> Patrick,
>
> You could just comment out the "(inr_ < SR_IMAGES)" and that should work. The 3000 model only outputs 2 images, while
> the 4000 outputs 3. Additionally you could just check the camera type (there's a string that you can parse). In my code
> I was checking inr_ < 1, as that was definitely an error :)
>
> Cheers,
> Radu.
>
> Patrick Beeson wrote:
>> Dejan,
>>
>> Now that you have the new libmesa drivers installed, try running
>> /usr/bin/libMesaSRTester. Choose Basic test, then 'scan', and it should
>> find your device and let you press '2' to choose it and test it. If it
>> doesn't work due to permissions not being set right, you can try running
>> it using 'sudo'
>>
>> If it doesn't find your camera, then I'd suggest manually downloading
>> the Beta libmesa .deb from the web and installing that instead of the
>> .deb that gets manually installed by my program. Running
>> libMesaSRTester successfully is a prerequisite to having my driver work,
>> and will often flash the firmware to get the device in a state to talk
>> to the new API.
>>
>> Also , the install of the libmesa drivers added a udev rule in
>> /etc/udev/rules.d/46-mesa.rules. Unfortunately, Mesa decided to make
>> the device have group usb. You can edit that file to change it to group
>> plugdev (then sudo /etc/init.d/udev restart). Unplug and plug the usb,
>> and it should work without having to fiddle with permissions every time.
>>
>> If all that works, try again. If you get the same problems with my
>> software, read below...........
>>
>> It looks like for some reason, the sr4k is ignoring the CONF_MAP flag to
>> return confidences. A quick solution you can try is to simply go into
>> the header and change SR_IMAGES to 2. I was going to make this stuff
>> into runtime configuration in the future, but of course when I don't
>> have an sr3k to work with it makes large development changes problematic.
>>
>> Perhaps the first change above along with getting a license file (I
>> didn't have to do this with the sr4k, but I'm assuming this might be a
>> common practice with the sr3k users) might allow this to work? Please
>> try it and let me know if it still is receiving 4 1x1 images.
>>
>> If so, it might be worth downloading the older 'swissranger' ros node,
>> which uses the old libusb driver Mesa which can be found on their
>> download site in the drivers archive. If that works, then I'll have to
>> compare the source code between the two nodes -- they are already VERY
>> similar.
>>
>>
>>
>>
>>
>>
>> Dejan Pangercic wrote:
>>> Hi Patrick,
>>> I finally got to test the driver with a SR3K device on a 64bit machine
>>> running Ubuntu 9.10.
>>> I could not get it pass following structure in dev_sr4k.cpp file:
>>> "
>>>  if ( (cols_ != SR_COLS) || (rows_ != SR_ROWS) ||
>>>        (inr_ < SR_IMAGES) || (imgEntryArray_ == 0) )
>>>     {
>>>       SafeCleanup();
>>>       SR_EXCEPT_ARGS(sr4k::Exception,
>>>                      "Invalid data images: %d %dx%d images received
>>> from camera!\n Expected %d %dx%d images.",
>>>                      inr_, cols_, rows_, SR_IMAGES, SR_COLS, SR_ROWS);
>>>       return (-1);
>>>     }
>>> "

>>>
>>> After running the "roslaunch launch/sr4k.launch" command it outputs
>>> the following exception:
>>> "
>>> [ INFO] [1270556935.964286581]: [SwissRanger device::open] Number of
>>> images available: 2
>>> [ERROR] [1270556935.964498968]: Exception thrown while connecting to the camera:
>>> [SR4K::open]: Invalid data images: 2 176x144 images received from camera!
>>> Expected 3 176x144 image
>>> "
>>> And after running the command again then this one (funnily this
>>> behavior then keeps going on this alternative way):
>>> "
>>> libMesaSR:libMesaSR:camera config file has no licence Information!
>>>
>>> libMesaSR:libMesaSR:CMesaDevice::Read:usb_bulk_read failed!
>>> Request:0xb0 RequestType:0x40 Requested Size: 64 Received
>>> Size(Result): -110
>>>
>>> libMesaSR:libMesaSR:CMesaDevice::Read: did not get requested bytes: 64<->0
>>>
>>> libMesaSR:libMesaSR:CMesaDevice::Read:usb_bulk_read failed!
>>> Request:0xb0 RequestType:0x40 Requested Size: 64 Received
>>> Size(Result): -110
>>>
>>> libMesaSR:libMesaSR:CMesaDevice::Read: did not get requested bytes: 64<->0
>>>
>>> libMesaSR:libMesaSR:CMesaDevice::Read:usb_bulk_read failed!
>>> Request:0xb0 RequestType:0x40 Requested Size: 64 Received
>>> Size(Result): -110
>>>
>>> libMesaSR:libMesaSR:CMesaDevice::Read: did not get requested bytes: 64<->0
>>>
>>> [ INFO] [1270556651.295522746]: [SwissRanger device::open] Number of
>>> images available: 4
>>> [ERROR] [1270556651.295721863]: Exception thrown while connecting to the camera:
>>> [SR4K::open]: Invalid data images: 4 1x1 images received from camera!
>>> Expected 3 176x144 images.
>>> "
>>> It looks like "SR_GetImageList" function is not doing what it is supposed to...
>>>
>>>
>>> Furthermore I had some problems opening the device node at the
>>> beginning since on my machine (default ubuntu setting) all the nodes
>>> in /dev/bus/usb/ are owned by root user and root group. The remedy for
>>> that was to first find the bus and the device number and second to put
>>> the node in the plugdev group: "sudo chown root:plugdev
>>> /dev/bus/usb/bus_nr/device_nr".
>>>
>>> Lastly, at the first run I got the following warning:
>>> "
>>> Please download manually the file
>>> www.mesa-imaging.ch/customer/calibData/camData00019e13.xml and save it
>>> to /usr/share/libmesasr/camData00019e13.xml
>>> libMesaSR:libMesaSR:can not parse camera config file
>>> '/usr/share/libmesasr/camData00019e13.xml'!
>>> "
>>> Following the hint got me rid of the warning.
>>>
>>> Hope this report helps a bit,
>>> cheers, D.
>>>
>>> On Wed, Mar 31, 2010 at 5:57 PM, Patrick Beeson <> wrote:
>>>> I have added a new sr4k package to the camera_drivers_experimental
>>>> stack. This extends the swissranger package in the tum repository to
>>>> handle the newer Mesa Imaging libraries, and supports both SR3000 and
>>>> SR4000 devices.
>>>>
>>>> I do not have an SR3K device, so I could only test with an SR4K, but the
>>>> API is the same for both (an early calls tells the Mesa libraries which
>>>> device you want to talk to and differences are handles at the Mesa
>>>> library level).
>>>>
>>>> I have not yet included a standalone viewer, but users can view the
>>>> output in rviz. The current frame id is the node name (defaults to
>>>> /sr4k). The user can view Image and PointCloud types. There are 3 2D
>>>> images, distance, intensity, and confidence.
>>>>
>>>> Patrick Beeson
>>>>
>>>> _______________________________________________
>>>> ros-users mailing list
>>>>
>>>> https://code.ros.org/mailman/listinfo/ros-users
>>>>
>>>
>> _______________________________________________
>> ros-users mailing list
>>
>> https://code.ros.org/mailman/listinfo/ros-users
>