Ask Your Question
1

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

Comments

2

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
0

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 50 times

Last updated: Nov 12 '15