ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

ApproximateTime Policy error

asked 2014-07-17 07:13:32 -0500

hamdi gravatar image

hi, I used to hydro distribution of ros. I want to use ApproximateTime Policy but I'm getting the following error, why I am getting this error?

thanks

error:

In file included from /opt/ros/hydro/include/ros/serialization.h:37:0,
                 from /opt/ros/hydro/include/ros/publisher.h:34,
                 from /opt/ros/hydro/include/ros/node_handle.h:32,
                 from /opt/ros/hydro/include/ros/ros.h:45,
                 from /home/esetron/catkin_ws/src/sabir/src/sabir_node.cpp:190:
/opt/ros/hydro/include/ros/message_traits.h: In static member function ‘static ros::Time ros::message_traits::TimeStamp<M, typename boost::enable_if<ros::message_traits::HasHeader<M> >::type>::value(const M&) [with M = pcl::PointCloud<pcl::PointXYZRGB>]’:
/opt/ros/hydro/include/message_filters/sync_policies/approximate_time.h:167:89:   instantiated from ‘void message_filters::sync_policies::ApproximateTime<M0, M1, M2, M3, M4, M5, M6, M7, M8>::checkInterMessageBound() [with int i = 0, M0 = pcl::PointCloud<pcl::PointXYZRGB>, M1 = sensor_msgs::Image_<std::allocator<void> >, M2 = message_filters::NullType, M3 = message_filters::NullType, M4 = message_filters::NullType, M5 = message_filters::NullType, M6 = message_filters::NullType, M7 = message_filters::NullType, M8 = message_filters::NullType]’
/opt/ros/hydro/include/message_filters/sync_policies/approximate_time.h:218:7:   instantiated from ‘void message_filters::sync_policies::ApproximateTime<M0, M1, M2, M3, M4, M5, M6, M7, M8>::add(const typename boost::mpl::at_c<typename message_filters::PolicyBase<M0, M1, M2, M3, M4, M5, M6, M7, M8>::Events, i>::type&) [with int i = 0, M0 = pcl::PointCloud<pcl::PointXYZRGB>, M1 = sensor_msgs::Image_<std::allocator<void> >, M2 = message_filters::NullType, M3 = message_filters::NullType, M4 = message_filters::NullType, M5 = message_filters::NullType, M6 = message_filters::NullType, M7 = message_filters::NullType, M8 = message_filters::NullType, typename boost::mpl::at_c<typename message_filters::PolicyBase<M0, M1, M2, M3, M4, M5, M6, M7, M8>::Events, i>::type = ros::MessageEvent<const pcl::PointCloud<pcl::PointXYZRGB> >]’
/opt/ros/hydro/include/message_filters/synchronizer.h:358:5:   instantiated from ‘void message_filters::Synchronizer<Policy>::cb(const typename boost::mpl::at_c<typename Policy::Events, i>::type&) [with int i = 0, Policy = message_filters::sync_policies::ApproximateTime<pcl::PointCloud<pcl::PointXYZRGB>, sensor_msgs::Image_<std::allocator<void> > >, typename boost::mpl::at_c<typename Policy::Events, i>::type = ros::MessageEvent<const pcl::PointCloud<pcl::PointXYZRGB> >]’
/opt/ros/hydro/include/message_filters/synchronizer.h:290:5:   instantiated from ‘void message_filters::Synchronizer<Policy>::connectInput(F0&, F1&, F2&, F3&, F4&, F5&, F6&, F7&, F8&) [with F0 = message_filters::Subscriber<pcl::PointCloud<pcl::PointXYZRGB> >, F1 = message_filters::Subscriber<sensor_msgs::Image_<std::allocator<void> > >, F2 = message_filters::NullFilter<message_filters::NullType>, F3 = message_filters::NullFilter<message_filters::NullType>, F4 = message_filters::NullFilter<message_filters::NullType>, F5 = message_filters::NullFilter<message_filters::NullType>, F6 = message_filters::NullFilter<message_filters::NullType>, F7 = message_filters::NullFilter<message_filters::NullType>, F8 = message_filters::NullFilter<message_filters::NullType>, Policy = message_filters::sync_policies::ApproximateTime<pcl::PointCloud<pcl::PointXYZRGB>, sensor_msgs::Image_<std::allocator<void> > >]’
/opt/ros/hydro/include/message_filters/synchronizer.h:282:5:   instantiated from ‘void message_filters::Synchronizer<Policy>::connectInput(F0&, F1&, F2&, F3&, F4&, F5&, F6&, F7&) [with F0 = message_filters::Subscriber<pcl::PointCloud<pcl::PointXYZRGB> >, F1 = message_filters::Subscriber<sensor_msgs::Image_<std::allocator<void> > >, F2 = message_filters::NullFilter<message_filters::NullType>, F3 = message_filters::NullFilter<message_filters::NullType>, F4 = message_filters::NullFilter<message_filters::NullType>, F5 = message_filters::NullFilter<message_filters::NullType>, F6 = message_filters::NullFilter<message_filters::NullType>, F7 = message_filters::NullFilter ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2014-11-11 10:16:04 -0500

Wolf gravatar image

You cannot create a message_filters::subscriber like

message_filters::Subscriber<pcl::PointCloud<pcl::PointXYZRGB> >

because pcl::PointCloud<pcl::PointXYZRGB> itself is not a message type. Try using

message_filters::Subscriber<sensor_msgs::PointCloud2>

and convert to pcl::PointCloud<pcl::PointXYZRGB> in your callback....

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-07-17 07:13:32 -0500

Seen: 1,214 times

Last updated: Nov 11 '14