Robotics StackExchange | Archived questions

MessageFilter and PointCloud<PointXYZ> error request for member ‘toSec’

Hi all, I'm converting a package from Groovy to Hydro. I got many compiler errors that were corrected but now the last one is difficult to solve for me. In a point of the program there's

mn_ = new tf::MessageFilter<pcl::PointCloud<pcl::PointXYZ> > (*sub_, tf_, "", 1);

that raise this error:

In file included from /home/mcamurri/hyq-ws/src/robot_self_filter/src/self_filter.cpp:39:0:
/opt/ros/hydro/include/tf/message_filter.h: In member function ‘void tf::MessageFilter<M>::add(const MEvent&) [with M = pcl::PointCloud<pcl::PointXYZ>, tf::MessageFilter<M>::MEvent = ros::MessageEvent<const pcl::PointCloud<pcl::PointXYZ> >]’:
/opt/ros/hydro/include/tf/message_filter.h:458:5:   instantiated from ‘void tf::MessageFilter<M>::incomingMessage(const ros::MessageEvent<const M>&) [with M = pcl::PointCloud<pcl::PointXYZ>]’
/opt/ros/hydro/include/tf/message_filter.h:168:5:   instantiated from ‘void tf::MessageFilter<M>::connectInput(F&) [with F = message_filters::Subscriber<pcl::PointCloud<pcl::PointXYZ> >, M = pcl::PointCloud<pcl::PointXYZ>]’
/opt/ros/hydro/include/tf/message_filter.h:158:5:   instantiated from ‘tf::MessageFilter<M>::MessageFilter(F&, tf::Transformer&, const string&, uint32_t, ros::NodeHandle, ros::Duration) [with F = message_filters::Subscriber<pcl::PointCloud<pcl::PointXYZ> >, M = pcl::PointCloud<pcl::PointXYZ>, std::string = std::basic_string<char>, uint32_t = unsigned int]’
/home/mcamurri/hyq-ws/src/robot_self_filter/src/self_filter.cpp:67:84:   instantiated from here
/opt/ros/hydro/include/tf/message_filter.h:263:9: error: request for member ‘toSec’ in ‘ros::MessageEvent<M>::getMessage() const [with M = const pcl::PointCloud<pcl::PointXYZ>]().boost::shared_ptr<T>::operator-> [with T = const pcl::PointCloud<pcl::PointXYZ>]()->pcl::PointCloud<pcl::PointXYZ>::header.pcl::PCLHeader::stamp’, which is of non-class type ‘const uint64_t {aka const long unsigned int}’
/opt/ros/hydro/include/tf/message_filter.h:458:5:   instantiated from ‘void tf::MessageFilter<M>::incomingMessage(const ros::MessageEvent<const M>&) [with M = pcl::PointCloud<pcl::PointXYZ>]’
/opt/ros/hydro/include/tf/message_filter.h:168:5:   instantiated from ‘void tf::MessageFilter<M>::connectInput(F&) [with F = message_filters::Subscriber<pcl::PointCloud<pcl::PointXYZ> >, M = pcl::PointCloud<pcl::PointXYZ>]’
/opt/ros/hydro/include/tf/message_filter.h:158:5:   instantiated from ‘tf::MessageFilter<M>::MessageFilter(F&, tf::Transformer&, const string&, uint32_t, ros::NodeHandle, ros::Duration) [with F = message_filters::Subscriber<pcl::PointCloud<pcl::PointXYZ> >, M = pcl::PointCloud<pcl::PointXYZ>, std::string = std::basic_string<char>, uint32_t = unsigned int]’
/home/mcamurri/hyq-ws/src/robot_self_filter/src/self_filter.cpp:67:84:   instantiated from here
/opt/ros/hydro/include/tf/message_filter.h:275:5: error: request for member ‘toSec’ in ‘ros::MessageEvent<M>::getMessage() const [with M = const pcl::PointCloud<pcl::PointXYZ>]().boost::shared_ptr<T>::operator-> [with T = const pcl::PointCloud<pcl::PointXYZ>]()->pcl::PointCloud<pcl::PointXYZ>::header.pcl::PCLHeader::stamp’, which is of non-class type ‘const uint64_t {aka const long unsigned int}’
/opt/ros/hydro/include/tf/message_filter.h: In member function ‘bool tf::MessageFilter<M>::testMessage(const MEvent&) [with M = pcl::PointCloud<pcl::PointXYZ>, tf::MessageFilter<M>::MEvent = ros::MessageEvent<const pcl::PointCloud<pcl::PointXYZ> >]’:
/opt/ros/hydro/include/tf/message_filter.h:429:7:   instantiated from ‘void tf::MessageFilter<M>::testMessages() [with M = pcl::PointCloud<pcl::PointXYZ>]’
/opt/ros/hydro/include/tf/message_filter.h:446:7:   instantiated from ‘void tf::MessageFilter<M>::maxRateTimerCallback(const ros::TimerEvent&) [with M = pcl::PointCloud<pcl::PointXYZ>]’
/opt/ros/hydro/include/tf/message_filter.h:331:5:   instantiated from ‘void tf::MessageFilter<M>::init() [with M = pcl::PointCloud<pcl::PointXYZ>]’
/opt/ros/hydro/include/tf/message_filter.h:154:5:   instantiated from ‘tf::MessageFilter<M>::MessageFilter(F&, tf::Transformer&, const string&, uint32_t, ros::NodeHandle, ros::Duration) [with F = message_filters::Subscriber<pcl::PointCloud<pcl::PointXYZ> >, M = pcl::PointCloud<pcl::PointXYZ>, std::string = std::basic_string<char>, uint32_t = unsigned int]’
/home/mcamurri/hyq-ws/src/robot_self_filter/src/self_filter.cpp:67:84:   instantiated from here
/opt/ros/hydro/include/tf/message_filter.h:372:11: error: request for member ‘toSec’ in ‘(& message)->boost::shared_ptr<T>::operator-> [with T = const pcl::PointCloud<pcl::PointXYZ>]()->pcl::PointCloud<pcl::PointXYZ>::header.pcl::PCLHeader::stamp’, which is of non-class type ‘const uint64_t {aka const long unsigned int}’

I think I know what's going on: inside MessageFilter is trying to call toSec on the stamp of the Header but now PCLHeader is different from ROS Headers so the method does not exist anymore. But I don't know how to solve it because I don't want to modify a standard package as MessageFilter

Asked by mark_vision on 2014-06-11 12:23:05 UTC

Comments

Answers