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

Revision history [back]

click to hide/show revision 1
initial version

1) Actionlib can handle as many goals as you like...I think you're thinking of SimpleActionServer/SimpleActionClient.

2) I believe it has less to do with race conditions relating to the goal and more so to do with the initialization of the ROS node.

In the ActionServer constructor, one of the parameters is "autostart". If you have this set to true, the actionserver is constructed immediately which internally creates a NodeHandle. This is bad if ROS has not been initialized yet with the init() function and will cause your node to exit with an error message. This can happen in C++ if your ActionServer is a global value within a compilation unit and in Python if you import modules that create global ActionServer objects outside the scope of a class or function.

If you set autostart to false, you can then spin up the ActionServer with the "start()" method at a later time. Setting it to true automatically calls this right away.

1) Actionlib can handle as many goals as you like...I think you're thinking of SimpleActionServer/SimpleActionClient.SimpleActionServer/SimpleActionClient which is a simple and common use case of actionlib with single goals.

2) I believe it The point of autostart has less to do with race conditions relating to the goal and more so to do with the initialization of the ROS node.

In the ActionServer constructor, one of the parameters is "autostart". If you have this set to true, the actionserver is constructed immediately which internally creates a NodeHandle. This is bad if ROS has not been initialized yet with the init() function and will cause your node to exit with an error message. This can happen in C++ if your ActionServer is a global value within a compilation unit and in Python if you import modules that create global ActionServer objects outside the scope of a class or function.

If you set autostart to false, you can then spin up the ActionServer with the "start()" method at a later time. Setting it to true automatically calls this right away.

1) Actionlib can handle as many goals as you like...I think you're thinking of SimpleActionServer/SimpleActionClient which is a simple and common use case of actionlib with single goals.

2) The point of autostart has less to do with race conditions relating to the goal and more so to do with the initialization of the ROS node.

In the ActionServer constructor, one of the parameters is "autostart". If you have this set to true, the actionserver is constructed immediately which internally creates a NodeHandle. starts trying to publish (you can see this for yourself in the source code for actionlib https://github.com/ros/actionlib) by calling an internal method called "start()". This is bad can be bad. For example, if ROS has not been initialized yet with the you have your ActionServers as global variables that are created before init() function and will cause your node to exit with an error message. is called. This can happen in C++ if your ActionServer is a global value within a compilation unit and in Python if you import modules that create global ActionServer objects outside the scope of a class or function.

If you set autostart to false, you can then spin up the ActionServer with the "start()" method at a later time. Setting it to true automatically calls this right away.

away. Hence the warning...you should always start the ActionServers when you know you're ready to start taking goal requests.

1) Actionlib can handle as many goals as you like...I think you're thinking of SimpleActionServer/SimpleActionClient which is a simple and common use case of actionlib with single goals.

2) The point of autostart has less to do with race conditions relating to the goal and more so to do with the initialization of the ROS node.

In the ActionServer constructor, one of the parameters is "autostart". "auto_start". If you have this set to true, the actionserver immediately starts trying to publish (you can see this for yourself in the source code for actionlib https://github.com/ros/actionlib) by calling an internal method called "start()". This can be bad. For example, if you have your ActionServers as global variables that are created before init() is called. This can happen in C++ if your ActionServer is a global value within a compilation unit and in Python if you import modules that create global ActionServer objects outside the scope of a class or function.

If you set autostart auto_start to false, you can then spin up the ActionServer with the "start()" method at a later time. Setting it to true automatically calls this right away. Hence the warning...you should always start the ActionServers when you know you're ready to start taking goal requests.