TimeSynchronizer [compilation error ]
Hi all,
i am getting compilation error while using TimeSynchronizer
.
i saw similar question , but it didnt solve.
thank you.
error: ‘TimeSynchronizer’ does not name a type
In constructor ‘Detectchange::Detectchange()’:
error: ‘timesync’ was not declared in this scope
error: expected type-specifier before ‘TimeSynchronizer’
error: expected ‘;’ before ‘TimeSynchronizer’
here is my code snippet.
class myclass
{
public:
//some stuff
private:
message_filters::Subscriber<sensor_msgs::LaserScan>* laser_scan_sub;
message_filters::Subscriber<geometry_msgs::PoseStamped>* pose_sub;
TimeSynchronizer<sensor_msgs::LaserScanConstPtr, geometry_msgs::PoseStampedConstPtr> *timesync;
}
myclass::myclass()
{
laser_scan_sub = new message_filters::Subscriber<sensor_msgs::LaserScan>(nh_, "/ms_front_laser", 1);
pose_sub = new message_filters::Subscriber<geometry_msgs::PoseStamped>(nh_, "/pose", 1);
timesync = new TimeSynchronizer<sensor_msgs::LaserScanConstPtr, geometry_msgs::PoseStampedConstPtr> (laser_scan_sub, pose_sub, 50);
timesync->registerCallback(boost::bind(&myclass::laserReceived, this, _1, _2));
}
void myclass::laserReceived(const sensor_msgs::LaserScanConstPtr& laser_scan, const geometry_msgs::PoseStampedConstPtr& estimate_pose)
{
// some stuff
}
int main(int argc, char** argv)
{
ros::init(argc, argv, "myclass");
ros::NodeHandle nh;
myclass mc;
ros::spin();
return(0);
}