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

How to show point cloud2 on rviz?

asked 2012-08-17 01:17:51 -0600

sam gravatar image

updated 2012-08-17 03:05:22 -0600

I use fuerte.

I write a topic /output_plane,and I also can find it on rostopic.

  sam@sam:~/code/ros/sam_pcl/sam_ransac$ rostopic echo /output_plane 
  header: 
    seq: 2
    stamp: 
      secs: 1345201963
      nsecs: 71831081
    frame_id: /base_link
  height: 1
  width: 274386
  fields: 
    - 
      name: x
      offset: 0
      datatype: 7
      count: 1
    - 
      name: y
      offset: 4
      datatype: 7
      count: 1
    - 
      name: z
      offset: 8
      datatype: 7
      count: 1
  is_bigendian: False
  point_step: 16
  row_step: 4390176
  data: [27, 18, 111, 191, 82, 184, 46, 191, 59, 223, 151, 191, 0, 0, 128, 63, 219, 133, 110, 191, 41, 232, 46, 191, 213, 9, 152, 191, 0, 0, 128, 63, 93, 254, 107, 191, 223, 55, 46, 191, 210, 111, 151, 191, 0, 0, 128, 63, 248, 223, 106, 191, 236, 250, 45, 191, 100, 59, 151, 191, 0, 0, 128, 63, 173, 47, 106, 191, 237, 13, 46, 191, 199,                                                                              
  ...
  0, 0, 128, 63]
  is_dense: True
  ---

I add point cloud2 and set the topic, but my rviz is still no message comein.

image description

How to fix it?

Thank you~

=================================

Here is all my topics:

   sam@sam:~/code/ros/sam_pcl/sam_ransac$ rostopic list
  /cloud_pcd
  /initialpose
  /move_base_simple/goal
  /output_plane
  /rosout
  /rosout_agg
  /tf
  sam@sam:~/code/ros/sam_pcl/sam_ransac$

And when I close rviz, it becomes:

  sam@sam:~/code/ros/sam_pcl/sam_ransac$ rostopic list
  /cloud_pcd
  /output_plane
  /rosout
  /rosout_agg
  sam@sam:~/code/ros/sam_pcl/sam_ransac$
edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
2

answered 2012-08-17 02:26:52 -0600

michikarg gravatar image

The fixed frame represents the reference-frame for your coordinate system which for many robotic applications is the map frame. However if you only run a Kinect and don't have a transform between your Kinect-frame and your map-frame available, RVIZ does not know where to display the data from your Kinect and thus won't display anything. So you can

  1. Just set the fixed frame to your Kinect-frame (I can't remember the name, but you can choose from a list)

  2. or send a static tf-transform that determines the transform from your map-frame to the frame of your Kinect. You can do this by using a tf static transform publisher ( http://www.ros.org/wiki/tf#static_transform_publisher )

edit flag offensive delete link more

Comments

I don't use kinect. I only publish Point Cloud2 topic which using point cloud coverting from PCL's to ROS.

sam gravatar image sam  ( 2012-08-17 02:40:50 -0600 )edit

Okay, i have actually never used PCL, but basically you will have to provide RVIZ with the frame that your data is in reference to. So in your case, setting the Fixed frame to /base_link should enable you to see the Pointcloud...

michikarg gravatar image michikarg  ( 2012-08-17 02:48:22 -0600 )edit

I don't have base_link either. I haven't start gazebo with pr2. Why I need the unrelated nodes to show point cloud on Rviz? Thank you~

sam gravatar image sam  ( 2012-08-17 02:54:42 -0600 )edit
1

The header of your pointclout2-message explicitly specifies that you want the frame /base_link as reference-frame for your data. So this frame will have to exist, otherwise RVIZ will not know where to display the data...Did you try to set Fixed_frame and target_frame to /base_link

michikarg gravatar image michikarg  ( 2012-08-17 02:58:34 -0600 )edit

I try to change that. But it doesn't work. I have edited my original post to show all topics I have. How to solve it? Thank you~

sam gravatar image sam  ( 2012-08-17 03:06:29 -0600 )edit
0

answered 2013-06-07 06:30:48 -0600

hersh gravatar image

The header of your PointCloud2 message says "frame_id: /base_link". That is the name of the reference frame that rviz will try and use to figure out where the points should be. If you don't have anything publishing /tf messages (which say where the different frames are, relative to each other), then you must tell rviz to use as its "fixed frame" the same frame_id in the message.

RViz automatically populates the "Fixed Frame" dropdown with all the frames being published in the /tf topic, because that is usually the best source for such data. However, RViz also allows you to type the name into the "Fixed Frame" field even if it is not in the drop-down or if the drop-down is totally empty.

edit flag offensive delete link more
0

answered 2012-08-17 02:16:55 -0600

Karan gravatar image

I think you need to change the "Fixed frame" option from '/map' to something else. In kinect i faced a similar issue and it got solved when i changed the above option to something else. I don't exactly remember the name of the option. I hope this helps.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-08-17 01:17:51 -0600

Seen: 5,592 times

Last updated: Jun 07 '13