how to publish a topic from kinect in a node?
I want to publish 3 topics from pr2, one from kinect and one from point_cloud (kinect) in a single node and then save the data to disk
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
I want to publish 3 topics from pr2, one from kinect and one from point_cloud (kinect) in a single node and then save the data to disk
Hi, you didn't leave very many details, so I'm going to do my best to parse your request one step at a time:
Well, this one is the hardest. I'm not sure if you have an actual PR2 or you would like to run one in simulation. Please clarify, and I'll do my best to update this answer accordingly. For now, I'm going to assume you have your PR2 running and you can rostopic list/rostopic echo the 3 topics you'd like just fine.
So when you run the openni_camera driver, it will publish the RGB image data from the kinect, as well as the depth data in PointCloud2. These should be published as /camera/rgb/image_color and /camera/depth/points2 respectively.
Okay, so the final step to saving all of your topics to disk would be to use rosbag to record a bag of these 5 topics you'd like. The command line information for rosbag record will show you how to record your topics, but it should go something like this:
rosbag record /camera/rgb/image_color /camera/depth/points [YOUR PR2 TOPICS HERE]
This will record those 5 topics (and those 5 topics only, use rosbag record -a to record ALL topics currently published) to a .bag file in your current directory. Warning, since this has a camera recording, these bag files will easily reach multi-gig size if you leave it running. To playback this bagfile as topics later, just use rosbag play /home/monica/my_recorded_bag_directory/my_pr2_kinect_logs.bag. You may also want to check out rosbag compress if your bag file grows too large.
If I misinterpreted any of your requests please let me know; and please try to give a more detailed request in the future.
Asked: 2011-02-22 22:58:36 -0600
Seen: 1,403 times
Last updated: Feb 22 '11