August 28, 2008, Thursday, 7:01
Shoutbox

Robotic cerebellum

From GizmoGarden

Jump to: navigation, search


Contents

[edit] abstract

Robotic Cerebellum. A simple robotics framework utilizing Web2 and REST technologies to provide component based control, sensor, visualization, navigation, and other processing faculties and services. The end objective being useful robotic work.

Currently, there is not a cohesive solution for an open source robotics framework utilizing REST technologies. And created for off the shelf computers. This is a proposal for an open source solution for this gap.

[edit] requirements

  • Use REST type requests for event handling and RPC
  • Need to be able to exercise, debug, or interface using a common browser only & HTML forms.

[edit] what should be the message format?

XML? JSON? GWT-RPC? SOAP? XML-RPC? Binary XML?

[edit] references for XML-RPC


possible motor request:

<?xml version="1.0"?>
<methodCall>
  <methodName>com.gizmogarden.hardware.Motorinterface.goCCW</methodName>
  <params>
    <param>
        <value><i4>22</i4></value>
    </param>
  </params>
</methodCall>

possible motor response:

<?xml version="1.0"?>
<methodResponse>
  <params>
    <param>
        <value><string>10</string></value>
    </param>
  </params>
</methodResponse>


example of a client post

POST xmlrpcexample.php HTTP/1.0
User-Agent: xmlrpc-epi-php/0.2 (PHP)
Host: localhost:80
Content-Type: text/xml
Content-length: 191
<?xml version='1.0' encoding="iso-8859-1" ?>
<methodCall>
<methodName>greeting</methodName>
<params>
<param>
<value>
<string>Lucas</string>
</value>
</param>
</params>
</methodCall>

[edit] references for JSON

XML-RPC represents a calling message system - I do not know how GWT RPC manages its messages. With JSON a message would need to be defined - as JSON is really a data format. The records could easily be defined but it would be unique.

[edit] references for GWT

[edit] strategy

  • pro - leaning torwards XML-RPC - more structured than HTTP-ad hoc paramaters
  • pro - not too bloated like SOAP at least for the initial framework
  • pro - possible automated code generators for interface stubs
  • con - no currently generated
  • con - possible problem for complex types of parameter (or similiar to JSON?)
  • con - don't know how to create a HTML form which does a GET or POST using XML-RPC - single value HTTPREQUEST=<method>< ...? is a possible implementation
  • con - it appears that do to the nature of HTTP requests from HTML forms - the data is "flattened" - so some solutions include, flattening the request - makes it difficult to have complex types? - here is another example
  • if the server understood that the xml data would exist in HTTPREQUEST server variable then I think it would be pretty straight forward. You can make a GET or POST - it has one variable - the one variable is HTTPREQUEST - the downside of this would be, the XML would need to be assembled by javascript before setting.
  • http://www.gwtapps.com/
  • http://www.gwtsite.com/how-to-access-web-services-with-gwt/

[edit] archetype objects

  • transmuter - allows translation of inputs and outputs
  • commuter - allows communication between transmuter
  • genericSensorInterface<-- implements -- genericBumperSwitch
  • genericControllerInterface<-- implements -- genericMotorInterface
  • genericMotorInterface
  • genericBumperSwitch

[edit] matrix of current robotic frameworks

Wikipedia's List

framework pros cons
MS Robotics An actual robotic framework built for extensibility and utilizes Closed source - no opportunity to tweak, improve, or experiment.

Only runs on microsoft operating systems.

Claraty well abstracted not completely public
DROS
MCA-2
MARS


SourceForge Page

[edit] name matrix

  • simple blocks complex outcome
  • input output management
  • robotic
  • cellular automaton
  • software
  • framework
  • model
  • system
  • operating system
  • architecture
  • os
  • blocks
  • hal 9000
  • transmuter
  • oscar robotics - open source control and remote robotics
  • osscos - open source simple control operating system
  • Robot DNA
  • behavioral building blocks
  • opens source robotic control and behavior system - osrcb
  • Robot Operating System
  • OROCOS not
  • OSRCOS
  • Osprey - open source p robotic engine y
  • OCTI
  • components
  • Ostrich
  • Ornithomimus
  • Osros - bearded viking
  • Osros[Christer Damm] flower power
  • Osros - God of operating systems

[edit] components

[edit] generic motor

