-
Notifications
You must be signed in to change notification settings - Fork 1
/
robot_controller.h
31 lines (25 loc) · 1.32 KB
/
robot_controller.h
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
#ifndef ROBOT_CONTROLLER_H
#define ROBOT_CONTROLLER_H
#include "tendon_robot.h"
#include <Eigen/Dense>
class BaseController
{
public:
BaseController(int freq);
~BaseController();
bool PathPlanningUpdate(TendonRobot & robot, const Eigen::MatrixXd & targetTendonLengthChange, const Eigen::VectorXd & targetSegLength,
Eigen::MatrixXd & framesTendonLengthChange, Eigen::VectorXd & framesSegLength);
private:
int calcFreq, updateFreq;
double qEpsilon; // small change in q when calculating numerical derivatives (Jacobian, curvature)
double jointLimitWeight; // Damping for JTJ matrix inverse close to singularity
double stepSize;
double taskWeightSegLen, taskWeightCurv; // Sub-task (joint limit) weight, specific to each robot config
double PGainTendon, PGainBbone; // Proportional gain
double posAccuReq, oriAccuReq; // Position and orientation accuracy requirement
Eigen::Matrix4d MatrixLog(const Eigen::Matrix4d & T, double & theta);
void UnpackRobotConfig(TendonRobot & robot, int numTendon, const Eigen::VectorXd & q_cur,
Eigen::MatrixXd & curTendonLengthChange, Eigen::VectorXd & curSegLength); // Unpack q to segment parameter matrices
void RoundValues(Eigen::VectorXd & vals, double precision);
};
#endif // ROBOT_CONTROLLER_H