CollisionAvoidance.h
Go to the documentation of this file.
1 /**
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @author Jianfeng Gao ( jianfeng dot gao at kit dot edu )
17  * @date 2021
18  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19  * GNU General Public License
20  */
21 
22 #pragma once
23 
24 #include <VirtualRobot/IK/DifferentialIK.h>
25 #include <VirtualRobot/Robot.h>
26 
28 
31 
32 #include <armarx/control/common/control_law/aron/CollisionAvoidanceConfig.aron.generated.h>
35 #include <armarx/control/common/ft/aron/FTConfig.aron.generated.h>
36 
37 #include <simox/control/environment/CollisionRobot.h>
38 #include <simox/control/geodesics/metric/inertia.h>
39 #include <simox/control/impl/simox/robot/Robot.h>
40 #include <simox/control/robot/NodeInterface.h>
41 
43 {
44  namespace helper
45  {
46  /// helper functions
47  Eigen::Vector4f calculateTransitionWeights(float z1, float z2);
48  } // namespace helper
49 
50  namespace collision
51  {
52  void validateConfigData(arondto::CollisionAvoidanceConfig& cfg);
53  }
54 
55  /*
56  * This class should be used for one kinematric chain / robot node set
57  */
59  {
60  public:
61  using InertiaPtr = std::shared_ptr<simox::control::geodesics::metric::Inertia>;
62  using DistanceResults = std::vector<::simox::control::environment::DistanceResult>;
63  using DistanceResultsPtr = std::shared_ptr<DistanceResults>;
64  using SimoxRobotPtr = std::shared_ptr<simox::control::simox::robot::Robot>;
65  using FTConfig = common::ft::arondto::FTConfig;
66  using Config = common::control_law::arondto::CollisionAvoidanceConfig;
67 
69  {
70  /// the distances and projected jacobians from the generateSelfCollisionTorque() method
71  /// are needed for the null space calculation
72  std::string nodeName = ""; // for debugging
73  std::string otherName = ""; // for debugging
74  Eigen::MatrixXf jacobian;
75  float minDistance = -1.0f;
76 
77  // Debugging values
78  float repulsiveForce = -1.0f;
79  float localStiffness = -1.0f;
80  Eigen::VectorXf projectedJacT;
81  float distanceVelocity = -1.0f;
82  Eigen::Vector3f direction = Eigen::Vector3f::Zero();
83  Eigen::Vector3f point = Eigen::Vector3f::Zero();
84  float damping = -1.0f;
85  float projectedMass = -1.0f;
86  float desiredNSColl = -1.0f;
87 
88  // mapped back from joint space with projectedJac pinv
89  float projectedImpedanceForce = -1.0f;
90 
91  SelfCollisionData(int size) :
92  jacobian(Eigen::MatrixXf::Zero(size, size)),
93  projectedJacT(Eigen::VectorXf::Zero(size))
94  {
95  }
96 
97  void
99  {
100  nodeName = "";
101  otherName = "";
102  jacobian.setZero();
103  projectedJacT.setZero();
104  direction.setZero();
105  point.setZero();
106  minDistance = -1.0f;
107  repulsiveForce = -1.0f;
108  localStiffness = -1.0f;
109  distanceVelocity = -1.0f;
110  damping = -1.0f;
111  projectedMass = -1.0f;
112  desiredNSColl = -1.0f;
113  projectedImpedanceForce = -1.0f;
114  }
115 
116  void
117  setDistValues(std::string nodeName, std::string otherName, float minDistance)
118  {
119  this->nodeName = nodeName;
120  this->otherName = otherName;
121  this->minDistance = minDistance;
122  }
123 
124  void
125  setCalcValues(const Eigen::MatrixXf& jacobian,
126  float repulsiveForce,
127  float localStiffness,
128  const Eigen::VectorXf& projectedJacT,
129  float distanceVelocity,
130  const Eigen::Vector3f& direction,
131  const Eigen::Vector3f& point,
132  float damping,
133  float projectedMass,
134  float desiredNSColl)
135  {
136  this->jacobian = jacobian;
137  this->repulsiveForce = repulsiveForce;
138  this->localStiffness = localStiffness;
139  this->projectedJacT = projectedJacT;
140  this->distanceVelocity = distanceVelocity;
141  this->direction = direction;
142  this->point = point;
143  this->damping = damping;
144  this->projectedMass = projectedMass;
145  this->desiredNSColl = desiredNSColl;
146  }
147  };
148 
150  {
151  /// for each joint, that has a limit, based on the config parameters:
152  /// jointRangeBufferZone
153  /// jointRangeBufferZone_z1
154  /// jointRangeBufferZone_z2
155  ///
156  /// the specific values depending on the joint range of each joint have to
157  /// be calculated (and stored, so the calculation is only done in the init)
158  std::string jointName = "";
159  bool isLimitless = false;
160  float qLimLow = 0.0f;
161  float qLimHigh = 0.0f;
162  float thresholdRange = 0.0f;
163  float qposThresholdLow = 0.0f; // unique for each joint in rep. torque function
164  float qposThresholdHigh = 0.0f;
165  /// null space parameters
166  float qposZ1Low = 0.0f;
167  float qposZ2Low = 0.0f;
168  float qposZ1High = 0.0f;
169  float qposZ2High = 0.0f;
170  Eigen::Vector4f jointLimitNullSpaceWeightsLow = Eigen::Vector4f::Zero();
171  Eigen::Vector4f jointLimitNullSpaceWeightsHigh = Eigen::Vector4f::Zero();
172  float desiredNSjointLim = 0.0f;
173  float repulsiveTorque = 0.0f;
174  float totalDamping = 0.0f;
175  };
176 
177  /// internal status of the controller, containing intermediate variables, mutable targets
179  {
180  public:
181  /// targets
182  Eigen::VectorXf desiredJointTorques;
183 
185 
186  Eigen::Vector3f dirErrorImp;
190 
191  /// intermediate torque results
192  Eigen::VectorXf impedanceJointTorque;
193  Eigen::VectorXf kdImpedanceTorque;
194  Eigen::VectorXf selfCollisionJointTorque;
195  Eigen::VectorXf jointLimitJointTorque;
196 
198  Eigen::VectorXf jointLimitTorqueFiltered;
199 
200  /// intermediate projected torques via null space matrices
201  Eigen::VectorXf projImpedanceJointTorque;
202  Eigen::VectorXf projSelfCollJointTorque;
203  Eigen::VectorXf projJointLimJointTorque;
204 
207 
208  /// intermediate null space matrices (self-collision and joint limit avoidance)
209  Eigen::MatrixXf selfCollNullSpace;
210  Eigen::MatrixXf jointLimNullSpace;
212 
213  Eigen::MatrixXf selfCollNullSpaceFiltered;
214  Eigen::MatrixXf jointLimNullSpaceFiltered;
215 
216  /// self-collision avoidance initialization parameters
218 
219  /// self-collision avoidance intermediate results
220  const simox::control::robot::NodeInterface* node;
224  unsigned int node1Index;
225  unsigned int node2Index;
226 
227  /// distance results
228  simox::control::environment::DistanceResult activeDistPair;
229  std::vector<SelfCollisionData> selfCollDataVec;
230  std::vector<SelfCollisionData> evalData;
232 
233  /// self-collision avoidance null space intermediate results
234  float k1, k2, k3, k4;
235  Eigen::VectorXf normalizedJacT;
236  Eigen::MatrixXf tempNullSpaceMatrix;
237 
238  /// joint limit avoidance initialization parameters
239 
240  // TODO rename to jointLimitDataVec
241  std::vector<JointRangeBufferZoneData> jointLimitData;
242 
243  /// joint limit avoidance intermediate results
244  float jointVel;
246 
249 
250  float k1Lo, k2Lo, k3Lo, k4Lo;
251  float k1Hi, k2Hi, k3Hi, k4Hi;
252 
253  /// others
254  Eigen::MatrixXf inertia;
255  Eigen::MatrixXf inertiaInverse;
256 
257  /// time status
264 
265  /// collision pair info
268 
269 
270  // /// other actuated joint debug info
271  // float torsoJointValuef;
272  // float neck1JointValuef;
273  // float neck2JointValuef;
274  // double torsoJointValued;
275  // double neck1JointValued;
276  // double neck2JointValued;
277  // Eigen::VectorXd setActuatedJointValues;
278  // Eigen::VectorXd getActuatedJointValues;
279 
280  void reset(const Config& c,
281  const unsigned int nDoF,
282  const unsigned int maxCollisionPairs,
283  VirtualRobot::RobotNodeSetPtr& rns);
284  void rtPreActivate(){};
285 
286  private:
287  void initJointLimtDataVec(const Config& c,
288  const unsigned int nDoF,
289  VirtualRobot::RobotNodeSetPtr& rns);
290  };
291 
292  unsigned int numOfJoints; // for nonRT use case
293  VirtualRobot::RobotNodeSetPtr rtRNS;
294 
295  private:
296  std::atomic_bool enablePreactivateInit{false};
297 
298  Eigen::MatrixXf I;
299 
300  // VirtualRobot::DifferentialIKPtr ik;
301 
302  // const float lambda = 2.0f;
303 
304  simox::control::robot::NodeSetInterface* simoxNodeSet;
305 
306 
307  /// avoidance torque methods
308  void calculateSelfCollisionTorque(Config& c,
309  RtStatusForSafetyStrategy& rtStatus,
310  DistanceResultsPtr collisionPairs,
311  std::shared_ptr<std::vector<int>> pointsOnArm,
312  int pointsOnArmIndex,
313  std::vector<std::string> selfCollisionNodes,
314  Eigen::VectorXf& qvelFiltered);
315  void calculateJointLimitTorque(Config& c,
316  RtStatusForSafetyStrategy& rtStatus,
317  Eigen::VectorXf& qpos,
318  Eigen::VectorXf& qvelFiltered);
319 
320  /// caclulate null spaces
321  void calculateSelfCollisionNullspace(Config& c, RtStatusForSafetyStrategy& rtStatus);
322  void calculateJointLimitNullspace(Config& c,
323  RtStatusForSafetyStrategy& rtStatus,
324  Eigen::VectorXf& qpos);
325 
326  public:
327  CollisionAvoidanceController(const VirtualRobot::RobotNodeSetPtr& rtRns);
328 
330 
331  void initialize(SimoxRobotPtr& simoxControlRobot);
332  void preactivateInit(Config& c, RtStatusForSafetyStrategy& rtStatus);
333 
334  void run(Config& c,
335  RtStatusForSafetyStrategy& robotStatus,
336  DistanceResultsPtr& collisionPairs,
337  std::shared_ptr<std::vector<int>>& pointsOnArm,
338  int pointsOnArmIndex,
339  InertiaPtr& inertiaInstance,
340  std::vector<std::string>& selfCollisionNodes,
341  Eigen::VectorXf& qpos,
342  Eigen::VectorXf& qvelFiltered,
343  float torqueLimit);
344  };
345 } // namespace armarx::control::common::control_law
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::jointLimitData
std::vector< JointRangeBufferZoneData > jointLimitData
joint limit avoidance initialization parameters
Definition: CollisionAvoidance.h:241
armarx::control::common::control_law::CollisionAvoidanceController::SelfCollisionData::desiredNSColl
float desiredNSColl
Definition: CollisionAvoidance.h:86
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::impTorqueRatio
float impTorqueRatio
Definition: CollisionAvoidance.h:205
Eigen
Definition: Elements.h:36
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::localTransformation
simox::control::Pose localTransformation
Definition: CollisionAvoidance.h:221
armarx::control::common::control_law::CollisionAvoidanceController::JointRangeBufferZoneData::totalDamping
float totalDamping
Definition: CollisionAvoidance.h:174
armarx::control::common::control_law::CollisionAvoidanceController::JointRangeBufferZoneData::qLimHigh
float qLimHigh
Definition: CollisionAvoidance.h:161
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::dampingJointLim
float dampingJointLim
Definition: CollisionAvoidance.h:248
armarx::control::common::control_law::CollisionAvoidanceController::JointRangeBufferZoneData::jointName
std::string jointName
for each joint, that has a limit, based on the config parameters: jointRangeBufferZone jointRangeBuff...
Definition: CollisionAvoidance.h:158
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::tempNullSpaceMatrix
Eigen::MatrixXf tempNullSpaceMatrix
Definition: CollisionAvoidance.h:236
armarx::control::common::control_law::CollisionAvoidanceController::SelfCollisionData::projectedImpedanceForce
float projectedImpedanceForce
Definition: CollisionAvoidance.h:89
armarx::control::common::control_law::CollisionAvoidanceController::SelfCollisionData::clearValues
void clearValues()
Definition: CollisionAvoidance.h:98
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::k4Hi
float k4Hi
Definition: CollisionAvoidance.h:251
armarx::navigation::core::Pose
Eigen::Isometry3f Pose
Definition: basic_types.h:31
armarx::control::common::control_law::collision::validateConfigData
void validateConfigData(arondto::CollisionAvoidanceConfig &cfg)
Definition: CollisionAvoidance.cpp:1616
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::jointLimitJointTorque
Eigen::VectorXf jointLimitJointTorque
Definition: CollisionAvoidance.h:195
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::k2
float k2
Definition: CollisionAvoidance.h:234
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::node2OnArm
bool node2OnArm
Definition: CollisionAvoidance.h:223
common.h
armarx::control::common::control_law::CollisionAvoidanceController::SelfCollisionData::localStiffness
float localStiffness
Definition: CollisionAvoidance.h:79
armarx::control::common::control_law::CollisionAvoidanceController::DistanceResults
std::vector<::simox::control::environment::DistanceResult > DistanceResults
Definition: CollisionAvoidance.h:62
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::projImpedanceJointTorque
Eigen::VectorXf projImpedanceJointTorque
intermediate projected torques via null space matrices
Definition: CollisionAvoidance.h:201
armarx::control::common::control_law::CollisionAvoidanceController::FTConfig
common::ft::arondto::FTConfig FTConfig
Definition: CollisionAvoidance.h:65
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::node2Index
unsigned int node2Index
Definition: CollisionAvoidance.h:225
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::dirErrorImp
Eigen::Vector3f dirErrorImp
Definition: CollisionAvoidance.h:186
armarx::control::common::control_law::CollisionAvoidanceController::DistanceResultsPtr
std::shared_ptr< DistanceResults > DistanceResultsPtr
Definition: CollisionAvoidance.h:63
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::k4Lo
float k4Lo
Definition: CollisionAvoidance.h:250
armarx::control::common::control_law::CollisionAvoidanceController::SelfCollisionData::repulsiveForce
float repulsiveForce
Definition: CollisionAvoidance.h:78
FTSensor.h
armarx::control::common::control_law::CollisionAvoidanceController::SelfCollisionData::projectedJacT
Eigen::VectorXf projectedJacT
Definition: CollisionAvoidance.h:80
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::desiredJointTorques
Eigen::VectorXf desiredJointTorques
targets
Definition: CollisionAvoidance.h:182
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::projJointLimJointTorque
Eigen::VectorXf projJointLimJointTorque
Definition: CollisionAvoidance.h:203
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::normalizedJacT
Eigen::VectorXf normalizedJacT
Definition: CollisionAvoidance.h:235
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::selfCollisionJointTorque
Eigen::VectorXf selfCollisionJointTorque
Definition: CollisionAvoidance.h:194
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::activeDistPair
simox::control::environment::DistanceResult activeDistPair
distance results
Definition: CollisionAvoidance.h:228
armarx::control::common::control_law::CollisionAvoidanceController::JointRangeBufferZoneData::qposZ1Low
float qposZ1Low
null space parameters
Definition: CollisionAvoidance.h:166
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::inertia
Eigen::MatrixXf inertia
others
Definition: CollisionAvoidance.h:254
armarx::control::common::control_law::CollisionAvoidanceController::SelfCollisionData::jacobian
Eigen::MatrixXf jacobian
Definition: CollisionAvoidance.h:74
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::preFilterTime
double preFilterTime
Definition: CollisionAvoidance.h:259
armarx::control::common::control_law::CollisionAvoidanceController::JointRangeBufferZoneData::qposThresholdHigh
float qposThresholdHigh
Definition: CollisionAvoidance.h:164
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::selfCollNullSpace
Eigen::MatrixXf selfCollNullSpace
intermediate null space matrices (self-collision and joint limit avoidance)
Definition: CollisionAvoidance.h:209
armarx::control::common::control_law::CollisionAvoidanceController::SelfCollisionData::direction
Eigen::Vector3f direction
Definition: CollisionAvoidance.h:82
armarx::control::common::control_law::CollisionAvoidanceController::SelfCollisionData::projectedMass
float projectedMass
Definition: CollisionAvoidance.h:85
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::projSelfCollJointTorque
Eigen::VectorXf projSelfCollJointTorque
Definition: CollisionAvoidance.h:202
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::localStiffnessJointLim
float localStiffnessJointLim
Definition: CollisionAvoidance.h:247
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::kdImpedanceTorque
Eigen::VectorXf kdImpedanceTorque
Definition: CollisionAvoidance.h:193
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::node
const simox::control::robot::NodeInterface * node
self-collision avoidance intermediate results
Definition: CollisionAvoidance.h:220
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::k1Lo
float k1Lo
Definition: CollisionAvoidance.h:250
armarx::control::common::control_law::CollisionAvoidanceController::JointRangeBufferZoneData::jointLimitNullSpaceWeightsHigh
Eigen::Vector4f jointLimitNullSpaceWeightsHigh
Definition: CollisionAvoidance.h:171
armarx::control::common::control_law::CollisionAvoidanceController::~CollisionAvoidanceController
~CollisionAvoidanceController()
Definition: CollisionAvoidance.cpp:22
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::jointInertia
float jointInertia
Definition: CollisionAvoidance.h:245
armarx::control::common::control_law::CollisionAvoidanceController::initialize
void initialize(SimoxRobotPtr &simoxControlRobot)
Definition: CollisionAvoidance.cpp:29
armarx::control::common::control_law::CollisionAvoidanceController::rtRNS
VirtualRobot::RobotNodeSetPtr rtRNS
Definition: CollisionAvoidance.h:293
armarx::control::common::control_law::CollisionAvoidanceController::SelfCollisionData::setDistValues
void setDistValues(std::string nodeName, std::string otherName, float minDistance)
Definition: CollisionAvoidance.h:117
armarx::control::common::control_law::CollisionAvoidanceController
Definition: CollisionAvoidance.h:58
armarx::control::common::control_law::CollisionAvoidanceController::JointRangeBufferZoneData::repulsiveTorque
float repulsiveTorque
Definition: CollisionAvoidance.h:173
armarx::control::common::control_law::CollisionAvoidanceController::JointRangeBufferZoneData::desiredNSjointLim
float desiredNSjointLim
Definition: CollisionAvoidance.h:172
armarx::control::common::control_law::CollisionAvoidanceController::InertiaPtr
std::shared_ptr< simox::control::geodesics::metric::Inertia > InertiaPtr
Definition: CollisionAvoidance.h:61
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::node1Index
unsigned int node1Index
Definition: CollisionAvoidance.h:224
armarx::control::common::control_law::CollisionAvoidanceController::numOfJoints
unsigned int numOfJoints
Definition: CollisionAvoidance.h:292
armarx::control::common::control_law::CollisionAvoidanceController::SelfCollisionData::SelfCollisionData
SelfCollisionData(int size)
Definition: CollisionAvoidance.h:91
armarx::control::common::control_law::CollisionAvoidanceController::SelfCollisionData::nodeName
std::string nodeName
the distances and projected jacobians from the generateSelfCollisionTorque() method are needed for th...
Definition: CollisionAvoidance.h:72
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::collisionPairTime
double collisionPairTime
time status
Definition: CollisionAvoidance.h:258
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::jointLimitNullspaceTime
double jointLimitNullspaceTime
Definition: CollisionAvoidance.h:263
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::collisionPairsNum
int collisionPairsNum
collision pair info
Definition: CollisionAvoidance.h:266
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::impedanceJointTorque
Eigen::VectorXf impedanceJointTorque
intermediate torque results
Definition: CollisionAvoidance.h:192
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::projTotalForceImpedance
float projTotalForceImpedance
Definition: CollisionAvoidance.h:189
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::activeCollPairsNum
int activeCollPairsNum
Definition: CollisionAvoidance.h:267
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::k2Hi
float k2Hi
Definition: CollisionAvoidance.h:251
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::k2Lo
float k2Lo
Definition: CollisionAvoidance.h:250
armarx::control::common::control_law
This file is part of ArmarX.
Definition: aron_conversions.cpp:68
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::evalData
std::vector< SelfCollisionData > evalData
Definition: CollisionAvoidance.h:230
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::selfCollisionNullSpaceWeights
Eigen::Vector4f selfCollisionNullSpaceWeights
self-collision avoidance initialization parameters
Definition: CollisionAvoidance.h:217
ControlTarget1DoFActuator.h
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::totalForceImpedance
float totalForceImpedance
Definition: CollisionAvoidance.h:187
armarx::control::common::control_law::CollisionAvoidanceController::JointRangeBufferZoneData::qposThresholdLow
float qposThresholdLow
Definition: CollisionAvoidance.h:163
armarx::control::common::control_law::CollisionAvoidanceController::SelfCollisionData::setCalcValues
void setCalcValues(const Eigen::MatrixXf &jacobian, float repulsiveForce, float localStiffness, const Eigen::VectorXf &projectedJacT, float distanceVelocity, const Eigen::Vector3f &direction, const Eigen::Vector3f &point, float damping, float projectedMass, float desiredNSColl)
Definition: CollisionAvoidance.h:125
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::rtPreActivate
void rtPreActivate()
Definition: CollisionAvoidance.h:284
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::trackingError
float trackingError
Definition: CollisionAvoidance.h:184
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy
internal status of the controller, containing intermediate variables, mutable targets
Definition: CollisionAvoidance.h:178
armarx::control::common::control_law::CollisionAvoidanceController::SelfCollisionData::point
Eigen::Vector3f point
Definition: CollisionAvoidance.h:83
armarx::control::common::control_law::CollisionAvoidanceController::SimoxRobotPtr
std::shared_ptr< simox::control::simox::robot::Robot > SimoxRobotPtr
Definition: CollisionAvoidance.h:64
armarx::control::common::control_law::CollisionAvoidanceController::SelfCollisionData::distanceVelocity
float distanceVelocity
Definition: CollisionAvoidance.h:81
armarx::control::common::control_law::CollisionAvoidanceController::CollisionAvoidanceController
CollisionAvoidanceController(const VirtualRobot::RobotNodeSetPtr &rtRns)
Definition: CollisionAvoidance.cpp:14
armarx::control::common::control_law::CollisionAvoidanceController::SelfCollisionData::otherName
std::string otherName
Definition: CollisionAvoidance.h:73
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::collisionTorqueTime
double collisionTorqueTime
Definition: CollisionAvoidance.h:260
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::jointLimitTorqueTime
double jointLimitTorqueTime
Definition: CollisionAvoidance.h:261
armarx::control::common::control_law::CollisionAvoidanceController::SelfCollisionData::damping
float damping
Definition: CollisionAvoidance.h:84
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::selfCollisionTorqueFiltered
Eigen::VectorXf selfCollisionTorqueFiltered
Definition: CollisionAvoidance.h:197
TripleBuffer.h
armarx::control::common::control_law::CollisionAvoidanceController::run
void run(Config &c, RtStatusForSafetyStrategy &robotStatus, DistanceResultsPtr &collisionPairs, std::shared_ptr< std::vector< int >> &pointsOnArm, int pointsOnArmIndex, InertiaPtr &inertiaInstance, std::vector< std::string > &selfCollisionNodes, Eigen::VectorXf &qpos, Eigen::VectorXf &qvelFiltered, float torqueLimit)
------------------------------— main rt-loop ---------------------------------------—
Definition: CollisionAvoidance.cpp:999
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::node1OnArm
bool node1OnArm
Definition: CollisionAvoidance.h:222
armarx::control::common::control_law::CollisionAvoidanceController::JointRangeBufferZoneData::qposZ2Low
float qposZ2Low
Definition: CollisionAvoidance.h:167
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::k1Hi
float k1Hi
Definition: CollisionAvoidance.h:251
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::selfCollNullspaceTime
double selfCollNullspaceTime
Definition: CollisionAvoidance.h:262
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::k1
float k1
self-collision avoidance null space intermediate results
Definition: CollisionAvoidance.h:234
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::reset
void reset(const Config &c, const unsigned int nDoF, const unsigned int maxCollisionPairs, VirtualRobot::RobotNodeSetPtr &rns)
Definition: CollisionAvoidance.cpp:1391
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::selfCollDataVec
std::vector< SelfCollisionData > selfCollDataVec
Definition: CollisionAvoidance.h:229
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::jointLimNullSpaceFiltered
Eigen::MatrixXf jointLimNullSpaceFiltered
Definition: CollisionAvoidance.h:214
armarx::control::common::control_law::CollisionAvoidanceController::Config
common::control_law::arondto::CollisionAvoidanceConfig Config
Definition: CollisionAvoidance.h:66
armarx::control::common::control_law::CollisionAvoidanceController::JointRangeBufferZoneData::thresholdRange
float thresholdRange
Definition: CollisionAvoidance.h:162
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::impForceRatio
float impForceRatio
Definition: CollisionAvoidance.h:206
armarx::control::common::control_law::CollisionAvoidanceController::JointRangeBufferZoneData::qposZ1High
float qposZ1High
Definition: CollisionAvoidance.h:168
armarx::control::common::control_law::CollisionAvoidanceController::JointRangeBufferZoneData::isLimitless
bool isLimitless
Definition: CollisionAvoidance.h:159
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::jointLimitTorqueFiltered
Eigen::VectorXf jointLimitTorqueFiltered
Definition: CollisionAvoidance.h:198
Eigen::Matrix< float, 6, 1 >
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::inertiaInverse
Eigen::MatrixXf inertiaInverse
Definition: CollisionAvoidance.h:255
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::projForceImpedance
Eigen::Vector6f projForceImpedance
Definition: CollisionAvoidance.h:188
armarx::control::common::control_law::CollisionAvoidanceController::JointRangeBufferZoneData::qposZ2High
float qposZ2High
Definition: CollisionAvoidance.h:169
armarx::control::common::control_law::CollisionAvoidanceController::SelfCollisionData
Definition: CollisionAvoidance.h:68
armarx::control::common::control_law::helper::calculateTransitionWeights
Eigen::Vector4f calculateTransitionWeights(float z1, float z2)
helper functions
Definition: CollisionAvoidance.cpp:972
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::k3Lo
float k3Lo
Definition: CollisionAvoidance.h:250
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::desiredNullSpace
float desiredNullSpace
Definition: CollisionAvoidance.h:211
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::selfCollNullSpaceFiltered
Eigen::MatrixXf selfCollNullSpaceFiltered
Definition: CollisionAvoidance.h:213
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::jointLimNullSpace
Eigen::MatrixXf jointLimNullSpace
Definition: CollisionAvoidance.h:210
armarx::control::common::control_law::CollisionAvoidanceController::preactivateInit
void preactivateInit(Config &c, RtStatusForSafetyStrategy &rtStatus)
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::k3Hi
float k3Hi
Definition: CollisionAvoidance.h:251
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::evalDataIndex
int evalDataIndex
Definition: CollisionAvoidance.h:231
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::k4
float k4
Definition: CollisionAvoidance.h:234
SensorValue1DoFActuator.h
armarx::control::common::control_law::CollisionAvoidanceController::SelfCollisionData::minDistance
float minDistance
Definition: CollisionAvoidance.h:75
armarx::control::common::control_law::CollisionAvoidanceController::JointRangeBufferZoneData::qLimLow
float qLimLow
Definition: CollisionAvoidance.h:160
armarx::control::common::control_law::CollisionAvoidanceController::JointRangeBufferZoneData::jointLimitNullSpaceWeightsLow
Eigen::Vector4f jointLimitNullSpaceWeightsLow
Definition: CollisionAvoidance.h:170
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::k3
float k3
Definition: CollisionAvoidance.h:234
armarx::control::common::control_law::CollisionAvoidanceController::RtStatusForSafetyStrategy::jointVel
float jointVel
joint limit avoidance intermediate results
Definition: CollisionAvoidance.h:244
armarx::control::common::control_law::CollisionAvoidanceController::JointRangeBufferZoneData
Definition: CollisionAvoidance.h:149