It takes only 2 bits or control lines to provide simple control for a continuous dc motor. There appears to be 2 basic patterns to motor controllers. One, which is common in H-Bridge designs, I call the "Power Left Power Right" control pattern. One bit will turn the motor one way, the other bit will turn the motor in the opposite direction. Turn both on at the same time and some circuitry will destroy itself by shorting. The other basic pattern I call the "Power Direction" control pattern. Here one bit controls all the power. The other controls the direction. If the power is off, it does not matter what the direction bit is set to, the motor will be stopped.
Image:HBridge.jpg Image:PWRDIR.jpg


[edit] todo

  • IOPort - needs /config_dio96 initialization
  • all <Class>.class.toString() changed to <Class>.class.getCanonicalName()
  • remove name from OperatorEntry
  • Determine if a Message is Broadcasted out on Category or Class should it go out on Notify too - TBD - thinking yes
  • Use Cases ! - All Message Types follow the rule - when they leave a service all are addressed. Class Category & Address
  • Use Cases ! - Class only gets invoked on Class | Category invoked only on Category
  • All Transmuters will need a list of Categories -> how to config? a field which is overridden?
  • Category - Class - Address Filter -> to be added to all config? - to be added to all Inboxes
  • Operator.invoke vs Transmuter.invoke - need to normalize - static would be most accessible if possible
  • bolster config reporting - e.g. if config field exists and file is not found - warn - if finished with constructor and config is null warn
  • remove dataClass from object - should be pulled off of .data.getClass().getCanonicalName() - NORMALIZE
  • getCanonical name for ServiceEntry
  • implement global / static into garden objects
  • fix hashmap to use isKey column in db
  • make return Message from Transmuter invoke return object
  • Message.Object - should be an Array of Objects || paramters in java.reflect.invoke
  • outbox - needs to check if AddressedMessage is to self - should not send it
  • xml insert & extract containers need to support tags passed in
  • dispatch vs static route -- when to use each - static routes need to be established between operators
  • config - need to be able to specify static routes in config
  • pre-filter - post filter
  • junit tests - xml insert -> parse -> empty list -> empty hashmap -> insert -> parse
  • nightly build
  • generate contructors e.g. new ServiceEntry (String a, Boolean b, ........)
  • generate null constructors new ServiceEntry (null) - no field initialization
  • STANDARDIZE - names -> e.g. serviceName vs class vs category vs type
  • should there be only 1 type of commuter? - 2 service directories now 1 local 1 remote
  • MUST CREATE UNIT TESTS !!
  • When service directory changes Operator must broadcast new service directory
  • demo - where users can erase and drag-drop components through the web in order to get different behaviors on bot !
  • indistinguishable xdfd
  • Logging adjustments - 45078 [neck] INFO class org.osros.framework.Transmuter - ***neck invoking stopMotor (null)*** <-- type of Message (have one Invoke call the other)
    45078 [neck_outbox] INFO class org.osros.framework.Outbox - addressing name from to comedi01 <-- from static route toNotifyList



Message Sets
Message Type
Fields
Description
Addressed Direct Message
Message.name=clock01
Message is addressed to a specific instance name
Operator
NonAddressed Message will follow class broadcast and static routes
Class Broadcast Class Message
Message.class=org.osros.hardware.Operator
Message is sent to all instances of the same type

NonClassed Message will follow static routes or direct address
Category Arbitrary broadcast to a Category of services
Message.category=leftLegServices
A way to group service message broadcasts



Static Message will follow static route to next destination A static route message is very similiar to an addressed message - in fact from the recievers point of view they are indistinguishable
NonStatic Message will follow direct address or typed
Method Message has method - Invoked Dispatched or Sent Directly?
No Method Data only? Valid?


Questions to resolve :

  1. can a non-Operator deliver an addressed local Message? - YES
  2. can a non-Operator deliver an addressed remote Message? - NO
  3. can a non-Operator deliver a local Broadcast Class message? - NO
  4. can an Operator deliver local messages in a static way only? - TBD - an example of use would be Remote->Operator->Authentication->Service  where all messages need to funnel through one component
  5. can a notifyList of an Operator contain remote services besides other Operators? - TBD - if the idea is to be seamless then - yes



Service Directory
Class Msg
Source
Msg
Sink
Inter
Process
Msg
Routing
GenericMotor


Clock


SystemConsole (Proxy)



Operator


ComediDriver


Keyboard




Reference :

Smart Proxy
Message Store
Avoiding Message Loops with Message History
Java Keyboard Hook

 

[edit] unit tests

1. 2 service instances are named the same thing in a single process e.g. Clock.neck & Motor.neck