Developing an implementation

This page provides specifications applicable to any implementation of the abstract interface.

Deriving abstract classes

The developer of an implementation needs to derive the abstract classes of the interface and to implement the pure virtual methods. Some classes need to be derived into several concrete classes. For instance CjrlJoint should be derived into FREEFLYER, ROTATION and TRANSLATION joints.

Inheritance of CjrlHumanoidDynamicRobot implementation

The implementation of CjrlHumanoidDynamicRobot should virtually inherit from the implementation of CjrlDynamicRobot

Types

Some types or classes need to be provided by the implementation. These types are:

  • vector3d to represent a 3D point or vector,
  • matrix3d to represent a 3 by 3 matrix (for inertia matrix),
  • matrix4d to represent an homogeneous matrix,
  • matrixNxP to represent matrices of any size.
Note
From the choices of these types will of course depend the compatibility between an implementation and a module using the interfaces.

Exporting the name of the classes

Let us assume that the package named impl1RobotDynamics provides an implementation of the abstract interface with:

To make these classes accessible to a user, the names of the classes should be exported in file impl1RobotDynamics/robotDynamicsImpl.h. This file should include the following line:

#ifndef ROBOT_DYNAMICS_IMPL_H
#define ROBOT_DYNAMICS_IMPL_H
/*
Include files defining implementation classes of the abstract interfaces
*/
#include "impl1RobotDynamics/impl1DynamicRobot.h"
#include "impl1RobotDynamics/impl1HumanoidDynamicRobot.h"
#include "impl1RobotDynamics/impl1FreeFlyerJoint.h"
#include "impl1RobotDynamics/impl1Rotation.h"
#include "impl1RobotDynamics/impl1Translation.h"
#include "impl1RobotDynamics/impl1Body.h"
#include "impl1RobotDynamics/impl1Hand.h"
typedef Cimpl1DynamicRobot CimplDynamicRobot;
typedef Cimpl1HumanoidDynamicRobot CimplHumanoidDynamicRobot;
typedef Cimpl1JointFreeFlyerJoint CimplJointFreeFlyer;
typedef Cimpl1JointRotation CimplJointRotation;
typedef Cimpl1JointTranslation CimplJointTranslation;
typedef Cimpl1Body CimplBody;
typedef Cimpl1Hand CimplHand;
#endif

Thus, by including this file, the user of the implementation has access to the definitions of the implementation classes and can use them without knowing the name of these classes.

Constructors

Each implementation of the abstract interface classes should include a constructor as specified in class CjrlRobotDynamicsObjectConstructor.