- 3.0.2 rigid body dynamics module.
IKConstraintContainer.h
Go to the documentation of this file.
1 /**********************************************************************************************************************
2 This file is part of the Control Toolbox (https://github.com/ethz-adrl/control-toolbox), copyright by ETH Zurich.
3 Licensed under the BSD-2 license (see LICENSE file in main directory)
4 **********************************************************************************************************************/
5 
6 #pragma once
7 
10 #include "JointLimitConstraints.h"
11 
12 namespace ct {
13 namespace rbd {
14 
19 template <typename KINEMATICS, typename SCALAR = double>
21 {
22 public:
23  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
24 
26 
28  const JointPosition& lowerBound,
29  const JointPosition& upperBound)
30  : optVector_(optVector)
31  {
32  // set up joint limit constraints
33  auto jointLimits = std::shared_ptr<JointLimitConstraints<KINEMATICS, SCALAR>>(
34  new JointLimitConstraints<KINEMATICS, SCALAR>(optVector_, lowerBound, upperBound));
35  this->constraints_.push_back(jointLimits);
36  }
37 
38  ~IKConstraintsContainer() override = default;
39 
40  void prepareEvaluation() override { /* do nothing*/}
41 
42  void prepareJacobianEvaluation() override { /* do nothing*/}
43 
48  const std::shared_ptr<JointLimitConstraints<KINEMATICS, SCALAR>> getJointLimitConstraints() const
49  {
50  return std::static_pointer_cast<JointLimitConstraints<KINEMATICS, SCALAR>>(this->constraints_.front());
51  }
52 
53 private:
54  std::shared_ptr<ct::optcon::tpl::OptVector<SCALAR>> optVector_;
55 };
56 
57 } // namespace rbd
58 } // namespace ct
typename ct::rbd::JointState< KINEMATICS::NJOINTS, SCALAR >::Position JointPosition
Definition: IKConstraintContainer.h:25
void prepareJacobianEvaluation() override
Definition: IKConstraintContainer.h:42
const std::shared_ptr< JointLimitConstraints< KINEMATICS, SCALAR > > getJointLimitConstraints() const
get pointer to joint-limit constraints
Definition: IKConstraintContainer.h:48
joint state and joint velocity
Definition: JointState.h:21
IKConstraintsContainer(std::shared_ptr< ct::optcon::tpl::OptVector< SCALAR >> optVector, const JointPosition &lowerBound, const JointPosition &upperBound)
Definition: IKConstraintContainer.h:27
Inverse Kinematics joint limit constraints.
Definition: JointLimitConstraints.h:15
~IKConstraintsContainer() override=default
void prepareEvaluation() override
Definition: IKConstraintContainer.h:40
Inverse Kinematics constraint container.
Definition: IKConstraintContainer.h:20
std::vector< std::shared_ptr< DiscreteConstraintBase< SCALAR > > > constraints_