parameters: (self, window=None, open_position=0.107,
                   closed_position=0.002, force_limit=40,
                   update_period_sec=0.05)
docstring: Args:
              window:          Optionally pass in a tkinter.Tk() object to add
                               these widgets to.  Default behavior is to create
                               a new window.
              update_period_sec: Specifies how often the window update() method
                               gets called.
              open_position:   Target position for the finger when open.
              closed_position: Target position for the gripper when closed.
              force_limit:     Force limit to send to Schunk WSG controller.
docstring_summary: Args:
              window:          Optionally pass in a tkinter.Tk() object to add
                               these widgets to.  Default behavior is to create
                               a new window.
              update_period_sec: Specifies how often the window update() method
                               gets called.
              open_position:   Target position for the finger when open.
              closed_position: Target position for the gripper when closed.
              force_limit:     Force limit to send to Schunk WSG controller.
docstring_tokens: Args : window : Optionally pass in a tkinter . Tk () object to add these widgets to . Default behavior is to create a new window . update_period_sec : Specifies how often the window update () method gets called . open_position : Target position for the finger when open . closed_position : Target position for the gripper when closed . force_limit : Force limit to send to Schunk WSG controller .
function: def __init__(self, window=None, open_position=0.107,
                   closed_position=0.002, force_limit=40,
                   update_period_sec=0.05):
          """"
          Args:
              window:          Optionally pass in a tkinter.Tk() object to add
                               these widgets to.  Default behavior is to create
                               a new window.
              update_period_sec: Specifies how often the window update() method
                               gets called.
              open_position:   Target position for the finger when open.
              closed_position: Target position for the gripper when closed.
              force_limit:     Force limit to send to Schunk WSG controller.
          """
          LeafSystem.__init__(self)
          self.DeclareVectorOutputPort("position", 1, self.CalcPositionOutput)
          self.DeclareVectorOutputPort("force_limit", 1,
                                       self.CalcForceLimitOutput)
  
          if window is None:
              self.window = tk.Tk()
              self.window.title("Schunk WSG Buttons")
          else:
              self.window = window
  
          # Schedule window updates in either case (new or existing window):
          self.DeclarePeriodicEvent(update_period_sec, 0.0,
                                    PublishEvent(self._update))
  
          self._open_button = tk.Button(self.window,
                                        text="Open Gripper (spacebar)",
                                        state=tk.DISABLED,
                                        command=self.open)
          self._open_button.pack()
          self._close_button = tk.Button(self.window,
                                         text="Close Gripper (spacebar)",
                                         command=self.close)
          self._close_button.pack()
  
          self._open_state = True
  
          self._open_position = open_position
          self._closed_position = closed_position
          self._force_limit = force_limit
  
          self.window.bind("<space>", self._space_callback)
function_tokens: def __init__ ( self , window = None , open_position = 0.107 , closed_position = 0.002 , force_limit = 40 , update_period_sec = 0.05 ) : LeafSystem . __init__ ( self ) self . DeclareVectorOutputPort ( "position" , 1 , self . CalcPositionOutput ) self . DeclareVectorOutputPort ( "force_limit" , 1 , self . CalcForceLimitOutput ) if window is None : self . window = tk . Tk ( ) self . window . title ( "Schunk WSG Buttons" ) else : self . window = window # Schedule window updates in either case (new or existing window): self . DeclarePeriodicEvent ( update_period_sec , 0.0 , PublishEvent ( self . _update ) ) self . _open_button = tk . Button ( self . window , text = "Open Gripper (spacebar)" , state = tk . DISABLED , command = self . open ) self . _open_button . pack ( ) self . _close_button = tk . Button ( self . window , text = "Close Gripper (spacebar)" , command = self . close ) self . _close_button . pack ( ) self . _open_state = True self . _open_position = open_position self . _closed_position = closed_position self . _force_limit = force_limit self . window . bind ( "<space>" , self . _space_callback )