Is it possible to callback another member function and subscribe the velocity simultaneously by spinOnce()?

asked 2016-05-12 11:33:51 -0500

mehdivj gravatar image

updated 2016-05-12 11:54:27 -0500

 myclass::Look
{
}
myclass::mov()
{
sub = nh_.subscribe<sensor_msgs::LaserScan>("/scan", 100, boost::bind(&myclass::Look, this, _1));

    while(ros::ok()) {

        cmd_VelPublisher.publish(cmd_velMsg);

        ros::Duration(0.1).sleep();
        ros::spinOnce();
        rate.sleep();
}
edit retag flag offensive close merge delete

Comments

Can you specify a bit more what you want to do exactly? Are you running the 'mov' method inside your main() method?

donald gravatar image donald  ( 2016-05-17 09:23:33 -0500 )edit