wrong values on Hokuyo laserscan topic

asked 2015-04-10 04:36:44 -0600

gnamoir gravatar image

updated 2015-04-14 09:46:14 -0600

Hi all,

I have a Hokuyo laser in my system, launched with hokuyo_node.

 <launch>
<node pkg="hokuyo_node" type="hokuyo_node" name="orange_hokuyo" output="screen">

<rosparam>
publish_intensity: false
min_ang: -2.2689
max_ang: 2.2689
cluster: 1
skip: 0
port: /dev/ttyACM0
frame_id: laser
calibrate_time: true
time_offset: 0.0
publish_multiecho: false
measurement_step: 1080
</rosparam>      
<remap from="scan" to="orange_scan"/>
</node>

</launch>

I can check that every measure is ok doing:

rostopic echo /orange_scan > /home/user/Documents/orange.txt

However, when I subscribe my node to the topic some measures don't match with the measures saved in the file. I'm doing:

ros::Subscriber sub = nh.subscribe<sensor_msgs::LaserScan>("orange_scan",1, cb_orange);

and

void cb_orange(const sensor_msgs::LaserScanConstPtr& scan){ 
    sensor_msgs::LaserScan m;
    m=*scan;
    for(int i=0; i<1080; i++){
       m.ranges[i];  // here I get wrong measures
       /* my stuff */
    }
 }

Testing the hokuyo in an environment with distances lower than 10 meters, my node gets values bigger than 10 meters (even more it gets out of range values). These wrong measures never appear in the file orange.txt. Why??

edit retag flag offensive close merge delete