CartesianImpedanceController.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <VirtualRobot/IK/DifferentialIK.h>
4 #include <VirtualRobot/Robot.h>
5 
8 
9 namespace armarx
10 {
12  {
13  public:
14  struct Config
15  {
16  Eigen::Vector3f desiredPosition;
18  Eigen::Vector3f Kpos;
19  Eigen::Vector3f Dpos;
20  Eigen::Vector3f Kori;
21  Eigen::Vector3f Dori;
22  Eigen::VectorXf Knull;
23  Eigen::VectorXf Dnull;
24  Eigen::VectorXf desiredJointPosition;
25  float torqueLimit;
26  };
27 
28  //state for debugging
29  struct Debug
30  {
31  float errorAngle;
32  float posiError;
33  Eigen::Vector3f tcpDesiredForce;
34  Eigen::Vector3f tcpDesiredTorque;
35  };
36 
37  private:
38  Eigen::VectorXf qpos;
39  Eigen::VectorXf qvel;
40  Eigen::VectorXf tcptwist;
41  Eigen::VectorXf nullqerror;
42  Eigen::VectorXf nullspaceTorque;
43  Eigen::VectorXf targetJointTorques;
44 
45  Eigen::MatrixXf I;
46 
47  VirtualRobot::DifferentialIKPtr ik;
48  VirtualRobot::RobotNodePtr tcp;
49 
50  const float lambda = 2;
51 
52  public:
54 
55  int bufferSize() const;
56  void initialize(const VirtualRobot::RobotNodeSetPtr& rns);
57  const Eigen::VectorXf&
58  run(const Config& cfg,
59  std::vector<const SensorValue1DoFActuatorTorque*> torqueSensors,
60  std::vector<const SensorValue1DoFActuatorVelocity*> velocitySensors,
61  std::vector<const SensorValue1DoFActuatorPosition*> positionSensors);
62  };
63 } // namespace armarx
armarx::CartesianImpedanceController::Config::Kori
Eigen::Vector3f Kori
Definition: CartesianImpedanceController.h:20
armarx::CartesianImpedanceController::Debug
Definition: CartesianImpedanceController.h:29
armarx::CartesianImpedanceController::Config::Knull
Eigen::VectorXf Knull
Definition: CartesianImpedanceController.h:22
armarx::CartesianImpedanceController::Config::desiredJointPosition
Eigen::VectorXf desiredJointPosition
Definition: CartesianImpedanceController.h:24
armarx::CartesianImpedanceController::Config::Dnull
Eigen::VectorXf Dnull
Definition: CartesianImpedanceController.h:23
armarx::CartesianImpedanceController::run
const Eigen::VectorXf & run(const Config &cfg, std::vector< const SensorValue1DoFActuatorTorque * > torqueSensors, std::vector< const SensorValue1DoFActuatorVelocity * > velocitySensors, std::vector< const SensorValue1DoFActuatorPosition * > positionSensors)
Definition: CartesianImpedanceController.cpp:41
armarx::CartesianImpedanceController
Definition: CartesianImpedanceController.h:11
armarx::CartesianImpedanceController::bufferSize
int bufferSize() const
Definition: CartesianImpedanceController.cpp:15
armarx::CartesianImpedanceController::Config::torqueLimit
float torqueLimit
Definition: CartesianImpedanceController.h:25
armarx::CartesianImpedanceController::Config::Dpos
Eigen::Vector3f Dpos
Definition: CartesianImpedanceController.h:19
armarx::CartesianImpedanceController::Config::desiredOrientation
Eigen::Quaternionf desiredOrientation
Definition: CartesianImpedanceController.h:17
armarx::CartesianImpedanceController::Config::Dori
Eigen::Vector3f Dori
Definition: CartesianImpedanceController.h:21
armarx::CartesianImpedanceController::Config::desiredPosition
Eigen::Vector3f desiredPosition
Definition: CartesianImpedanceController.h:16
ControlTarget1DoFActuator.h
armarx::CartesianImpedanceController::Debug::errorAngle
float errorAngle
Definition: CartesianImpedanceController.h:31
armarx::CartesianImpedanceController::Config
Definition: CartesianImpedanceController.h:14
armarx::CartesianImpedanceController::initialize
void initialize(const VirtualRobot::RobotNodeSetPtr &rns)
Definition: CartesianImpedanceController.cpp:21
armarx::CartesianImpedanceController::Debug::posiError
float posiError
Definition: CartesianImpedanceController.h:32
armarx::Quaternion< float, 0 >
armarx::CartesianImpedanceController::Debug::tcpDesiredForce
Eigen::Vector3f tcpDesiredForce
Definition: CartesianImpedanceController.h:33
armarx::CartesianImpedanceController::dbg
Debug dbg
Definition: CartesianImpedanceController.h:53
armarx::CartesianImpedanceController::Debug::tcpDesiredTorque
Eigen::Vector3f tcpDesiredTorque
Definition: CartesianImpedanceController.h:34
armarx::CartesianImpedanceController::Config::Kpos
Eigen::Vector3f Kpos
Definition: CartesianImpedanceController.h:18
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
SensorValue1DoFActuator.h