ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
There is a while
loop inside your main loop where the code will get stuck. The callbacks are only processed when you call the ros::spinOnce
function, so it will never call the callback when it's stuck inside that inner loop.
It's not clear why you would want a while
loop there anyway, you can possibly change it to an if
condition to make it stop after you get to the desired position. Also, you might never get a message with an exact value of initialX + 1
in the pose message, so you may want to change it to an inequality check instead of equality.