ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You could:
As for your question regarding guaranteeing that you are working with the most recent data, every time ROS does a spin, it process all the callbacks sequentially, so your loop goes like this:
while(ros::ok())
{
ros::spinOnce(); // Callbacks are processed here
double angle = ::atan2(goalY - robotY, goalX - robotX);
...
}
2 | No.2 Revision |
You could:
As for your question regarding guaranteeing that you are working with the most recent data, every time ROS does a spin, it process processes all the callbacks sequentially, so your loop goes like this:
while(ros::ok())
{
ros::spinOnce(); // Callbacks are processed here
double angle = ::atan2(goalY - robotY, goalX - robotX);
...
}
3 | No.3 Revision |
You could:
atan2(goalY - robotY, goalX - As for your question regarding guaranteeing that you are working with the most recent data, every time ROS does a spin, it processes all the callbacks sequentially, so your loop goes like this:
while(ros::ok())
{
ros::spinOnce(); // Callbacks are processed here
double angle = ::atan2(goalY - robotY, goalX - robotX);
...
}