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

Rviz camera in ThirdPersonFollower view doesn't align correctly

asked 2019-11-25 10:49:29 -0500

ignite gravatar image

updated 2022-03-20 10:09:30 -0500

lucasw gravatar image


  • Ubuntu 16.04
  • ROS Kinetic


  1. I notice that the camera in rviz in ThirdPersonFollower mode doesn't seem to align correctly. As can be seen in the figures below, I set focal point to 0; 0; 0, yaw to 0, and pitch to 0. But the camera doesn't align correctly. Am I missing anything here?

  2. Also, when I play the rosbag file, the camera pose seems to change from frame to frame, which I don't know what possible reasons could be. Does anybody have this kind of behavior?

What could be the possible reasons of this? Is this a known bug?

Here is some of the screenshots:

image description image description image description

edit retag flag offensive close merge delete


Hi @ignite

  1. It will always depends on the values you assigned to the Fixed Frame field in the Global options and the Target Frame field on the view options. Looking at the pictures you are visualizing in two different frames: camera_init and aft_mapped.
  2. Dealing with TFs extracted from a rosbag is always a bit of a mess. I would recommend you to ensure you have a proper TF tree and then to record your rosbag with /tf /tf_static and /clock topics to see if it a problem of the TF or the time at witch they are recorded.
Weasfas gravatar image Weasfas  ( 2019-11-25 11:07:25 -0500 )edit

@Weasfas Thanks for your detailed comment. Please correct me if I am wrong. Regarding point #1, my understanding is that Fixed Frame is a frame that all objects in rviz is plotted "with respect to". So doesn't the camera type (and its settings) only depend on the Target Frame? Because according to this, it is said that the ThirdPersonFollower will maintain a constant viewing angle towards theTarget Frame.

ignite gravatar image ignite  ( 2019-11-25 11:19:44 -0500 )edit

As far as I know, the fixed frame tells rviz the relative coordinates of all plotted frames with respect to the Fixed Frame in the global setting. The thing is, the Target Frame in the view panel is more important because it is changing your local coordinates of the camera (E.g.: applying the coordinate offset). If you have a Fixed Frame as frame1 you can place the Target Frame with <Fixed Frame> but if you change it to another, the offset will be applied and you will be not aligned with the frame you want.

I performed some testing with a robot model in the ThirdPersonFollower view and as long as I use the proper coordinate frames the axis of the frame always plotted aligned. I am using your same set up: Ubuntu Xenial + Kinetic

Weasfas gravatar image Weasfas  ( 2019-11-26 04:08:12 -0500 )edit

@Weasfas Thanks! I think I misunderstood the ThirdPersonFollower view typeThe document says that n ThirdPersonFollower, the camera will turn if the Target Frame yaws.

ignite gravatar image ignite  ( 2019-11-26 09:48:43 -0500 )edit

@Weasfas I think I have found the solution from this post. I need to set both Fixed Frame and Target Frame to the same frame.

ignite gravatar image ignite  ( 2019-11-26 13:13:06 -0500 )edit


Well, Glad you found a solution =)!

P.D. If you do not mind I will add here your comment as the answer.

Weasfas gravatar image Weasfas  ( 2019-11-26 17:11:02 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-11-26 17:11:43 -0500

Weasfas gravatar image

updated 2019-11-26 17:12:57 -0500

As @ignite noted:

I think I have found the solution from this post. I need to set both Fixed Frame and Target Frame to the same frame.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2019-11-25 10:49:29 -0500

Seen: 453 times

Last updated: Nov 26 '19