ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Rviz is doing what you are telling it to do.
You are loading a static URDF model and telling Rviz to set the fixed frame to "/base_link". So Rviz is considering "/base_link" to be the origin coordinate (0, 0 , 0) and the relative position of your static URDF model and "/base_link" never changes (that is why you can see your robot model at the origin.
But then, the poses on your particle filter are also using "/base_link" as their frame of reference. For instance a particle at pose (1, 1, 0) will appear 1 meter to the front and one meter to the left of "/base_link". That is why you are seeing the point cloud displaced from the robot model.
What you need to do is to set the frame of your particle filter pose to something different, for example "/particle_filter_frame" and publish the tf transform between "/particle_filter_frame" -> "/base_link".
Then set Rviz's fixed frame to "/particle_filter_frame" and you should be able to see what you expect.
2 | No.2 Revision |
Rviz is doing what you are telling it to do.
You are loading a static URDF model and telling Rviz to set the fixed frame to "/base_link". So Rviz is considering "/base_link" to be the origin coordinate (0, 0 , 0) and the relative position of your static URDF model and "/base_link" never changes (that is why you can see your robot model at the origin. origin).
But then, the poses on your particle filter are also using "/base_link" as their frame of reference. For instance a particle at pose (1, 1, 0) will appear 1 meter to the front and one meter to the left of "/base_link". That is why you are seeing the point cloud displaced from the robot model.
What you need to do is to set the frame of your particle filter pose to something different, for example "/particle_filter_frame" and publish the tf transform between "/particle_filter_frame" -> "/base_link".
Then set Rviz's fixed frame to "/particle_filter_frame" and you should be able to see what you expect.