33 #ifndef DART_DYNAMICS_IKFAST_HPP_
34 #define DART_DYNAMICS_IKFAST_HPP_
38 #define IKFAST_HAS_LIBRARY
39 #include "dart/external/ikfast/ikfast.h"
146 const std::vector<std::size_t>& dofMap,
147 const std::vector<std::size_t>& freeDofMap,
148 const std::string& methodName =
"IKFast",
149 const Analytical::Properties&
properties = Analytical::Properties());
152 const std::vector<InverseKinematics::Analytical::Solution>&
computeSolutions(
153 const Eigen::Isometry3d& desiredBodyTf)
override;
157 Eigen::Isometry3d
computeFk(
const Eigen::VectorXd& parameters);
161 const std::vector<std::size_t>&
getDofs()
const override;
165 const std::vector<std::size_t>&
getFreeDofs()
const;
212 const IkReal* targetTranspose,
213 const IkReal* targetRotation,
215 ikfast::IkSolutionListBase<IkReal>& solutions)
220 const IkReal* parameters, IkReal* targetTranspose, IkReal* targetRotation)
243 mutable std::vector<std::size_t>
mDofs;
BodyPropPtr properties
Definition: SdfParser.cpp:80
A base class for IkFast-based analytical inverse kinematics classes.
Definition: IkFast.hpp:51
const std::vector< InverseKinematics::Analytical::Solution > & computeSolutions(const Eigen::Isometry3d &desiredBodyTf) override
Use this function to fill the entries of the mSolutions variable.
Definition: IkFast.cpp:399
virtual bool isConfigured() const
Returns true if this IkFast is ready to solve.
Definition: IkFast.cpp:288
const std::vector< std::size_t > & getFreeDofs() const
Returns the indices of the DegreeOfFreedoms that are part of the joints that IkFast solves but the va...
Definition: IkFast.cpp:282
std::array< IkReal, 9 > mTargetRotation
Cache data for the target rotation used by IKFast.
Definition: IkFast.hpp:251
virtual bool computeIk(const IkReal *targetTranspose, const IkReal *targetRotation, const IkReal *pfree, ikfast::IkSolutionListBase< IkReal > &solutions)=0
Computes the inverse kinematics solutions using the generated IKFast code.
virtual int getIkType() const =0
Returns the IK type.
virtual int getIkRealSize() const =0
Returns the size in bytes of the configured number type.
bool mConfigured
True if this IkFast is ready to solve.
Definition: IkFast.hpp:239
IkFast(InverseKinematics *ik, const std::vector< std::size_t > &dofMap, const std::vector< std::size_t > &freeDofMap, const std::string &methodName="IKFast", const Analytical::Properties &properties=Analytical::Properties())
Constructor.
Definition: IkFast.cpp:248
std::string getIkFastVersion2() const
Returns the IkFast version used to generate this file.
Definition: IkFast.cpp:358
std::size_t getNumFreeParameters2() const
Returns the number of free parameters users has to set apriori.
Definition: IkFast.cpp:294
virtual const char * getIkFastVersion()=0
Returns the IkFast version used to generate this file.
std::size_t getNumJoints2() const
Returns the total number of indices of the chane.
Definition: IkFast.cpp:300
std::vector< double > mFreeParams
Definition: IkFast.hpp:236
const std::string getKinematicsHash2() const
Returns a hash of all the chain values used for double checking that the correct IK is used.
Definition: IkFast.cpp:352
std::vector< std::size_t > mDofs
Indices of the DegreeOfFreedoms associated to the variable parameters of this IkFast.
Definition: IkFast.hpp:243
std::vector< std::size_t > mFreeDofs
Indices of the DegreeOfFreedoms associated to the free parameters of this IkFast.
Definition: IkFast.hpp:247
virtual int getNumFreeParameters() const =0
Returns the number of free parameters users has to set apriori.
virtual void configure() const
Configure IkFast.
Definition: IkFast.cpp:364
IkType
Inverse kinematics types supported by IkFast.
Definition: IkFast.hpp:57
@ TRANSLATION_3D
End effector origin reaches desired 3D translation.
Definition: IkFast.hpp:65
@ DIRECTION_3D
Direction on end effector coordinate system reaches desired direction.
Definition: IkFast.hpp:68
@ TRANSLATION_Y_AXIS_ANGLE_X_NORM_4D
End effector origin reaches desired 3D translation, manipulator direction needs to be orthogonal to z...
Definition: IkFast.hpp:121
@ UNKNOWN
Definition: IkFast.hpp:129
@ TRANSLATION_Y_AXIS_ANGLE_4D
End effector origin reaches desired 3D translation, manipulator direction makes a specific angle with...
Definition: IkFast.hpp:104
@ LOOKAT_3D
Direction on end effector coordinate system points to desired 3D position.
Definition: IkFast.hpp:75
@ ROTATION_3D
End effector reaches desired 3D rotation.
Definition: IkFast.hpp:62
@ TRANSLATION_Z_AXIS_ANGLE_4D
End effector origin reaches desired 3D translation, manipulator direction makes a specific angle with...
Definition: IkFast.hpp:109
@ TRANSLATION_Z_AXIS_ANGLE_Y_NORM_4D
End effector origin reaches desired 3D translation, manipulator direction needs to be orthogonal to z...
Definition: IkFast.hpp:127
@ TRANSLATION_DIRECTION_5D
End effector origin and direction reaches desired 3D translation and direction.
Definition: IkFast.hpp:80
@ TRANSLATION_XY_ORIENTATION_3D
2D translation along XY plane and 1D rotation around Z axis.
Definition: IkFast.hpp:89
@ TRANSFORM_6D
End effector reaches desired 6D transformation.
Definition: IkFast.hpp:59
@ RAY_4D
Ray on end effector coordinate system reaches desired global ray.
Definition: IkFast.hpp:71
@ TRANSLATION_XY_2D
End effector origin reaches desired XY translation position, Z is ignored.
Definition: IkFast.hpp:84
@ TRANSLATION_LOCAL_GLOBAL_6D
Local point on end effector origin reaches desired 3D global point.
Definition: IkFast.hpp:94
@ TRANSLATION_X_AXIS_ANGLE_4D
End effector origin reaches desired 3D translation, manipulator direction makes a specific angle with...
Definition: IkFast.hpp:99
@ TRANSLATION_X_AXIS_ANGLE_Z_NORM_4D
End effector origin reaches desired 3D translation, manipulator direction needs to be orthogonal to z...
Definition: IkFast.hpp:115
virtual int getNumJoints() const =0
Returns the total number of indices of the chane.
virtual int * getFreeParameters() const =0
Returns the indicies of the free parameters indexed by the chain joints.
IkType getIkType2() const
Returns the IK type.
Definition: IkFast.cpp:306
virtual const char * getKinematicsHash()=0
Returns a hash of all the chain values used for double checking that the correct IK is used.
virtual void computeFk(const IkReal *parameters, IkReal *targetTranspose, IkReal *targetRotation)=0
Computes the forward kinematics solutions using the generated IKFast code.
std::array< IkReal, 3 > mTargetTranspose
Cache data for the target translation used by IKFast.
Definition: IkFast.hpp:254
const std::vector< std::size_t > & getDofs() const override
Returns the indices of the DegreeOfFreedoms that are part of the joints that IkFast solves for.
Definition: IkFast.cpp:263
Eigen::Isometry3d computeFk(const Eigen::VectorXd ¶meters)
Computes forward kinematics given joint positions where the dimension is the same as getNumJoints2().
Definition: IkFast.cpp:447
Analytical is a base class that should be inherited by methods that are made to solve the IK analytic...
Definition: InverseKinematics.hpp:1051
The InverseKinematics class provides a convenient way of setting up an IK optimization problem.
Definition: InverseKinematics.hpp:76
bool wrapCyclicSolution(double currentValue, double lb, double ub, double &solutionValue)
Tries to wrap a single dof IK solution, from IKFast, in the range of joint limits.
Definition: IkFast.cpp:469
Definition: BulletCollisionDetector.cpp:65