21
Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

Embed Size (px)

Citation preview

Page 1: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

Ideas from ARC about the CORBA FL interface

Interface ideas learned from K9 and K10 (Lorenzo)

CORBA usage and wrapping ideas learned from MIRO (Hans)

Page 2: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

Generic Robot Interfaces (GRI)• Object-Oriented to be modular and applied to

various scenarios• Comes with detailed documentation for

unambiguous usage by multiple users• End-User focused (“PanTilt” rather than

“CtrlMotor”, etc.)• Do not provide extra functions not supported

by represented objects (like “track object” in the camera interface)

• Close to CLARAty modules and capabilities• Supports functionalities of K9client, I_K10,

RoverCommander and scalable

Page 3: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

GRI usage in IRG

Currently refining the interface, will submit soon proposition to JPL

Experiment on K10 and replace current ICE network link

Replace K9client with CORBA & GRI (CLARAty DL/FL compatible)

Use GRI inside the Rover Controller itself for better component approach

T

Page 4: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

High Level Subsystems

Page 5: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

Access to Devices

Page 6: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

Data structures for Telemetry(Using Notification Service)

Page 7: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

Supporting Types

Page 8: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

Lessons from CORBA in other projects (MIRO)

• CORBA offers more than IPC.

• Valuable CORBA features:– Naming Service– Notification Service– Asynchronous Method Invocation

Page 9: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

Naming Service

Getting a reference (IOR) to a remote object.• Ad hoc: store in file, exchange via scp.• Object tree: Top level object provides

accessors for child interfaces / objects.• Naming Service: provides a map of names to

object references– Makes “top-level” interface unnecessary.– Structuring of name space possible

(subdirectories).

Page 10: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

disc disc

client

scp

object 1object 2

object 3

?

disc disc

client

scp

object 1

object 2

object 3

Name ServiceName 1,Name 2,Name 3,

disc disc

client

scp

object 1

object 2

object 3

1. Ad hoc

2. Object Tree

3. Naming Service

1.

2.

3.

Object Reference Acquisition

Page 11: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

Rather than using a hierarchy of interfaces (with brittle IDL), extensively advertising objects through the Naming Service keeps interfaces independent.

But it does require documenting object names outside of IDL.

Page 12: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

Notification Service

• Subscription management (header):– domain_name: robot name– type_name: event name

• Instance based event filtering (filterable_data):– Constraint language.

• Payload (remainder_of_body):– Telemetry

– Perception results …

Page 13: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

Asynchronous Message Invocation (AMI)

Problem:• Many physical operations take time.• Clients (i.e. DL) mostly require non-blocking

semantics.• But not always.AMI Solution:• Allowing to call a blocking operation as a non-

blocking one.• No changes on the server side required.• Client can use both access methods.

Page 14: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

Blocking Method Call(Direct CORBA)

Page 15: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

Non-Blocking Method Call(Using AMI)

Page 16: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

Client/Server Helper Classes

• Provide default configuration of the ORB• Generic helper methods

– Name Service operations– …

• Ease common operations– Object reference acquisition– Servant handling– AMI operations

Page 17: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

Client Side Wrappers

Hiding CORBA• Development

overhead:– Coding overhead– Debugging overhead

• Usage overhead:– Runtime overhead– Another possible

place to look for errors

Keeping CORBA optional• Cumbersome for non-

trivial interfaces:– Data structures– Exceptions

• Difficult for many features:– Naming Service ->

map<string, IOR>– Notification Service ->

reimplement a big spec?– AMI -> ???

Page 18: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

Simple Client Example// simple IDL interfaceinterface Foo{ long bar(in long p);};

// simple c++ clientvoid main (int argc, char * argv[]) { IRG::Client client(argc, argv); // client helper class // IOR resolution helper method (naming service) Foo_var foo = client.resolveName<Foo>("FooInstance1");

int rc = foo->bar(2); // method invocation}

Page 19: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

Simple Server Example

// servant implementationstruct FooImpl : public virtual POA_Foo { virtual int bar (int p) { return 2 * p; }};

// server implementationvoid main (int argc, char * argv[]) { IRG::Server server(argc, argv); // helper class FooImpl * foo_servant = new FooImpl(); // servant instance

// servant activation server.activate_named_object("FooInstance1", foo_servant);

server.run(); // server loop}

Page 20: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

AMI Client Examplevoid main (int argc, char * argv[]) { IRG::Server server(argc, argv); // helper class server.detach() // background thread for callback Foo_var foo = server.resolveName<Foo>("FooInstance1");

// AMI helper class IRG::Ami_Helper<IRG::AMI_Foo_bar> helper; // asynchoronous invocation // passing the callback as first parameter foo->sendc_bar(helper.handler()->_this(), 2); ... // do something else while (!helper.finished()); // busy wait till finished helper.wait(); // or wait till finished int rc = helper.result(); // retrieve return value}

Page 21: Ideas from ARC about the CORBA FL interface Interface ideas learned from K9 and K10 (Lorenzo) CORBA usage and wrapping ideas learned from MIRO (Hans)

Summary• Keep interfaces compact, user-focused, well-

mapped to FL capabilities.• Use Naming Service for interface

independence.• Use Notification Service for transport of

telemetry (including structs).• Use CORBA internally in FL.• Use AMI for non-blocking DL/FL calls.• Use wrappers sparingly.