Wednesday, December 14, 2011

URG-04LX-UG01 problems and solutions

Recently our group got a urg laser which has a usb connector. It took me about two days to figure following problems out:
 
1. Power. The laser comes with a dual usb connector. From the urg website, it says the urg needs two usb port to get enough power (>500mA). I have tried every pairs of usb port. Neither of them work. The possible reasons are: the laser is damaged, the cable doesn't work, or the power from pc usb is not enough. I simply use a single usb connector from my mp3 to replace the dual usb port, then the laser is surprisingly working!! What can I say. Dual port don't work, single port works fine! If you have similar problem, then you can try this solution.

2. Library. Now the laser can work well with XP system after installing the driver. However, the library got some problems when I compile them, such as can no reference to 'floor'. I google the solutions and find one nice patched urg library which works fine for Ubuntu oneiric: http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/oneiric/urg/oneiric/revision/4?start_revid=4 You can download the tarball of the urg library and compile it. That works great on my ubuntu machine.

3. Urg program samples. The sample programs also get some problems, such as "undefined reference to" blabla. The solution is very simple: rewriting the Make file (for C++ urg_sample) as : CXXFLAGS = -g `urg-config --cflags` `sdl-config --cflags` LDFLAGS = `urg-config --libs` `sdl-config --libs` LDLIBS = -lc gdScanSample: gdScanSample.cpp g++ -o gdScanSample gdScanSample.cpp $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) clean : $(RM) *.o $(TARGET) .PHONY : all clean


Now, everything works perfectly. Enjoy!

No comments: