Comments (3)
We had to implement a hacky workaround. I believe we use a single shot timer to send the new goal later, instead of right at the doneCb.
from actionlib.
After #155 one of our use cases is broken.
If you are using a SimpleActionClient, and on your
done_cb
send another goal, it is possible that a status message or result message from the previous goal is interpreted for the current goal.This code sample fails on 1.13.2 but works fine on 1.12.1:
#include <actionlib_tutorials/FibonacciAction.h> #include <actionlib/client/simple_action_client.h> #include <actionlib/server/simple_action_server.h> #include <ros/ros.h> class FibonacciAction { protected: ros::NodeHandle nh_; actionlib::SimpleActionServer<actionlib_tutorials::FibonacciAction> as_; // NodeHandle instance must be created before this line. Otherwise strange error occurs. std::string action_name_; public: FibonacciAction(std::string name) : as_(nh_, name, boost::bind(&FibonacciAction::executeCB, this, _1), false) , action_name_(name) { as_.start(); } void executeCB(const actionlib_tutorials::FibonacciGoalConstPtr &goal) { as_.setSucceeded(); } }; std::unique_ptr<actionlib::SimpleActionClient<actionlib_tutorials::FibonacciAction>> client; void done_cb(const actionlib::SimpleClientGoalState &state, const actionlib_tutorials::FibonacciResultConstPtr &result) { ROS_INFO_STREAM("Goal done "); actionlib_tutorials::FibonacciGoal goal; goal.order = 1; client->sendGoal(goal, &done_cb); } int main(int argc, char **argv) { ros::init(argc, argv, "test_fibonacci"); ros::AsyncSpinner spinner(1); spinner.start(); FibonacciAction server("fibonacci"); client.reset(new actionlib::SimpleActionClient<actionlib_tutorials::FibonacciAction>( "fibonacci", true)); ROS_INFO("Waiting for action server to start."); // wait for the action server to start client->waitForServer(); // will wait for infinite time ROS_INFO("Action server started, sending goal."); // send a goal to the action actionlib_tutorials::FibonacciGoal goal; client->sendGoal(goal, &done_cb); while (ros::ok()) { ros::Duration(.1).sleep(); } // exit return 0; }
After #155 it gets stuck with:
[ INFO] [1631185426.628695785]: Waiting for action server to start.
[ INFO] [1631185426.822095819]: Action server started, sending goal.
[ INFO] [1631185426.822328039]: Goal done
[ERROR] [1631185426.822456738]: BUG: Got a transition to CommState [ACTIVE] when in SimpleGoalState [DONE]
[ERROR] [1631185426.822487358]: BUG: Got a second transition to DONE:
I have the same problem,do you have a solution?
from actionlib.
We had to implement a hacky workaround. I believe we use a single shot timer to send the new goal later, instead of right at the doneCb.
I think this is not the optimal solution, I hope it can be solved completely
from actionlib.
Related Issues (20)
- How to resume a task after canceled a task
- Noetic Python 2 dependency on wxtools HOT 6
- Segmentation Fault when I run client node HOT 2
- `waitForResult` returns before doneCb HOT 1
- [noetic] Where is axclient.py ? HOT 7
- Restarting the action-server during goal execution makes CPP-action-client crash in windows, ROS1 Melodic HOT 1
- race condition in SimpleActionClient HOT 1
- exercise_simple_client test failing on Noetic HOT 1
- wait_for_server can return before result or feedback topic is fully connected
- Implement interfaces for easier mocking
- Suppress debug in stdout HOT 1
- noetic install broken HOT 2
- After calling cancel_all_goals() isNewGoalAvailable returns true
- New release for ros noetic? HOT 4
- "getElem() should not see invalid handles" in kinetic HOT 1
- race condition in SimpleActionClient.send_goal
- GoalStatus.to_string(0) in action_client.py result the wrong key attribute
- Lost feedback on python actionclient HOT 2
- Getting an error when I try to open axclient.py
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from actionlib.