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

Class ProtocolNodeAdaptor

source code


Instance Methods [hide private]
 
__init__(self, protocol, nid=None, mm=DynamixelMemWithOps)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_adaptMem(self)
Read the typecode and update the mm sub-object to one of the appropriate type
source code
 
mem_write_fast(self, addr, val)
Send a memory write command expecting no response.
source code
 
mem_write_sync(self, addr, val)
Send a memory write command and wait for response, returning it
source code
 
mem_read_sync(self, addr)
TODO
source code
 
get_typecode(self)
TODO
source code
 
mem_read_async(self, addr)
Send a request memory read command expecting response later after p.upate() is called
source code
 
mem_write_async(self, addr, val)
Send a request memory write command expecting response later after p.update() is called
source code
 
get_voltage(self)
Get present voltage on bus as read by servo
source code
 
get_temperature(self)
Get present temperature of servo
source code
 
get_load(self)
Get present load
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, mm=DynamixelMemWithOps)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

mem_write_fast(self, addr, val)

source code 

Send a memory write command expecting no response. 
The write occurs immediately once called. 

INPUTS:
  addr -- char -- address
  val -- int -- value
OUTPUTS: 
  msg -- string -- transmitted packet minus SYNC

THEORY OF OPERATION:
  Call write command with BROADCAST_ID as id, SYNC_WRITE as cmd, and params 
  as ( start_address, length_of_data, nid, data1, data2, ... ) as per 
  section 3-5-7 pp. 39

mem_write_sync(self, addr, val)

source code 

Send a memory write command and wait for response, returning it

INPUTS:
  addr -- char -- address
  val -- int -- value
OUTPUTS: 
  msg -- string -- transmitted packet minus SYNC        

mem_read_async(self, addr)

source code 

Send a request memory read command expecting response later after p.upate() is called

INPUTS:
  addr -- char -- address

OUTPUTS: 
  promise -- list -- promise returned from request

mem_write_async(self, addr, val)

source code 

Send a request memory write command expecting response later after p.update() is called

INPUTS:
  addr -- char -- address
  val -- int -- value to write 

OUTPUTS: 
  promise -- list -- promise returned from request

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

source code 

Parse the result of an asynchronous get.
INPUTS:
  promise -- list -- promise to parse for
  barf -- bool -- throw exception or not

OUTPUTs:
  dat -- string -- data, ProtocolError, or None returned from promise

THEORY OF OPERATION:
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_voltage(self)

source code 

Get present voltage on bus as read by servo

OUTPUTS: -- voltage -- int -- volts THEORY OF OPERATION: -- mem_read the present_voltage register and convert

get_temperature(self)

source code 

Get present temperature of servo

OUTPUTS: -- temperature -- int -- degrees celsius THEORY OF OPERATION: -- mem_read the present_temperature register

get_load(self)

source code 

Get present load

OUTPUTS: -- load -- int -- a ratio of max torque, where max torque is 0x3FF, needs to be determined!!! -U THEORY OF OPERATION: -- mem_read the present_load register