Skip to content

Commit

Permalink
hubero_ros - TaskRequestRos: acceptance of a new goal request during …
Browse files Browse the repository at this point in the history
…execution of the same task (workaround) [#23]
  • Loading branch information
rayvburn committed Feb 20, 2022
1 parent 8138e77 commit 0ea7ceb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hubero_ros/include/hubero_ros/task_request_ros.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,15 @@ class TaskRequestRos: public TaskRequestBase {

// check if new goal was selected and execute procedure after new goal received (once)
if (as_ptr->isNewGoalAvailable()) {
// make sure that current goal is aborted
abort(task_type);
/*
* NOTE: this sleep must be longer than Actor class update period (FSM must be updated to catch
* the trigger of abort->request->activation)
* // FIXME: work out a cleaner/nicer solution
*/
std::this_thread::sleep_for(std::chrono::milliseconds(10));

auto goal = as_ptr->acceptNewGoal();
bool new_request_ok = requestActionGoal(goal);
HUBERO_LOG(
Expand Down

0 comments on commit 0ea7ceb

Please sign in to comment.