Go to the documentation of this file.00001 #include <ros/ros.h>
00002
00003 #include <hrl_phri_2011/pcl_basic.h>
00004 #include <hrl_phri_2011/utils.h>
00005 #include <hrl_phri_2011/ForceProcessed.h>
00006
00007 int main(int argc, char **argv)
00008 {
00009 ros::init(argc, argv, "show_contact_cloud");
00010
00011 if(argc < 2 || argc > 4) {
00012 printf("Usage: show_contact_cloud forces_bag [frame] [hz]\n");
00013 return 1;
00014 }
00015
00016
00017 vector<hrl_phri_2011::ForceProcessed::Ptr> forces;
00018 readBagTopic<hrl_phri_2011::ForceProcessed>(argv[1], forces, "/force_processed");
00019
00020 PCRGB fpc;
00021 for(uint32_t i=0;i<forces.size();i++) {
00022 PRGB pt;
00023 pt.x = forces[i]->tool_frame.transform.translation.x;
00024 pt.y = forces[i]->tool_frame.transform.translation.y;
00025 pt.z = forces[i]->tool_frame.transform.translation.z;
00026 ((uint32_t*) &pt.rgb)[0] = 0xffffffff;
00027 fpc.points.push_back(pt);
00028 }
00029 if(argc > 2)
00030 fpc.header.frame_id = argv[2];
00031 else
00032 fpc.header.frame_id = "/base_link";
00033 if(argc == 3)
00034 pubLoop(fpc, "contact_cloud");
00035 else
00036 pubLoop(fpc, "contact_cloud", atof(argv[3]));
00037
00038 return 0;
00039 }