ros publisher not publishing in debug
Hi
I'm running my node in debug (vscode) and getting weird results. I have a loop which is publishing to a motor
while (std::abs(orientation.roll) > ROLL_FLAT_SURFACE)
{
ros::spinOnce();
bla bla bla
robotControlPublisher_.publish(motor_cmd_);
ros::Duration(TIME_TO_SLEEP).sleep();
}
if I put a breakpoint before and after the loop and run in debug the publisher will publish. if I stop each iteration the publisher won't publish. how can I fix it? Thanks
What do you mean by "stop each iteration"?
put a breakpoint after ros::spinOnce(); press F5 to run to the next breakpoint