ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

move_base_node callbacks

asked 2014-11-06 15:22:03 -0600

2ROS0 gravatar image

updated 2014-11-06 15:22:48 -0600

Hi,

I was going through the code for the move_base_node:

int main(int argc, char** argv){
  ros::init(argc, argv, "move_base_node");
  tf::TransformListener tf(ros::Duration(10));
  move_base::MoveBase move_base( tf );
  ros::spin();
  return(0);
}

So I'm wondering, what callbacks does the ros::spin() at the end execute? The constructor for the MoveBase object has a subscriber, a couple of services, an action server and some other stuff.

And in general, I guess my question is - what callbacks does the ros::spin wait for?

Source: https://github.com/ros-planning/navig...

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-11-06 17:29:18 -0600

ahendrix gravatar image

ros::spin() blocks until the node is killed with a signal (ctrl-C, segfault, etc) or through rosnode kill.

While ros::spin() is running, it services all of the callbacks for all topics, services, etc that are not explicitly handled by a separate spinner.

edit flag offensive delete link more

Comments

And how would it be handled by a separate spinner?

2ROS0 gravatar image 2ROS0  ( 2014-11-06 17:46:03 -0600 )edit
ahendrix gravatar image ahendrix  ( 2014-11-06 18:11:57 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-11-06 15:22:03 -0600

Seen: 234 times

Last updated: Nov 06 '14