Ask Your Question
2

How to control rviz view parameters programatically?

asked 2016-08-08 14:41:19 -0500

updated 2016-08-08 14:42:59 -0500

I would like to control the rviz view parameters programatically from an external node, for instance: Set the view type to topDownOrtho and set the scale parameter to 10 and angle to 3.14.

I guess that this is possible to control these parameters using the rviz.h library , but what I essentially wonder is if there is something already developed to control rviz from an external node via topics.

Otherwise, how would you develop a system that it is able to control these parameters from a python node?

edit retag flag offensive close merge delete

Comments

There are some view controllers for rviz which either track a frame or are controllable from data published on a ROS topic. I don't know the details, but most of them are packaged as rviz plugins outside of the stock rviz package.

ahendrix gravatar image ahendrix  ( 2016-08-08 14:59:34 -0500 )edit

Interesting, I will check it

Pablo Iñigo Blasco gravatar image Pablo Iñigo Blasco  ( 2016-08-08 15:08:10 -0500 )edit

2 Answers

Sort by » oldest newest most voted
1

answered 2016-08-08 15:35:18 -0500

gvdhoorn gravatar image

You can probably use the rviz_animated_view_controller for this.

edit flag offensive delete link more

Comments

This looks promising. I will try it and I will notify how it works.

Pablo Iñigo Blasco gravatar image Pablo Iñigo Blasco  ( 2016-08-09 12:03:19 -0500 )edit
0

answered 2018-11-05 07:07:26 -0500

Razlaw gravatar image

I essentially wonder is if there is something already developed to control rviz from an external node via topics

Yes, there is.
I recently released an rqt plugin, called Rviz Cinematographer, to control the camera within rviz to create smooth camera trajectories for visualizations.
You could add the functionality by extending my plugin, sending your controls and parameters via msgs to the rviz_animated_view_controller, which applies the changes to the rviz view.

Unfortunately, at least to my knowledge, there is no official rviz_animated_view_controller for ros kinetic and newer versions.
I'v adapted an inofficial rviz_animated_view_controller fork for kinetic to fit my needs.

edit flag offensive delete link more

Comments

I like your work very much, but I'm wondering whether the custom version of rviz_animated_view_controller was really needed.

gvdhoorn gravatar image gvdhoorn  ( 2018-11-05 07:12:10 -0500 )edit

My goal was to create and edit trajectories. Using the old msgs and how they were handled by the rviz_animated_view_controller didn't allow to create trajectories consisting of several poses. The camera would've moved from pose to pose stopping at each. So for my purposes it seemed necessary, to me.

Razlaw gravatar image Razlaw  ( 2018-11-05 07:21:02 -0500 )edit

So for my purposes it seemed necessary, to me.

Then I would suggest to rename the pkg that you forked, as right now your adapted version and the regular one cannot be used at the same time, or placed in the same workspace.

gvdhoorn gravatar image gvdhoorn  ( 2018-11-05 07:22:58 -0500 )edit

Or better yet: contribute your changes upstream. That way no forking may be necessary, which would be better for everyone in the long run.

gvdhoorn gravatar image gvdhoorn  ( 2018-11-05 07:23:28 -0500 )edit

There was a misunderstanding. The fork that enabled to run the view controller with kinetic (my second link) wasn't done by me. Their changes should be contributed. But you're right that I should rename my adapted version of their fork, since it's not downward compatible.Thanks for liking my work :)

Razlaw gravatar image Razlaw  ( 2018-11-05 07:47:05 -0500 )edit

No, there is no misunderstanding:

  • yes, the kinetic changes should be PR-ed and merged (there is already a PR for Qt5 though), but:
  • your changes might also be nice to have upstream. That would also remove the need for your fork
gvdhoorn gravatar image gvdhoorn  ( 2018-11-05 07:49:44 -0500 )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: 2016-08-08 14:41:19 -0500

Seen: 544 times

Last updated: Aug 08 '16