utils.h
Go to the documentation of this file.
00001 #ifndef HRL_PHRI_2011_UTILS_H
00002 #define HRL_PHRI_2011_UTILS_H
00003 
00004 #include <string>
00005 #include <boost/foreach.hpp>
00006 
00007 #include <rosbag/bag.h>
00008 #include <rosbag/view.h>
00009 #include <rosbag/message_instance.h>
00010 
00011 #include <hrl_phri_2011/EllipsoidParams.h>
00012 #include <hrl_phri_2011/pcl_basic.h>
00013 #include <hrl_phri_2011/ellipsoid_space.h>
00014 #include <tf_conversions/tf_eigen.h>
00015 
00016 using namespace boost;
00017 using namespace std;
00018 
00019 template <class M>
00020 void readBagTopic(const std::string& filename, vector< shared_ptr< M > >& msgs, 
00021                   const string& topic = string(""));
00022 
00023 template <class M>
00024 void readBagTopic(const std::string& filename, vector< shared_ptr< M > >& msgs, const string& topic) {
00025     rosbag::Bag bag;
00026     bag.open(filename, rosbag::bagmode::Read);
00027     rosbag::View view(bag, rosbag::TopicQuery(topic));
00028     shared_ptr< M > cur_msg;
00029     BOOST_FOREACH(rosbag::MessageInstance const msg, view) {
00030         msgs.push_back(msg.instantiate< M >());
00031         /*
00032         cur_msg = msg.instantiate< M >();
00033         if(cur_msg != NULL){
00034             msgs.push_back(shared_ptr< M >(new M(*cur_msg)));
00035             ROS_INFO("%s %s", filename.c_str(), topic.c_str());
00036         }
00037         */
00038     }
00039     bag.close();
00040 }
00041 
00042 void applyRegistration(const PCRGB& in_pc, const hrl_phri_2011::EllipsoidParams& params, PCRGB& out_pc);
00043 void loadRegisteredHead(const string& head_bag, const string& params_bag, PCRGB& out_pc, Ellipsoid& ell);
00044 
00045 #endif // HRL_PHRI_2011_UTILS_H


hrl_phri_2011
Author(s): Kelsey Hawkins
autogenerated on Wed Nov 27 2013 12:22:40