Polling the pause state of arm using SunriseExecutionService

  • Hello all,


    I am currently working on a hand-guiding application where a user should be able to set multiple points by pressing the green user button on our Media Flange Touch Pneumatic. I'd like to have two buttons in use for this program: the green user button to set points, and a separate button which signals that the user is done collecting points.


    Since I don't believe there's any way to poll whether the gray enabling switch on the flange is pressed (if someone does know how to do this within Java, please let me know), I'd like to use one of the user keys. Right now, what I want to do is start an asynchronous hand-guiding movement followed by a while loop that checks for both of these button presses, and I also want another condition that checks whether the arm movement is paused. Ideally, if the user lets go of the flange button and they need to restart hand guiding, I need a way of being able to check that so I can start another asynchronous hand-guiding call, and then allow the user to regain control by pressing one of the start buttons on the smartPAD.


    The only way I can imagine being able to do this is by using the isPaused() method provided in the class SunriseExecutionService. The only issue is that I don't understand how to set up an instance of this object so I can check whether the arm is paused, and therefore need to start another async movement. If anyone can explain how this class works, it would be greatly appreciated.


    Thanks!

  • You can get the instance of SunriseExecutionService from lbr or Controller.
    So far as I know, this service lies between the app layer and the deeper layer of motion execution layer.

    Code
    SunriseExecutionService ses = (SunriseExecutionService) lbr.getController().getExecutionService();

Advertising from our partners