Re: KinematicsInterface

Peter Soetens <[email protected]>
Newsgroups gmane.science.robotics.orocos.user
Organization KU Leuven
Message-ID <[email protected]>
On Friday 09 April 2004 15:12, Martin Lümkemann wrote:
> Hello Orocos-List!
>
> 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. A long term, maintainable 
solution would do this :

template<unsigned nOfJoints>
class KinematicsInterface { // pure virtuals without axis nr. };

class KinematicsNAxisInterface { 
// pure virtuals with axis nr. 
virtual bool positionForward( unsigned nbOfJoints, double[] q,
	ORO_Geometry::Frame& mp_base, Singularity& s ) const =0;
};

template<unsigned nOfJoints>
class KinematicsWrapperInterface 
   : public KinematicsInterface<nOfJoints>, public KinematicsNAxisInterface
{
virtual bool positionForward( const MultiVector<nOfJoints>& q,
	ORO_Geometry::Frame& mp_base, Singularity& s ) const 
	{
		return this->positionForward( nOfJoints, q.data, mp_base, s);
	}
};

where your implementation inherits from kinematicsWrapperInterface<6> and 
kinematicsWrapperInterface<N> for any additional calculation and only 
implements the KinematicsNAxisInterface methods.

thanks for your suggestions.

Peter
-- 
------------------------------------------------------------------------
Peter Soetens, Research Assistent                  http://www.orocos.org
Katholieke Universiteit Leuven
Division Production Engineering,                      tel. +32 16 322773
Machine Design and Automation                         fax. +32 16 322987
Celestijnenlaan 300B                   [email protected]
B-3001 Leuven Belgium                 http://www.mech.kuleuven.ac.be/pma
------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.