change in loop rate while in update mode

This commit is contained in:
vivek-shankar 2017-01-28 03:41:51 -05:00
parent 4dbd506fbb
commit 6fc6d91ddb
1 changed files with 10 additions and 3 deletions

View File

@ -68,9 +68,16 @@ namespace rosbzz_node{
/*run once*/
ros::spinOnce();
/*loop rate of ros*/
ros::Rate loop_rate(10);
/*sleep for the mentioned loop rate*/
loop_rate.sleep();
if( get_update_mode() == CODE_STANDBY){
ros::Rate loop_rate(2);
loop_rate.sleep();
}
else{
ros::Rate loop_rate(10);
loop_rate.sleep();
}
/*sleep for the mentioned loop rate*/
timer_step+=1;
maintain_pos(timer_step);