7#ifndef RB_KINEMATIC_CHAIN_H_
8#define RB_KINEMATIC_CHAIN_H_
18#include <Eigen/StdVector>
60#if __cplusplus == 201103L
66 void ostrVec(std::ostream& ost, std::vector<T> vec_inp,
int width=12)
69 for(
auto& inp : vec_inp)
70 ost << std::right << std::setw(width) << inp;
91 axis_value = rb::math::MatrixX::Constant(8, 6, 0.0);
93 for (
int i = 0; i < 8; i++)
108 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
114 std::vector<std::unique_ptr<rb::kin::Link>>& links,
118 std::string manufactor=
"None",
119 std::string model=
"None"
205 std::vector<std::unique_ptr<rb::kin::Link>>
links_;
208 std::vector<rb::math::Matrix4> frames_;
A kinematics class for general serial links.
Definition kinematic_chain.h:106
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:151
rb::math::Matrix4 getTCP(void) const
Get the HT matrix of TCP w.r.t world coordination.
Definition kinematic_chain.cpp:177
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:136
rb::math::Matrix4 getBase(void) const
Get the HT matrix of the working base of the robot arm.
Definition kinematic_chain.cpp:172
EIGEN_MAKE_ALIGNED_OPERATOR_NEW KinematicChain()
Default Constuctor.
Definition kinematic_chain.cpp:57
void setDOF(void)
Set the degree of freedom according to the property of links.
Definition kinematic_chain.cpp:182
virtual ~KinematicChain()
Destructor.
Definition kinematic_chain.cpp:100
std::vector< std::unique_ptr< rb::kin::Link > > links_
A vector of Link class.
Definition kinematic_chain.h:205
int dof_
A integer indicates the degree of freedom.
Definition kinematic_chain.h:210
rb::math::Vector3 gravity_
Gravity set as a vector.
Definition kinematic_chain.h:214
std::string manufactor_
the name of manufactor of the robot
Definition kinematic_chain.h:216
std::string model_
the model of the robot named by its manufactor
Definition kinematic_chain.h:217
rb::math::Matrix4 world_tcp_tf_
HT matrix of TCP with respected to world coordination.
Definition kinematic_chain.h:213
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 base_tf_
HT matrix of robot base with respected to world coordination.
Definition kinematic_chain.h:211
int getDOF(void) const
Get the degree of freedom of this kinematic chain.
Definition kinematic_chain.cpp:188
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:102
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:198
rb::math::Matrix4 tool_tf_
HT matrix of TCP with respected to robot flange (last joint)
Definition kinematic_chain.h:212
void setBase(const rb::math::Matrix4 &base)
Set the Homogeneous Transformation matrix of the working base of the robot arm.
Definition kinematic_chain.cpp:166
A head file describe robot single link class.
IK_RESULT
A set of enumeration to present the result of inverse kinematics (IK)
Definition kinematic_chain.h:29
@ IK_COMPLETE
value 0
Definition kinematic_chain.h:30
@ IK_ANGLE_LIMIT
value 2
Definition kinematic_chain.h:32
@ IK_NO_SOLUTION
value 1
Definition kinematic_chain.h:31
@ IK_SINGULAR
value 3
Definition kinematic_chain.h:33
@ IK_INPUT_INVALID
value 4
Definition kinematic_chain.h:34
std::ostream & operator<<(std::ostream &ost, const ArmPose &pose)
Overload << operator to print position & orientation in ArmPose.
Definition kinematic_chain.cpp:24
Eigen::Matrix4d Matrix4
make Matrix4 as alias of Eigen::Matrix4d
Definition matrix.h:21
Eigen::MatrixXd MatrixX
make MatrixX as alias of Eigen::MatrixXd
Definition matrix.h:19
Eigen::VectorXd VectorX
make VectorX as alias of Eigen::VectorXd
Definition matrix.h:23
Eigen::Vector3d Vector3
make Vector3 as alias of Eigen::Vector3d
Definition matrix.h:24
static const double GRAVITY
Constant to present value of gravity.
Definition unit.h:28
Robot Arm Library namespace.
Definition artic.cpp:13
A struct variable for joints of robot arm ArmAxisValue storage the output of Inverse kinematic.
Definition kinematic_chain.h:80
std::array< bool, 8 > limit_check
check if over angle limit.
Definition kinematic_chain.h:87
int fit
Use following method to find the fittest solution.
Definition kinematic_chain.h:84
rb::math::MatrixX axis_value
Joints Angle of 8 solutions.
Definition kinematic_chain.h:82
std::array< bool, 8 > singular_check
check if in singular point.
Definition kinematic_chain.h:86
std::array< bool, 8 > solution_check
check if having solution.
Definition kinematic_chain.h:85
A struct variable for Tool Center Point (TCP) ArmPose storages the output of forward kinematic.
Definition kinematic_chain.h:42
double y
left and right
Definition kinematic_chain.h:45
double c
yaw
Definition kinematic_chain.h:50
double z
up and down
Definition kinematic_chain.h:46
double b
pitch
Definition kinematic_chain.h:49
double x
Position of TCP (mm)
Definition kinematic_chain.h:44
double a
Orientation of TCP (degree)
Definition kinematic_chain.h:48