why node handler not publishing without infinite loop on pr2?
I have just modified the teleop_pr2_keboard code to do one task in the function void
TeleopPR2Keyboard::keyboardLoop(){
// I removed everything and added
cmd.linear.y = 50;
vel_pub_.publish(cmd);
// See no while or infinite loop
}
this doesn't work but if i just do
TeleopPR2Keyboard::keyboardLoop(){
while(1){
cmd.linear.y = 50;
vel_pub_.publish(cmd);
}
}
everything starts wroking but i just want the program to do one thing and stop how do i do this ?