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

Revision history [back]

click to hide/show revision 1
initial version

Hi in your code print just call for once you can change code like this:

ros::Rate loop_rate(10);
 while (ros::ok()){
    print();
    ros::spin();
    ros::spinOnce();
    loop_rate.sleep();   
    }

Hi in your code print just call for once you can change code like this:

ros::Rate loop_rate(10);
loop_rate(100);
 while (ros::ok()){
    print();
    ros::spin();
    ros::spinOnce();
    loop_rate.sleep();   
    }

Hi in your code print just call for once you can change code like this:

ros::Rate loop_rate(100);
 while (ros::ok()){
    print();
    ros::spin();
    ros::spinOnce();
    loop_rate.sleep();   
    }