I can't subscribe to /clock topic in C++
Hello everyone. I need to subscribe to /clock topic to stop my robot when /cmd_vel doesn't receive any message but receive error when i try to do that. Here is my code:
clock_sub_ = nh_.subscribe<rosgraph_msgs::Clock>("clock", &RobotTeleop::clockCallback,this );
And my error is:
error: no matching function for call to ‘ros::NodeHandle::subscribe<rosgraph_msgs::Clock>(const char [6], void (RobotTeleop::*)(), RobotTeleop*)’
25 | graph_msgs::Clock>("clock", &RobotTeleop::clockCallback,this )