UncertainTransformBroadcaster.cpp
Go to the documentation of this file.
00001 
00002 #include "uncertain_tf/UncertainTransformBroadcaster.h"
00003 #include "uncertain_tf/utfMessage.h"
00004 
00005 
00006 using namespace Eigen;
00007 using namespace tf;
00008 using namespace uncertain_tf;
00009 using namespace std;
00010 
00011 namespace uncertain_tf {
00012 
00013 
00014 UncertainTransformBroadcaster::UncertainTransformBroadcaster()
00015 {
00016     publisher_ = node_.advertise<uncertain_tf::utfMessage>("/tf_uncertainty", 100);
00017     ros::NodeHandle l_nh("~");
00018     //tf_prefix_ = getPrefixParam(l_nh);
00019 }
00020 
00021 void UncertainTransformBroadcaster::sendCovariance(const StampedCovariance& covariance)
00022 {
00023     std::vector<StampedCovariance> v1;
00024     v1.push_back(covariance);
00025     sendCovariance(v1);
00026 }
00027 
00028 void UncertainTransformBroadcaster::sendCovariance(const std::vector<StampedCovariance>& covariances)
00029 {
00030     std::vector<uncertain_tf::CovarianceStamped> utfm;
00031     for (std::vector<StampedCovariance>::const_iterator it = covariances.begin(); it != covariances.end(); ++it)
00032     {
00033         uncertain_tf::CovarianceStamped msg;
00034         covarianceStampedTFToMsg(*it, msg);
00035         utfm.push_back(msg);
00036     }
00037     sendCovariance(utfm);
00038 }
00039 
00040 void UncertainTransformBroadcaster::sendCovariance(const std::vector<CovarianceStamped>& covariances_msg)
00041 {
00042     uncertain_tf::utfMessage msg;
00043     msg.covariances = covariances_msg;
00044     //std::cout << "publishing:" << endl << msg << endl;
00045     publisher_.publish(msg);
00046 }
00047 
00048 }


uncertain_tf
Author(s): Thomas Ruehr
autogenerated on Mon Oct 6 2014 08:20:49