ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

need to publish LaserScan topic

asked 2013-07-03 00:43:46 -0500

noob_coder gravatar image

updated 2014-01-28 17:17:08 -0500

ngrennan gravatar image

Hello,

I am using NAO robot right now. And I need to get the laser data, but the current NAO stack doesn't provide that. The NAO that I use is NAO with laser head. The laser is Hokuyo URG-04LX.

I want to create node which publish LaserScan topic that I get from NaoQi SDK. From the NaoQi, I can get this information : - Min/Max Degree - Min/Max Distance - Array of Distance (size about : +/- 700)

Can I use that information to create the node that publish LaserScan topic ? If yes, can someone provide me the example of Hokuyo URG-04LX laser header, angle_increment, etc ?

If it is possible, I also want the example from the Hokuyo URG-04LX in the *.bag file.

Thank you :)

Update : thanks to the comment, I already can get the information via NaoQi SDK.

I put my code here, in case someone want to use it.

https://gist.github.com/rexcoder21/5957465

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
4

answered 2013-07-04 04:02:04 -0500

allenh1 gravatar image

You shouldn't have to use the NaoQi SDK. Hokuyo lasers are very well supported in ROS, due to their popularity. You can find documentation for the Hokuyo node here. To use it, do the following:

rosrun hokuyo_node hokuyo_node /dev/ttyACM0

If there are permission errors, run the below command and try the above again.

sudo chmod 777 -R /dev/ttyACM0

However, if you are interested in writing your own driver (understandable, for it's a good exercise), you need to publish the laser inside a sensor_msgs/LaserScan message.

In order to do so, you will need to fill in the header with the current ROS time and frame_id (probably laser).

You will need to fill in the angle_min and angle_max with the start and end angles of the scan with respect to the positive Z-axis. You will need to include the angle_increment and scan_time (time between scans).

Then, you will need to set the range_min and range_max to the shortest measurable distance and largest measurable distance respectively.

The next container is the ranges array. Fill the array with each individual range measurement from angle_min to angle_max. Then, the intensities (if provided). If your laser does not have intensities, then you may omit this array.

Best of luck!

edit flag offensive delete link more

Comments

I see... but from the SDK I just can get this info : - min degree & max degree - min distance & max distance - ranges array I don't know how to get the other information that I need to publish my own laser. Btw, I can't open NAO head to access hokuyo. They didn't give me the permission :(

noob_coder gravatar image noob_coder  ( 2013-07-04 16:47:46 -0500 )edit

I think you can get pretty much all that info from the datasheet of your laser, the most important thing that you need are the ranges array, which contain the actual measurements. the other fields are all static.

Procópio gravatar image Procópio  ( 2013-07-04 22:28:53 -0500 )edit

I have all the deatils.. How do I publish all of them together!?

gaussian gravatar image gaussian  ( 2015-02-06 13:34:41 -0500 )edit
0

answered 2015-05-06 21:22:12 -0500

heromoga2000 gravatar image

Hi I am facing same problem and I wana perform slam on nao using laser scan on head so please is the code still available ? how you slove the problem ? thanks

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-07-03 00:43:46 -0500

Seen: 1,550 times

Last updated: May 06 '15