simulating openni in fuerte
I've recently made the shift to ROS fuerte and have been in the process of upgrading my simulated models and sensors. Our robot model can use both the XBOX Kinect and the ASUS Xtion. I can bring up both the camera and pointcloud when using a real Kinect/ASUS, but I can't seem to bring up the pointcloud in a simulated environment even though I can pull up the camera no problem. I also can't get the (simulated) PR2 to bring up a pointcloud.
Can someone offer some guidance on simulating the pointcloud?
EDIT 1: I guess I should add that I can echo the /kinect/depth/points topic and see the data but neither the data or messages are received in RVIZ to visualize the points.
EDIT 2: After some digging, it seems it may be an issue with the new Gazebo. Which would make sense if openni works with the physical Kinect but not with a simulated one. Here are some warnings I get when subscribing to the pointcloud in RVIZ:
[ WARN] [1337265919.848795162, 213.880000000]: MessageFilter [target=/base_link ]: Discarding message from [/gazebo] due to empty frame_id. This message will only print once.
However, when I echo my points topic, the correct frame_id shows up.
Thanks, Seth
Do you get any errors in rviz when you try to subscribe to those PointCloud2 topics (red status header)? Is there a path in your tf tree between your Kinect's points frame_id and your fixed_frame in rviz?
Yes to both questions. When I subscribe to the topic the drop-down list of errors shows points: [0] points from [0] messages; topic: no messages received; transform [sender=/gazebo] for frame [] Frame [] does no exist. I'm confused on the tf frame error because I can trace the path through the tree
What is your fixed_frame and target_frame set to in Rviz (especially - is your fixed_frame empty)? Could you include a snippet from
rostopic echo /kinect/depth/points/header
? Does the rgb/points topic work in rviz (check the header there as well to see if they are different).Topic no longer has the frame_id, I may have been looking at the wrong topic when I reported that earlier. fixed and target frame are both base_link, I've also tried fixed_frame as kinect_link since it is the parent of kinect_optical_link. None of the /points topics seem to have a frame_id.
That would be the source of your problem. I don't know what Gazebo plugin actually simulates those topics/publishes them, but not having any frame_id at all is definitely a bug. Perhaps it's a parameter that doesn't have a non-empty default?
After I posted that last comment I went through the controller plugin and noticed that the frame_name_ is never set which down the road sets frame_id. I'll look for any parameters on that. I'll also go through all openni_launch calls. If I find a patch or answer then I'll post it here. Thanks Eric.
I suggest you file a ticket against whichever package contains that gazebo plugin and then post the link to the ticket as the answer. This way, people can still find the solution (when the ticket is closed) and the problem will be tracked and not forgotten :)