RobotArmLib 0.0.6
Robot Arm Library [WIP]
Loading...
Searching...
No Matches
artic.h
Go to the documentation of this file.
1
7#ifndef RB_ARTIC_H_
8#define RB_ARTIC_H_
9
10#include "kinematic_chain.h"
11
12
13namespace rb
14{
15namespace kin
16{
17// Class of kinematics of articulated (6-axis) robot arm
22class Artic : public KinematicChain
23{
24public:
26 Artic();
27
29 Artic(
30 const rb::math::VectorX& a0,
31 const rb::math::VectorX& alpha0,
32 const rb::math::VectorX& d0,
33 const rb::math::VectorX& ini_theta,
34 const rb::math::VectorX& uplimit0,
35 const rb::math::VectorX& lowlimit0
36 );
37
39 Artic(
40 std::vector<std::unique_ptr<rb::kin::Link>>& links,
41 rb::math::Matrix4 base=rb::math::Matrix4::Identity(),
42 rb::math::Matrix4 tool=rb::math::Matrix4::Identity(),
44 std::string manufactor="None",
45 std::string model="None"
46 );
47
49 ~Artic();
50
58 ArmPose forwardKin(const rb::math::VectorX& q, const bool update=true) override;
59
66 const rb::math::Matrix4& world_tcp_tf,
67 rb::math::VectorX& joints,
68 ArmAxisValue& all_sols
69 ) override;
70
77 const double& x,
78 const double& y,
79 const double& z,
80 const double& roll,
81 const double& pitch,
82 const double& yaw,
83 rb::math::VectorX& joints,
84 ArmAxisValue& all_sols
85 );
86
96 void solvePitchPitchIK(const double& th1_rad, const rb::math::Vector4& p0,
97 const std::vector<bool>& config,
98 ArmAxisValue& all_sols);
99
108 void solveRowPitchRowIK(const double& th1_rad, const std::vector<bool>& config,
109 const rb::math::Matrix4& flange_tr,
110 ArmAxisValue& all_sols);
111
117
124 void preCheck(const int& njoint, double& rad);
125
130 ArmPose getArmPose(void) const;
131
136 rb::math::VectorX getA(void) const;
137
142 rb::math::VectorX getAlpha(void) const;
143
148 rb::math::VectorX getD(void) const;
149
154 rb::math::VectorX getTheta(void) const;
155
160 void setUpLimit(rb::math::VectorX& up_lim);
161
166 rb::math::VectorX getUpLimit(void) const;
167
172 void setLowLimit(rb::math::VectorX& low_lim);
173
178 rb::math::VectorX getLowLimit(void) const;
179
184 rb::kin::ArmPose getJointPos(const int& jnt);
185
190 rb::math::Matrix4 getJointFrame(const int& jnt);
191
192protected:
203
204private:
205 rb::math::VectorX ini_theta_;
206 rb::math::VectorX pre_theta_;
207 rb::math::Matrix4 base_tcp_tf_;
208 ArmPose tcp_pose_;
209 int pre_fit_solution_;
210};
211
212} // namespace kin
213} // namespace rb
214
215#endif // RB_ARTIC_H_
A kinematics class for articulated (6-axis) robot arm Artic implement the kinematics of articulated (...
Definition artic.h:23
IK_RESULT solutionCheck(ArmAxisValue &sols)
Find the solutions in all_sols that is most fit to previous joints value.
Definition artic.cpp:711
ArmPose forwardKin(const rb::math::VectorX &q, const bool update=true) override
Compute forward Kinematics for given angle, update each joint value, and return current current posit...
Definition artic.cpp:296
rb::math::VectorX low_lim_
Lower limit of all joints.
Definition artic.h:202
rb::math::VectorX getLowLimit(void) const
Get the lower limits of joint angles of the robot arm.
Definition artic.cpp:856
void setLowLimit(rb::math::VectorX &low_lim)
Set the lower limits of joint angles for the robot arm.
Definition artic.cpp:850
rb::math::VectorX getA(void) const
Get the link length a value between each joint of the robot arm.
Definition artic.cpp:819
rb::math::VectorX up_lim_
Upper limit of all joints.
Definition artic.h:201
rb::math::VectorX getAlpha(void) const
Get the link twist value between each joint of the robot arm.
Definition artic.cpp:824
rb::math::VectorX a
Link length data member of modified D-H parameter for robot arm.
Definition artic.h:194
void preCheck(const int &njoint, double &rad)
Check the value of individual joint depend join limits.
Definition artic.cpp:792
~Artic()
Destructor.
Definition artic.cpp:293
IK_RESULT inverseKin(const rb::math::Matrix4 &world_tcp_tf, rb::math::VectorX &joints, ArmAxisValue &all_sols) override
Compute inverse kinematics for given transformation matrix of TCP in Cartesian coordination system.
Definition artic.cpp:337
void solveRowPitchRowIK(const double &th1_rad, const std::vector< bool > &config, const rb::math::Matrix4 &flange_tr, ArmAxisValue &all_sols)
Compute inverse kinematics for wrist mechanism (row-pitch-row) structure by given first joint.
Definition artic.cpp:640
rb::math::VectorX alpha
Link twist data member of modified D-H parameter for robot arm.
Definition artic.h:196
rb::math::VectorX theta
Joint angle data member of modified D-H parameter for robot arm.
Definition artic.h:200
void setUpLimit(rb::math::VectorX &up_lim)
Set the upper limits of joint angles for the robot arm.
Definition artic.cpp:839
void solvePitchPitchIK(const double &th1_rad, const rb::math::Vector4 &p0, const std::vector< bool > &config, ArmAxisValue &all_sols)
Compute inverse kinematics for two links (pitch-pitch) structure by given first joint.
Definition artic.cpp:572
rb::math::Matrix4 getJointFrame(const int &jnt)
Get the HT matrix of the certain robot joint.
Definition artic.cpp:875
rb::math::VectorX d
Link offset data member of modified D-H parameter for robot arm.
Definition artic.h:198
rb::math::VectorX getUpLimit(void) const
Get the upper limits of joint angles of the robot arm.
Definition artic.cpp:845
ArmPose getArmPose(void) const
Get the position and orientation of the flange of robot arm.
Definition artic.cpp:814
rb::kin::ArmPose getJointPos(const int &jnt)
Get the position and orientation of the certain robot joint.
Definition artic.cpp:861
rb::math::VectorX getD(void) const
Get the link offset d value between each joint of the robot arm.
Definition artic.cpp:829
rb::math::VectorX getTheta(void) const
Get the joint angle value of each joint of the robot arm.
Definition artic.cpp:834
Artic()
Default Constructor.
Definition artic.cpp:30
A kinematics class for general serial links.
Definition kinematic_chain.h:106
A header file for the class of general kinematic chain.
IK_RESULT
A set of enumeration to present the result of inverse kinematics (IK)
Definition kinematic_chain.h:29
Eigen::Matrix4d Matrix4
make Matrix4 as alias of Eigen::Matrix4d
Definition matrix.h:21
Eigen::VectorXd VectorX
make VectorX as alias of Eigen::VectorXd
Definition matrix.h:23
Eigen::Vector4d Vector4
make Vector4 as alias of Eigen::Vector4d
Definition matrix.h:25
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
A struct variable for Tool Center Point (TCP) ArmPose storages the output of forward kinematic.
Definition kinematic_chain.h:42