Skip to content

Commit

Permalink
feat(SimpleActionServer): add setAborted method (#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
reinzor authored May 5, 2020
1 parent 506eb32 commit aafcfe2
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/actionlib/SimpleActionServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,27 @@ SimpleActionServer.prototype.setSucceeded = function(result2) {
}
};

/**
* Set action state to aborted and return to client
*/

SimpleActionServer.prototype.setAborted = function(result2) {
var resultMessage = new Message({
status : {goal_id : this.currentGoal.goal_id, status : 4},
result : result2
});
this.resultPublisher.publish(resultMessage);

this.statusMessage.status_list = [];
if(this.nextGoal) {
this.currentGoal = this.nextGoal;
this.nextGoal = null;
this.emit('goal', this.currentGoal.goal);
} else {
this.currentGoal = null;
}
};

/**
* Function to send feedback
*/
Expand Down

0 comments on commit aafcfe2

Please sign in to comment.