Package intera_interface :: Module navigator :: Class Navigator
[hide private]
[frames] | no frames]

Class Navigator

source code

object --+
         |
        Navigator


Interface class for a Navigator on the Intera Research Robot.

Signals:
    button_square_changed   - OFF/CLICK/LONG_PRESS/DOUBLE_CLICK
    button_ok_changed
    button_back_changed
    button_show_changed
    button_triangle_changed
    button_circle_changed
    wheel_changed           - Wheel value

Instance Methods [hide private]
 
__init__(self)
Constructor.
source code
list
list_all_items(self)
Returns a list of strings describing all available navigator items
source code
uint
get_wheel_state(self, wheel_name)
Current state of the wheel providing wheel name
source code
uint
get_button_state(self, button_name)
Current button state by providing button name
source code
str
button_string_lookup(self, button_value)
Returns strings corresponding to the button state.
source code
str
register_callback(self, callback_function, signal_name, poll_rate=10)
Registers a supplied callback to a change in state of supplied signal_name's value.
source code
bool
deregister_callback(self, callback_id)
Deregisters a callback based on the supplied callback_id.
source code
 
_get_item_state(self, item_name) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Constructor.

Overrides: object.__init__

list_all_items(self)

source code 

Returns a list of strings describing all available navigator items

Returns: list
a list of string representing navigator items Each item name of the following format: '<assembly>_button_<function>'

get_wheel_state(self, wheel_name)

source code 

Current state of the wheel providing wheel name

Parameters:
  • wheel_name (str) - the wheel name
Returns: uint
an integer representing how far the wheel has turned

get_button_state(self, button_name)

source code 

Current button state by providing button name

Parameters:
  • button_name (str) - the button name
Returns: uint
an integer representing button values Valid states: {0:'OFF', 1:'CLICK', 2:'LONG_PRESS', 3:'DOUBLE_CLICK'}

button_string_lookup(self, button_value)

source code 

Returns strings corresponding to the button state.

Parameters:
  • button_value (int) - the value to lookup
Returns: str
'INVALID_VALUE' if out of range, or if valid: {0:'OFF', 1:'CLICK', 2:'LONG_PRESS', 3:'DOUBLE_CLICK'}

register_callback(self, callback_function, signal_name, poll_rate=10)

source code 

Registers a supplied callback to a change in state of supplied signal_name's value. Spawns a thread that will call the callback with the updated value.

Parameters:
  • callback_function (function) - function handle for callback function
  • signal_name (str) - the name of the signal to poll for value change
  • poll_rate (int) - the rate at which to poll for a value change (in a separate thread)
Returns: str
callback_id retuned if the callback was registered, and an empty string if the requested signal_name does not exist in the Navigator

deregister_callback(self, callback_id)

source code 

Deregisters a callback based on the supplied callback_id.

Parameters:
  • callback_id (str) - the callback_id string to deregister
Returns: bool
returns bool True if the callback was successfully deregistered, and False otherwise.