/usr/include/choreonoid-1.1/cnoid/src/Body/JointPath.h is in libcnoid-dev 1.1.0+dfsg-6.1+b4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | /**
\file
\brief The header file of the LinkPath and JointPath classes
\author Shin'ichiro Nakaoka
*/
#ifndef CNOID_BODY_JOINT_PATH_H_INCLUDED
#define CNOID_BODY_JOINT_PATH_H_INCLUDED
#include "LinkPath.h"
#include "InverseKinematics.h"
#include <cnoid/EigenTypes>
#include <boost/shared_ptr.hpp>
#include "exportdecl.h"
namespace cnoid {
class CNOID_EXPORT JointPath : public InverseKinematics
{
public:
JointPath();
JointPath(Link* base, Link* end);
JointPath(Link* end);
virtual ~JointPath();
bool find(Link* base, Link* end);
bool find(Link* end);
inline bool empty() const {
return joints.empty();
}
inline int numJoints() const {
return joints.size();
}
inline Link* joint(int index) const {
return joints[index];
}
inline Link* baseLink() const {
return linkPath.baseLink();
}
inline Link* endLink() const {
return linkPath.endLink();
}
inline bool isJointDownward(int index) const {
return (index >= numUpwardJointConnections);
}
inline void calcForwardKinematics(bool calcVelocity = false, bool calcAcceleration = false) const {
linkPath.calcForwardKinematics(calcVelocity, calcAcceleration);
}
void calcJacobian(Eigen::MatrixXd& out_J) const;
void setMaxIKerror(double e);
void setBestEffortIKMode(bool on);
// InverseKinematics Interface
virtual bool calcInverseKinematics(const Vector3& end_p, const Matrix3& end_R);
virtual bool hasAnalyticalIK() const;
bool calcInverseKinematics(
const Vector3& base_p, const Matrix3& base_R, const Vector3& end_p, const Matrix3& end_R);
protected:
virtual void onJointPathUpdated();
double maxIKerrorSqr;
bool isBestEffortIKMode;
private:
void initialize();
void extractJoints();
LinkPath linkPath;
std::vector<Link*> joints;
int numUpwardJointConnections;
};
typedef boost::shared_ptr<JointPath> JointPathPtr;
};
#endif
|