Ask Your Question
0

Creating an RViz Plugin with animations

asked 2014-04-07 12:04:20 -0500

aespielberg gravatar image

Hi all,

First of all, Ubuntu 64 bit 12.04 Hydro.

I'm trying to make an RViz plugin with animations. To get started, I modified the code from the tutorial:

http://docs.ros.org/hydro/api/rviz_pl...

If I try to do some sort of "animation" though, by creating a marker, sleeping, updating the marker, sleeping, etc., this doesn't cause anything to render. I'm guessing that this is because I'm making the entire RViz system sleep, so it can't update.

In order to get around this, for each incoming message, I fire off a thread tahtthen is in charge of painting for this thread. Unfortunately, this has led to numerous graphical glitches - and after the first one, it fails to paint for subsequent loops.

So much is abstracted away from the user in these plugins (it's actually extremely frustrating!) that I really do not have a good grasp on how the painting occurs. And there is little to no documentation on these things.

I'm looking for an explanation as to how the painting actually occurs, and possibly a suggestion on how to do animations correctly?

edit retag flag offensive close merge delete

Comments

Hi, this question is old, but can I check what is the solution to this? I want to create animation in RViz plugin as well, and bumped into similar problem if I used the update-sleep-update-sleep-... approach. RViz would only show the last published markers. Thank you very much.

Audi gravatar image Audi  ( 2016-06-17 07:51:24 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-04-07 13:12:32 -0500

ahendrix gravatar image

I think you can inherit directly from the rviz::Display class, and override the void update(float wall_dt, float ros_dt) method to do your own drawing every time rviz does a drawing cycle. You should be able to use that to do your own animation.

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

1 follower

Stats

Asked: 2014-04-07 12:04:20 -0500

Seen: 348 times

Last updated: Apr 07 '14