We propose in the following header files abstract interfaces to define a robot with dynamics. The goal is to provide a standard within JRL developments in order to make packages dealing with humanoid robots compatible with each other.
Packages using robot dynamics are guaranted to be compatible to any package implementing the abstract interfaces, as long as they use the classes defined here.
In object oriented programming, one cannot construct an object of an abstract class. Therefore, to create a concrete instance of an abstract class, one needs to choose which derived class (i.e. which implementation) one wants to use.
Let us consider the following example: a user wants to create a dynamic robot defined by the abstract interface. The user thus needs to choose which implementation of the abstract interface he is going to use. Let us assume that two implementations are available:
To choose implementation 1, the user will create an object of class Cimpl1DynamicRobot:
This seems very simple and reasonable. However, to build the kinematic chain of the robot, the user will then create joints, bodies and for each such operation, he will construct an object of implementation 1:
We now see that several instructions are specific to implementation 1. This makes it then more difficult to choose another implementation.
To solve this problem, we have defined a template class CjrlRobotDynamicsObjectConstructor that takes as template parameters the name of the classes defined by the implementation. The user of the abstract interface only needs to write the following lines in his source code:
This line is the only one that is specific to implementation 1 of the interface.
To create any object of implementation 1 of the abstract interface, the user indeed writes:
where no reference of implementation 1 appears.
By constructing objects using the template class defined in the above section and by calling only virtual methods defined in the interface classes, the user can
A developer implementing classes deriving from the abstract interface classes can share his work with the user of the above section.
For precise specification on how to provide an implementation, Go to this page