ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Change focal point in Rviz automatically

asked 2015-12-07 10:11:41 -0600

Jay4Ros gravatar image

Hello!

I believe the focal point of a view in Rviz is the point the camera rotates around. How can I set the values for the focal point automatically? Say I have a node which is publishing the center of mass of a point cloud and I want my view in Rviz to rotate around that point - how can that be achieved?

Thanks! Jay

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-12-07 13:14:40 -0600

gvdhoorn gravatar image

updated 2015-12-08 03:01:09 -0600

See if the rviz_animated_view_controller package offers what you need.


Edit:

Are there examples in C++?

No, there are not, afaik. But this is all really basic msg publication, so should be trivial to re-create in other languages.

Once I publish cameraPlacement messages - how can I tell Rviz to deal with them accordingly?

From the wik page on rviz_animated_view_controller:

This package provides an RViz view controller plugin [..]

This particular view controller shows up in the drop-down list in the Views Panel in RViz.


Edit 2: from the RViz User Guide I linked, it appears you might also be able to achieve what you want by publishing a TF frame at the location of the CoM and by selecting the Third Person Follower camera, but I can't find that anymore in recent RViz versions. I doubt it will also automatically rotate around the frame though.

edit flag offensive delete link more

Comments

Thanks! I have installed the package and had a look at the examples. I believe I could achieve what I am looking for by setting the focus point. 1. Are there examples in C++? 2. Once I publish cameraPlacement messages - how can I tell Rviz to deal with them accordingly?

Jay4Ros gravatar image Jay4Ros  ( 2015-12-08 02:22:30 -0600 )edit

Thanks! I have written a publisher, publishing on a topic with message type view_controller_msgs::CameraPlacement. But this topic does not show under the "Type" field in Rviz View Panel. If I start CameraTest from the examples, nothing happens as well. What am I missing?

Jay4Ros gravatar image Jay4Ros  ( 2015-12-08 06:39:23 -0600 )edit
1

A topic is never supposed to 'show up', it will only interact with the view controller plugin. If you've installed things correctly, you should find an Animated item in the Type drop down of the Views panel.

gvdhoorn gravatar image gvdhoorn  ( 2015-12-08 06:54:33 -0600 )edit

Ah, restarting Rviz did the trick. Setting the focus point works, however, "eye" gets set all the time as well. This is counterintuitive unfortunately, because things like zooming by the user are senseless now :( How can I set eye to the value the user specified?

Jay4Ros gravatar image Jay4Ros  ( 2015-12-08 07:34:50 -0600 )edit

I'm not an expert user of this pkg, I just suggested it might do what you were after. I'm not sure whether it is possible to retrieve what you want. You might want to extend the package to only control the focus, not the rest.

gvdhoorn gravatar image gvdhoorn  ( 2015-12-08 07:53:19 -0600 )edit

Hmm..then I am afraid I am stuck here. I would not know how to extend the package to fix my problem.

Jay4Ros gravatar image Jay4Ros  ( 2015-12-08 08:37:42 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-12-07 10:11:41 -0600

Seen: 1,941 times

Last updated: Dec 08 '15