Hokuyo Laser Scanner Support

I recently acquired a Hokuyo UTM-30LX laser range finder: hokuyo-aut.jp/02sensor/07sca … /utm-30lx/

I know there’s already a CHOP for the Leuze ROD4, so my hope is that the road to support for the Hokuyo UTM-30LX is already partially paved. I’d love to help develop this with Derivative if anyone is interested in helping me make it happen.

Hokuyo provides a lot of source code examples for their laser range finders, so I’m thinking this might be a good place to start: urgnetwork.sourceforge.net/html/

There’s also a document that explains the range finder’s communication protocol, so maybe I can just parse the raw data streaming over USB? Here’s the protocol: hokuyo-aut.jp/02sensor/07sca … SCIP20.pdf

Would love to hear anyone’s thoughts on this.

I’m interested to hear about your experience with the Hokuyo. They seem to be quite a bit cheaper than the Leuze products.

Hi
I also interested in Hokuyo laser range finder function in TD.
I usually use this sensor using with another software.
And it send sensor data as OSC to TD.

If we can use native Hokuyo node in TD, It is very useful.
Derivative think that,
if more user have request about Hokuyo node. They can provide it.

That’s awesome to hear that you’ve sent data from the Hokuyo to Touch via OSC before. Would you be willing to share your approach to achieve OSC out with the Hokuyo? It might help me work out a native Touchdesigner solution.

I dug back into this today to build an alternative solution.

First I tried OSC, but it didn’t seem to have low enough latency with this much data being sent, so I switched to writing an external command-line application to read the Hokuyo sensor, then send the values to Touchdesigner via shared memory (derivative.ca/wiki088/index … emory_CHOP).

It isn’t the most elegant solution, but it seems to be lower-latency than OSC.

Here’s my Visual Studio 2017 solution if anyone is interested! It’s not the cleanest code ever, but seems to work well:
urg_library-sharedMemToTouch.zip (18.4 MB)

Once compiled, run “get_distance.exe” from the command line followed by your desired memory address name as the first argument, then “-s COM1” (or whatever COM port your Hokuyo is on).

Example: get_distance.exe myMemoryAddress -s COM1

Then create a Shared Mem In CHOP in Touch, and type in the memory address name you ran the program with.

Hope this helps some people out! Eventually it’d be awesome to have this in a CPlusPlus CHOP .dll, but this seems to work in the meantime.

Also, Derivative Admins - I’m not sure if posting source code from the Shared Mem examples is ok on the forums, let me know if it’s not and I’ll remove.

It’s perfectly fine, thanks for sharing!

Hello,

Do you think that would work with this model ?
robotshop.com/en/hokuyo-ust- … inder.html

Thanks

Mathieu

Hi, Does anybody try this solution? I´m getting the next error when I try to execute the program:

“error detaching memory
closing urg driver
exiting”

I appreciate your help :smiley:

If you’re looking to use a Hokuyo device in TouchDesigner you should have a look at the Hokuyo CHOP in 099.

I´ve already tried this CHOP, but it doesn´t detect the sensor and I have to move around the start step parameters.

Also when I open again my toe file, nothing happens. I,ve already tested the sensor with Urg_Benri software and everything looks fine.

Looks like a software trouble.

Hi PiveJuma23,

Hmm, I haven’t seen that error, very strange. Can you run the .exe from visual studio in debug mode to get more info on what’s happening?

To be frank, I abandoned that .exe I built when the Hokuyo CHOP came out in 099 - but I also haven’t tried the Hokuyo CHOP with USB Hokuyos, just ethernet versions. If I have a second I’ll try to reconnect my old UTM-30LX and see if it works with the Hokuyo CHOP.

Which Hokuyo device do you have? If it’s serial, do you have the correct serial port selected? Also make sure UrgBenri isn’t connected at the same time.

Hi again folks!
Sorry for the lately answer.

In the case of the Shared Memory solution, I figured out what was the problem (it was about my Visual Studio setup for compiling all the solution), however, I don´t know if it´s working correctly, I´m only getting one channel.

By the other hand, I´m working with Hokuyo UTM-30LX via USB, I have the correct serial port selected and UrgBenri isn´t connected. I have to move start step paramater to make it work.

Thanks a lot! and it would be amazing to know if you´re having the same issue with your Hokuyo. :slight_smile:

I attached some screenshots of both problems…



Changing the step parameters will send out a new stream command to the device so the problem is probably that the device is not receiving the first stream command sent. Turning active off then on should also work to send another command.

I’ll fix this for the next official build by having it send another command if the first did not work.

I´ve already try turning off to on, and nothing happens :frowning: but I´ll keep trying with Shared Mem.

Thanks for the attention :slight_smile:

Hey PiveJuma - nice work getting it to compile and run! I’m sorry the code isn’t pretty; makes me realize how badly I need to comment…

I believe that just one channel is correct though - it’s outputting the distance of each point, which you can convert to XY coordinates. If I can find the .toe that I made to convert it I’ll post.

However, I highly recommend trying to get the Hokuyo CHOP to work if possible! Derivative definitely have a much more robust solution in there, and running an external exe is a hassle (and my scary code scares me). And it converts to XY for you in the CHOP.

Hey!!

Hokuyo CHOP is working perfectly fine!

Thanks for the attention b34npour and eric.b!!

Cheers!!

I’ve just started playing with one of these. How are you using the data? my hope was to make a touch screen type system, but im having trouble making sense of the data coming out of the Hokuyo Chop.

Any tips on how to make the polar/Cartesian info more useful?

1 Like