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!
Originally posted by allenh1 with karma: 3055 on 2013-07-04
This answer was ACCEPTED on the original site
Post score: 4
Original comments
Comment by noob_coder on 2013-07-04:
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 :(
Comment by Procópio on 2013-07-04:
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.
Comment by gaussian on 2015-02-06:
I have all the deatils.. How do I publish all of them together!?