Re: KinematicsInterface
Herman Bruyninckx <[email protected]>
| Newsgroups | gmane.science.robotics.orocos.user |
|---|---|
| Message-ID | <Pine.LNX.4.44.0404152316420.25892-100000@srv04.mech.kuleuven.ac.be> |
On Wed, 14 Apr 2004, Peter Soetens wrote:
> On Friday 09 April 2004 15:12, Martin LÃŒmkemann wrote:
> > We are currently implementing the kinematics-inteface for a Mitsubishi
> > PA-10 which is a 7R(zxzxzxz)-arm.
> >
> > The KinematicsInterface only allows a Double6D for the joint-variables.
> >
> > For now we omit the last joint in our calculations, but wouldn't it be
> > necessary to parametrise the interface on the number of joints?
> >
> > e.g.: template<unsigned NumberOfJoints> class KinematicsInterface{...}
>
> Yes, this interface is limited to 6 joints, which is indeed not general
> enough. Your suggestion is not bad, but others give an extra parameter
> denoting the number of joints. Your suggestion is type safe, the other allows
> the same algoritm to do calculations for a variable number of joints (eg when
> the tool has an extra degree of freedom).
>
> Thanks to multiple inheritance, we can combine both.
I also prefer the virtual interface + inheritance approach.
[...]
> class KinematicsNAxisInterface {
> // pure virtuals with axis nr.
> virtual bool positionForward( unsigned nbOfJoints, double[] q,
> ORO_Geometry::Frame& mp_base, Singularity& s ) const =0;
But I do not like the number of joints to be part of the interface,
nor a "double[]" as argument; I prefer an interface that can be
strongly type-checked and that has no redundant information for which
programmers can easily make mistakes.
Or did I misread your piece of code?
Herman
PS I have adapted the API design document on the Orocos website, to
reflect this issue:
<http://www.orocos.org/documentation/deep-shallow-api.html>.
Please, let me know your comments!
--
K.U.Leuven, Mechanical Eng., Mechatronics & Robotics Research Group
<http://people.mech.kuleuven.ac.be/~bruyninc> Tel: +32 16 322480