3#include "../navtypes.h"
4#include "ForwardArmKinematics.h"
18template <
unsigned int D,
unsigned int N>
41 const navtypes::Vectord<N>& currJointPos)
const {
58 const navtypes::Vectord<N>& jointAngles,
59 bool& success)
const {
60 double armLen = fk->getSegLens().sum();
61 if (eePos.norm() >= armLen) {
65 navtypes::Vectord<N> sol =
solve(eePos, jointAngles, success);
67 success = fk->satisfiesConstraints(sol);
69 return success ? sol : jointAngles;
89 virtual navtypes::Vectord<N>
solve(
const navtypes::Vectord<D>& eePos,
90 const navtypes::Vectord<N>& jointAngles,
91 bool& success)
const = 0;
A class that calculates the forward kinematics of an arm.
Definition ForwardArmKinematics.h:16
A class that calculates the inverse kinematics of an arm.
Definition InverseArmKinematics.h:19
virtual navtypes::Vectord< N > solve(const navtypes::Vectord< D > &eePos, const navtypes::Vectord< N > &jointAngles, bool &success) const =0
Solve for the joint angles that yield the given EE position.
virtual navtypes::Vectord< N > eePosToJointPos(const navtypes::Vectord< D > &eePos, const navtypes::Vectord< N > &jointAngles, bool &success) const
Solve for the joint angles that yield the given EE position.
Definition InverseArmKinematics.h:57
navtypes::Vectord< N > eePosToJointPos(const navtypes::Vectord< D > &eePos, const navtypes::Vectord< N > &currJointPos) const
Calculate the joint angles that yield the desired EE position.
Definition InverseArmKinematics.h:40
InverseArmKinematics(std::shared_ptr< const ForwardArmKinematics< D, N > > fk)
Construct an IK object.
Definition InverseArmKinematics.h:26