7 #ifndef RB_KINEMATIC_CHAIN_H_
8 #define RB_KINEMATIC_CHAIN_H_
17 #include <Eigen/StdVector>
59 #if __cplusplus == 201103L
65 void ostrVec(std::ostream& ost, std::vector<T> vec_inp,
int width=12)
68 for(
auto& inp : vec_inp)
69 ost << std::right << std::setw(width) << inp;
90 axis_value = rb::math::MatrixX::Constant(8, 6, 0.0);
92 for (
int i = 0; i < 8; i++)
107 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
113 std::vector<rb::kin::Link*>& links,
117 std::string manufactor=
"None",
118 std::string model=
"None"
223 void tr2rpy(
const rb::math::Matrix4& m,
double& roll_z,
double& pitch_y,
double& yaw_x)
const;
224 void rpy2tr(
double& roll_z,
double& pitch_y,
double& yaw_x,
rb::math::Matrix4& tool_mat);
233 #endif // RB_KINEMATIC_CHAIN_H_
bool getTool(ArmPose &tool_pose) const
Get the HT matrix of the offset b/w the arm flange and equipped tool or end-effector.
Definition: kinematic_chain.cpp:133
IK_RESULT
A set of enumeration to present the result of inverse kinematics (IK)
Definition: kinematic_chain.h:27
rb::math::Matrix4 world_tcp_tf_
HT matrix of TCP with respected to world coordination.
Definition: kinematic_chain.h:214
A kinematics class for general serial links.
Definition: kinematic_chain.h:104
A struct variable for Tool Center Point (TCP) ArmPose storages the output of forward kinematic...
Definition: kinematic_chain.h:40
double x
Position of TCP (mm)
Definition: kinematic_chain.h:43
std::string model_
the model of the robot named by its manufactor
Definition: kinematic_chain.h:218
double a
Orientation of TCP (degree)
Definition: kinematic_chain.h:47
value 1
Definition: kinematic_chain.h:30
int getDOF(void) const
Get the degree of freedom of this kinematic chain.
Definition: kinematic_chain.cpp:170
value 4
Definition: kinematic_chain.h:33
int dof_
A integer indicates the degree of freedom.
Definition: kinematic_chain.h:211
std::array< bool, 8 > solution_check
check if having solution.
Definition: kinematic_chain.h:84
void setDOF(void)
Set the degree of freedom according to the property of links.
Definition: kinematic_chain.cpp:164
rb::math::Matrix4 getBase(void) const
Get the HT matrix of the working base of the robot arm.
Definition: kinematic_chain.cpp:154
Eigen::Matrix4d Matrix4
make Matrix4 as alias of Eigen::Matrix4d
Definition: matrix.h:20
Eigen::MatrixXd MatrixX
make MatrixX as alias of Eigen::MatrixXd
Definition: matrix.h:18
bool setTool(const ArmPose &tool_pose)
Set the HT matrix of the offset b/w the arm flange and equipped tool or end-effector.
Definition: kinematic_chain.cpp:118
double y
left and right
Definition: kinematic_chain.h:44
rb::math::Matrix4 getTCP(void) const
Get the HT matrix of TCP w.r.t world coordination.
Definition: kinematic_chain.cpp:159
rb::math::Vector3 gravity_
Gravity set as a vector.
Definition: kinematic_chain.h:215
rb::math::Matrix4 homoTrans(double &A, double &alpha, double &D, const double &theta)
Compute homogeneous transformation matrix for given link properties, and return the matrix...
Definition: kinematic_chain.cpp:180
Eigen::Vector3d Vector3
make Vector3 as alias of Eigen::Vector3d
Definition: matrix.h:23
double c
yaw
Definition: kinematic_chain.h:49
rb::math::MatrixX axis_value
Joints Angle of 8 solutions.
Definition: kinematic_chain.h:81
EIGEN_MAKE_ALIGNED_OPERATOR_NEW KinematicChain()
Default Constuctor.
Definition: kinematic_chain.cpp:42
value 2
Definition: kinematic_chain.h:31
std::array< bool, 8 > limit_check
check if over angle limit.
Definition: kinematic_chain.h:86
virtual IK_RESULT inverseKin(const rb::math::Matrix4 &world_tcp_tf, rb::math::VectorX &joints, ArmAxisValue &all_sols)=0
Compute inverse kinematics for given tranformation matrix of TCP in Cartesian coordination system...
rb::math::Matrix4 tool_tf_
HT matrix of TCP with respected to robot flange (last joint)
Definition: kinematic_chain.h:213
std::vector< rb::math::Matrix4 * > frames_
< A vector of HT matrix to the pose of each joint and TCP.
Definition: kinematic_chain.h:208
value 0
Definition: kinematic_chain.h:29
std::array< bool, 8 > singular_check
check if in singular point.
Definition: kinematic_chain.h:85
std::string manufactor_
the name of manufactor of the robot
Definition: kinematic_chain.h:217
value 3
Definition: kinematic_chain.h:32
std::vector< rb::kin::Link * > links_
A vector of Link class.
Definition: kinematic_chain.h:204
double b
pitch
Definition: kinematic_chain.h:48
virtual ArmPose forwardKin(const rb::math::VectorX &q, const bool update=true)
Compute forward Kinematics for given angle, update each joint value, and return current current posit...
Definition: kinematic_chain.cpp:84
std::ostream & operator<<(std::ostream &ost, const ArmPose &pose)
Overload << operator to print position & orientation in ArmPose.
Definition: kinematic_chain.cpp:24
void setBase(const rb::math::Matrix4 &base)
Set the Homogeneous Transformation matrix of the working base of the robot arm.
Definition: kinematic_chain.cpp:148
double z
up and down
Definition: kinematic_chain.h:45
A head file describe robot single link class.
virtual ~KinematicChain()
Destructor.
Definition: kinematic_chain.cpp:82
A struct variable for joints of robot arm ArmAxisValue storage the output of Inverse kinematic...
Definition: kinematic_chain.h:78
int fit
Use following method to find the fittest solution.
Definition: kinematic_chain.h:83
rb::math::Matrix4 base_tf_
HT matrix of robot base with respected to world coordination.
Definition: kinematic_chain.h:212
static const double GRAVITY
Constant to present value of gravity.
Definition: unit.h:28
Eigen::VectorXd VectorX
make VectorX as alias of Eigen::VectorXd
Definition: matrix.h:22