Ask Your Question
1

Buffer size or repaint in RViz

asked 2011-11-04 11:12:25 -0500

bbuecheler gravatar image

updated 2011-11-05 06:45:32 -0500

kwc gravatar image

Hi... I try to draw the whole path of my robot with rviz. But everytime I publish a new path message, the old path gets deleted. Is there a better way to do this. Or do I have to create my own "vector" and repaint it everytime? Thanks in advance!

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
0

answered 2012-01-10 02:30:00 -0500

Benoit Larochelle gravatar image

The way that I find the easiest is like suggested: creating your own "vector" and "repainting" it.

In fact, a Path is simply a collection of Poses. Normally, only one path is displayed; therefore, if you send a new one, whatever was displayed before gets erased. So, you can create one path object locally, and keep adding new points to it.

Here is a skeleton of an algorithm that should do what you want:

nav_msgs::Path pathMsg;

while (node.ok())
{
    ros::spinOnce();

    geometry_msgs::PoseStamped poseMsg;

    // Fill the poseMsg with whatever pose you want (the point on your path)

    pathMsg.poses.push_back(poseMsg);

    pathPublisher.publish(pathMsg);

    // Waits a little before adding another pose to the path
    rate.sleep();

} // end loop
edit flag offensive delete link more
0

answered 2012-01-10 03:38:41 -0500

updated 2012-01-10 03:39:12 -0500

You can use the hector_trajectory_server package. The hector_trajectory_server node listens to tf given a source and target frame and records the received poses with a update rate that can be specified by a parameter. The saved trajectory gets published on a topic with a parametrizable interval and can also be retrieved via a service.

edit flag offensive delete link more
0

answered 2011-11-07 00:23:02 -0500

bbuecheler gravatar image

Alright... I guess the answer is somewhat like that: If one wants the path to stay over time, one should use either point clouds or odometry.

edit flag offensive delete link more
0

answered 2011-11-16 09:13:44 -0500

tfoote gravatar image

updated 2011-11-16 09:15:27 -0500

You can set the decay time significantly higher in rviz for the path display.

If you're using Markers they have IDs which allow you to either overwrite them or supplement.

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

Stats

Asked: 2011-11-04 11:12:25 -0500

Seen: 573 times

Last updated: Jan 10 '12