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

Why would a LaserScan topic produce different results inside code?

asked 2015-11-08 14:35:42 -0500

Goldeelocks gravatar image

I'm running a turtlebot simulation, and when I use rostopic echo /scan I get a huge array of ranges, but when my subscriber gets it, I only find 24 elements. I've verified that the subscriber is set to /scan, and it seems to reliably get the first 24 every time, but I'd estimate that there are supposed to be about 500 points. What could cause this?

edit retag flag offensive close merge delete



can you post the code you are using in your subscriber ?

nickw gravatar image nickw  ( 2015-11-09 01:01:40 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-11-12 15:48:04 -0500

Goldeelocks gravatar image

The problem here was that I misunderstood the data type that was being used. I was using sizeof(msg), expecting it to be an array, when it was in fact returning a vector and the correct term to use was msg.size().

edit flag offensive delete link more

Question Tools



Asked: 2015-11-08 14:35:42 -0500

Seen: 99 times

Last updated: Nov 12 '15