00001 #include "header.h" 00002 #include <pcl_conversions/pcl_conversions.h> 00003 00004 myHeader::myHeader() 00005 { 00006 seq = 0; 00007 } 00008 00009 myHeader::myHeader(pcl::PCLHeader h) { 00010 std_msgs::Header rh = pcl_conversions::fromPCL(h); 00011 fromRosHeader(rh); 00012 } 00013 00014 myHeader::myHeader(std_msgs::Header rh){ 00015 fromRosHeader(rh); 00016 } 00017 00018 myHeader::myHeader(uint32_t aseq, ros::Time astamp, std::string aframe_id) 00019 { 00020 seq = aseq; 00021 stamp = astamp; 00022 frame_id = aframe_id; 00023 } 00024 00025 std_msgs::Header myHeader::toRosHeader() 00026 { 00027 std_msgs::Header rh; 00028 rh.seq = seq; 00029 rh.stamp = stamp; 00030 rh.frame_id = frame_id; 00031 return rh; 00032 } 00033 00034 00035 void myHeader::fromRosHeader(std_msgs::Header rh){ 00036 seq = rh.seq; 00037 stamp = rh.stamp; 00038 frame_id = rh.frame_id; 00039 } 00040 00041 00042 myHeader::operator pcl::PCLHeader() 00043 { 00044 return pcl_conversions::toPCL(this->toRosHeader()); 00045 } 00046 myHeader::operator std_msgs::Header() 00047 { 00048 return this->toRosHeader(); 00049 }