-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathKinematics.h
More file actions
51 lines (41 loc) · 1.18 KB
/
Kinematics.h
File metadata and controls
51 lines (41 loc) · 1.18 KB
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
#ifndef RCS_IK_H
#define RCS_IK_H
#include <Eigen/Eigen>
#include <Eigen/Geometry>
#include <memory>
#include <optional>
#include <string>
#include "Pose.h"
#include "pinocchio/algorithm/jacobian.hpp"
#include "pinocchio/algorithm/joint-configuration.hpp"
#include "pinocchio/algorithm/kinematics.hpp"
#include "utils.h"
namespace rcs {
namespace common {
class Kinematics {
public:
virtual ~Kinematics(){};
virtual std::optional<VectorXd> inverse(
const Pose& pose, const VectorXd& q0,
const Pose& tcp_offset = Pose::Identity()) = 0;
virtual Pose forward(const VectorXd& q0, const Pose& tcp_offset) = 0;
};
class Pin : public Kinematics {
private:
const double eps = 1e-4;
const int IT_MAX = 1000;
const double DT = 1e-1;
const double damp = 1e-6;
int FRAME_ID;
pinocchio::Model model;
pinocchio::Data data;
public:
Pin(const std::string& path, const std::string& frame_id, bool urdf);
std::optional<VectorXd> inverse(
const Pose& pose, const VectorXd& q0,
const Pose& tcp_offset = Pose::Identity()) override;
Pose forward(const VectorXd& q0, const Pose& tcp_offset) override;
};
} // namespace common
} // namespace rcs
#endif // RCS_IK_H