Ask Your Question
3

How to display more than 10 Range's in rviz?

asked 2012-04-25 12:28:37 -0600

Dereck gravatar image

I am fixing up the p2os stack for P3-AT Pioneers and have made quite good progress. I am currently working on displaying the ultrasonic range finder data in rviz but rviz refuses to display more than 10 range objects simultaneously and am stuck as to the reason.

I am following the method outlined in http://www.ros.org/wiki/rviz/DisplayTypes/Range for displaying an array of range finders by publishing a TF in the URDF called sonar_1 ~ sonar_16 and then publishing a set of sensor_msgs::Range measurements for each sonar unit with the .header.frame_id = "sonar_1" ~ "sonar_16".

using rostopic echo I was able to verify all sonar data is being published for each unit. in rviz I can see that all of my tf's are displayed on the robot in the correct location.

If I change my code to send the front half of the robot's sonar units it works fine, and then when I change it to send the rear half it works fine. I can even have it send the right or left side's data and rviz has not problems displaying.

Any measurement after 10 simply is ignored, regardless of the fact my 'Buffer Length' in rviz is set to 16.

Thank you very much for your help. When I have finished I hope that my modifications will be approved by the p2os maintainers so nobody needs to do this again. :)

Screenshot: http://imagebin.org/209746 Test Code: http://pastebin.com/wZJx4ard

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-04-25 17:32:03 -0600

Chad Rockey gravatar image

The issue that you're seeing is caused by the tf message filter queue size in RVIZ. It probably won't surprise you to find out that the value was set to.... 10! What's happening is that your range measurements are coming in (likely with the same or close timestamps) before RVIZ gets a tf update to project them into your fixed frame. This means that only the last 10 are being kept around and the others are pushed out of the queue.

You have two ways to fix this: Use Fuerte! The good news is that this issue was resolved by this ticket in the new RVIZ for Fuerte. You should be able to just adjust the queue size parameter in the GUI and all will be well.

If you can't update to Fuerte, I would recommend splitting your rangers into two different topics. You should be able to something like '/sonar/left_array' and '/sonar/right_array'. By drawing these as two separate queues, you're effectively doubling the queue size.

edit flag offensive delete link more

Comments

I was considering upgrading so I guess I best get on the Fuerte bandwagon. Thanks!

Dereck gravatar imageDereck ( 2012-04-26 07:40:53 -0600 )edit

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2012-04-25 12:28:37 -0600

Seen: 799 times

Last updated: Apr 26 '12