Package ckbot :: Module hitec :: Class ProtocolNodeAdaptor
[hide private]
[frames] | no frames]

Class ProtocolNodeAdaptor

source code


Utilizes the protocol along with nid to create an interface for a specific module

Instance Methods [hide private]
 
__init__(self, protocol, nid=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
set_pos(self, tgt)
Sends a position command
source code
 
get_typecode(self) source code
 
_onlyOne(self)
(private) make sure there is only one servo on the bus
source code
 
getID(self)
Get current module ID ...
source code
 
getEEPROM(self) source code
 
setID(self, new_id)
Sets module ID ...
source code
 
ping(self)
Send query to servo without having protocol expect a reply
source code
 
set_speed(self, speed)
Set speed of for servo and get position
source code
 
get_speed(self)
Get speed value for servo ...
source code
 
get_sync(self, tic=0.01)
Synchronous wrapper on top of get_async
source code
 
get_async(self)
Send out an asynchronous get request
source code
 
go(self)
Set servo to go state ...
source code
 
stop(self)
Set servo to stop state ...
source code
 
release(self)
Release servo ...
source code

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

Class Methods [hide private]
 
async_parse(cls, promise, barf=True)
Parse the result of an asynchronous get.
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, protocol, nid=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

getID(self)

source code 

Get current module ID ... note: only works with single module bus

OUTPUT: 
  ret -- module ID

setID(self, new_id)

source code 

Sets module ID ... note: only works with single module bus

INPUT:
  new_id -- desired servo ID

set_speed(self, speed)

source code 

Set speed of for servo and get position

INPUT: 
  speed -- set speed

get_speed(self)

source code 

Get speed value for servo ... this just returns the last speed set,
   if that has not been set, it returns the default value: 0xFF

OUTPUT: 
  ret -- servo speed between [0 - 255]

get_sync(self, tic=0.01)

source code 

Synchronous wrapper on top of get_async

Returns the get_async result

async_parse(cls, promise, barf=True)
Class Method

source code 

Parse the result of an asynchronous get.

When barf is True, this may raise a deferred exception if the operation timed out or did not complete. Otherwise the exception object will be returned.

get_async(self)

source code 

Send out an asynchronous get request

OUTPUT: ret -- promise that will hold result after update()

go(self)

source code 

Set servo to go state 
  ... if module is in stop state it will immediately move to 
      position commanded

stop(self)

source code 

Set servo to stop state
   ... will freeze module motion until go state set or until power reset

release(self)

source code 

Release servo
  ... will turn on PID and make servo go slack