You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hai, can someone help me regrading how to cancel the action server goal?
This is my current code:
document.addEventListener('DOMContentLoaded',function(){varfibonacciClient=newROSLIB.Action({ros : ros,name : '/fibonacci',actionType : 'action_tutorials_interfaces/Fibonacci'});// Send an action goalvargoal=newROSLIB.ActionGoal({order: 10,});// Variable to store the goal IDvaractionGoalId;document.getElementById('sendGoalButton').addEventListener('click',function(){// Send an action goalactionGoalId=fibonacciClient.sendGoal(goal,function(result){console.log('Result for action goal on '+fibonacciClient.name+': '+result.result.sequence);},function(feedback){console.log('Feedback for action on '+fibonacciClient.name+': '+feedback.partial_sequence);});});document.getElementById('cancelGoalButton').addEventListener('click',function(){// Check if a goal has been sent previouslyif(actionGoalId){// Send a cancel request for the previously sent goalfibonacciClient.cancelGoal(actionGoalId);console.log('Cancel request sent for goal: '+actionGoalId);goal_id=null;// Reset goal_id after cancellation}else{console.log('No goal has been sent yet.');}});});
The text was updated successfully, but these errors were encountered:
MatthijsBurgh
changed the title
ROS2 CANCEL ACTION SERVER GOAL
ROS2 cancel action_server goal
Apr 22, 2024
Hai, can someone help me regrading how to cancel the action server goal?
This is my current code:
The text was updated successfully, but these errors were encountered: