Synchronizer.h Errors
Hi guys,
I've been trying to do approximate time synchronization, and have been adapting tutorial examples for my own needs. I was facing some errors with sync_policies not having a type, synchronizer not being declared in the scope, and so on. Seeing some other forum posts, I added
using namespace message_filters
and got a wall of errors:
/home/pi/ros_ws/src/link/src/roscomm.cpp: In function ‘int main(int, char**)’:
/home/pi/ros_ws/src/link/src/roscomm.cpp:222:85: error: ‘IMU’ is not a member of ‘sensor_msgs’
typedef sync_policies::ApproximateTime<sensor_msgs::NavSatFix, std_msgs::Float64, sensor_msgs::IMU> NavSyncPolicy;
^~~~~~~~~~~
/home/pi/ros_ws/src/link/src/roscomm.cpp:222:85: error: ‘IMU’ is not a member of ‘sensor_msgs’
/home/pi/ros_ws/src/link/src/roscomm.cpp:222:101: error: template argument 3 is invalid
typedef sync_policies::ApproximateTime<sensor_msgs::NavSatFix, std_msgs::Float64, sensor_msgs::IMU> NavSyncPolicy;
^
In file included from /home/pi/ros_ws/src/link/src/roscomm.cpp:21:0:
/opt/ros/kinetic/include/message_filters/synchronizer.h: In instantiation of ‘class message_filters::Synchronizer<int>’:
/home/pi/ros_ws/src/link/src/roscomm.cpp:223:49: required from here
/opt/ros/kinetic/include/message_filters/synchronizer.h:68:7: error: base type ‘int’ fails to be a struct or class type
class Synchronizer : public boost::noncopyable, public Policy
^~~~~~~~~~~~
/opt/ros/kinetic/include/message_filters/synchronizer.h:71:37: error: ‘int’ is not a class, struct, or union type
typedef typename Policy::Messages Messages;
^~~~~~~~
/opt/ros/kinetic/include/message_filters/synchronizer.h:72:35: error: ‘int’ is not a class, struct, or union type
typedef typename Policy::Events Events;
^~~~~~
/opt/ros/kinetic/include/message_filters/synchronizer.h:73:35: error: ‘int’ is not a class, struct, or union type
typedef typename Policy::Signal Signal;
^~~~~~
/opt/ros/kinetic/include/message_filters/synchronizer.h:74:49: error: ‘int’ is not a class, struct, or union type
typedef typename mpl::at_c<Messages, 0>::type M0;
^~
/opt/ros/kinetic/include/message_filters/synchronizer.h:75:49: error: ‘int’ is not a class, struct, or union type
typedef typename mpl::at_c<Messages, 1>::type M1;
^~
/opt/ros/kinetic/include/message_filters/synchronizer.h:76:49: error: ‘int’ is not a class, struct, or union type
typedef typename mpl::at_c<Messages, 2>::type M2;
^~
/opt/ros/kinetic/include/message_filters/synchronizer.h:77:49: error: ‘int’ is not a class, struct, or union type
typedef typename mpl::at_c<Messages, 3>::type M3;
^~
/opt/ros/kinetic/include/message_filters/synchronizer.h:78:49: error: ‘int’ is not a class, struct, or union type
typedef typename mpl::at_c<Messages, 4>::type M4;
^~
/opt/ros/kinetic/include/message_filters/synchronizer.h:79:49: error: ‘int’ is not a class, struct, or union type
typedef typename mpl::at_c<Messages, 5>::type M5;
^~
/opt/ros/kinetic/include/message_filters/synchronizer.h:80:49: error: ‘int’ is not a class, struct, or union type
typedef typename mpl::at_c<Messages, 6>::type M6;
^~
/opt/ros/kinetic/include/message_filters/synchronizer.h:81:49: error: ‘int’ is not a class, struct, or union type
typedef typename mpl::at_c<Messages, 7>::type ...