Defining object APIs

Translate This Thread From English to

Threaded View
OK, I'm working on an API for a robotics system, my strategy is to define a
small workable API that is extensible. The robot will be divided into
logical functional objects of varying levels of complexity.


The first object I am thinking about is the robot "base." Imagine you had a
simplified API to a robotic base. The base may be legged, wheeled,
pogo-sticked, or overcraft it should not matter.

What is a reasonable control structure for such an API?

Velocity:
set velocity
Set vector/curve?

Position:
move to position
report estimated position
move to position at speed


Do I build more functionality than that into the base, instead relying on
higher level objects to control the base?

What do you think?

Re: Defining object APIs


We went with:

define endpoints

make endpoints advertised across the network

use broadcast to transmit data to all recipients.

use point-to-point to send the data back.

Then you just name an endpoint as "Left_Motor_Velocity", send a value to
it, and that sets the corresponding thing on the robot.

cheers, Rich.

--
rich walker         |  Shadow Robot Company | rw@shadow.org.uk
technical director     251 Liverpool Road   |
need a Hand?           London  N1 1LX       | +UK 20 7700 2487
www.shadow.org.uk/products/newhand.shtml

Re: Defining object APIs

"mlw"

Download and read the JAUS specification documents. There are a couple of
them, but the last one I think (the one that really defines the
communication messages) is pretty complete and will give you lots of
insights. They have a common API for all you mentioned and something more.
I did not use their API (messaging structure), but I got some pretty good
ideas from their documentation. They've been working on the specification of
JAUS for quite some time now.

Cheers

Padu



Site Timeline