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

Focus camera on origin of moving frame in rviz

asked 2014-06-11 08:19:32 -0600

JoeayMB gravatar image

updated 2014-06-16 23:58:51 -0600

Hey all,

Im quite new to ROS, did a lot of tutorial stuff lately and didn't find an answer in the answers database.

My program has 2 frames. A fixed "world" frame and a "ego" frame, that is moving within the fixed one. Rviz is set up with a .rviz config file. Now I wonna know, if it's possible to focus the camera on the moving frame and update camera every time the moving frame changes relatively to the fixed frame. If yes, do I have to modify my .rviz config file or my program?

I think these are the important lines of my .rviz config file:

Views:
Current:
  Class: rviz/Orbit
  Distance: 139.139
  Focal Point:
    X: -1.5004
    Y: 59.5032
    Z: -26.4407
  Name: Current View
  Near Clip Distance: 0.01
  Pitch: 0.839797
  Target Frame: <Fixed Frame>
  Value: Orbit (rviz)
  Yaw: 5.10348

edit Thanks for your answers so far. But It turned out i meant something different to what I explained ^^ I dont want to move things relative to the ego frame. I still want to target the world frame, but tell rviz to set the focal point according to the ego frame that is moving within the world frame.

I found the documentation of the rviz::VisualizationManager that controls the visualization of rviz:

For example, there's rviz::ViewController with a method lookAt(float x, float y, float z) or rviz::OrbitViewController with a method move(float x, float y, float z) that might work in this case, but I don't quite find a way to use these in my program.

Got any ideas on that?

Thanks in advance!

greetz Joey

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2014-06-12 04:44:29 -0600

Miquel Massot gravatar image

I think that what you want can be done setting the Target Frame to the "ego" frame, because now it's fixed.

edit flag offensive delete link more
0

answered 2014-06-12 08:43:03 -0600

Rabe gravatar image

In the GUI under the point "Displays" you can select Fixed Frame, it is under Global Options. Your desired frame should be available in the dropdown menu.

If you leave everything on the default in the Views section (Current View => Target Frame = Fixed Frame), it should follow your selected frame.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-06-11 08:19:32 -0600

Seen: 4,668 times

Last updated: Jun 16 '14