.*HPP* architecture: the functionalities are distributed into separate software packages. The architecture is composed of three types of packages: algorithms, CORBA interfaces and KPP-SDK interfaces.

image:figures/archi.png[HPP architecture]

*HPP* is composed of several software packages divided into three

groups as explained in the above figure:

* algorithms,

* Corba server

* KPP-interfaces

KPP-interface and Corba server should be considered as visualization

and debugging-testing tools. It is mostly important that packages

implementing path planning algorithms for humanoid robots are

independent from a given middleware (CORBA) and from a given GUI

(KineoPathPlanner). As a consequence, no CORBA::xxx attribute should

be in a class belonging to the algorithm part.

This simple principle will enable to easily insert the algorithmic

software packages into different middlewares (GenoM, RT-middleware for

instance).

Modularity

~~~~~~~~~~

Try to avoid developing huge packages including many

functions. Instead, build several small packages with simple

interfaces and easy to understand functionalities.

Example

^^^^^^^

Let us assume that you are developing a path planning algorithm and

you want to use quaternions to represent the orientations of

rigid-bodies.

* The first step consists in trying to find an existing implementation

of quaternions that you can use.

* Let us assume (this is very unlikeky) that you cannot find a good

implementation of quaternions, then, instead of developing

operations on quaternions in your path planning package, it is much

more clever to create a package that will handle quaternion

operations and to make your path planning package depend on

it. Later, other users will be able to use your quaternion package.

Level of generality

~~~~~~~~~~~~~~~~~~~

When you implement an algorithm, always ask yourself the question:

"Could my algorihtm be applied to applications more general than the

one I am dealing with?" If yes, try to make your algorithm take more

general input than your practical problem of today.

Example

^^^^^^^

Let us assume that you want to implement Newton algoritm to find a

root of a polynomial function. Your algorithm requires the derivative

of the polynomial. You can get an expression of a polynomial

derivative using the polynomial coefficients.

However, it would be more clever to develop the same algorithm taking

as input a function that might not be a polynomial. For that you can

define an abstract class:

[source,cc]

class Cmapping {

public:

virtual double value(double inParamter) = 0;

virtual double derivative(double inParamter) = 0;

};

make your Newton implementation take as input an object Cmapping and

then derive this class into a concrete polynomial class. Thus, your

algorithm can be used by other people wanting to find the root of

non-polynomial functions.

Humanoid robots

^^^^^^^^^^^^^^^

The algorithms we develop are mostly applied to one type of humanoid

robot: HRP2. It is therefore important to develop these algorithms in

such a way that they can be applied to any other humanoid robot. For

that developers should avoid to make too strong asumptions about the

robot structure. The abstract CjrlHumanoidDynamicRobot interface for

dynamic humanoid robots have been designed in this aim.

How to implement a new algorithm in HPP

----------------------------------------

To implement a new algorithm in HPP, you need to create new software

packages as described below. To create new software packages, we

advise developers to use perl script packageCreate.