# How to cancel a goal with move_base and actionlib when pressing a key from keyboard?

I am working for sending my Husky robot to 5 local waypoints. The local waypoints are saved in a .csv file and by reading this file, I am able to move the robot from one point to another. But now, I need to update my code "simple_navigation_goals.cpp" by incorporating one more functionality.The link for the code I am using is https://github.com/cristian-frincu/si... . I need to skip an intermediate goal if I pressed a key (any key is fine) on my keyboard. More precisely, suppose I have 5 local waypoints. Once I execute the "simple_navigation_goals", the robot will start from its initial position to its first goal and then to the second goal. When the robot start moving to the third goal, suppose, I hit a key (any key) from my keyboard. Now, the robot should skip the third goal and need to move directly to fourth goal. Can you help me by providing a sample code to achieve this. I tried using void cancelGoal (), but not sure how to use this. Thanks in advance

edit retag close merge delete