TVM  0.9.4
JointsSelector.h
Go to the documentation of this file.
1 
3 #pragma once
4 
5 #include <tvm/defs.h>
6 
7 #include <tvm/Robot.h>
9 
10 namespace tvm
11 {
12 
13 namespace robot
14 {
15 
18 {
19 public:
20  SET_UPDATES(JointsSelector, Jacobian, JDot)
21 
22 
33  static std::unique_ptr<JointsSelector> ActiveJoints(FunctionPtr f,
34  RobotPtr robot,
35  const std::vector<std::string> & activeJoints);
36 
48  static std::unique_ptr<JointsSelector> InactiveJoints(FunctionPtr f,
49  RobotPtr robot,
50  const std::vector<std::string> & inactiveJoints);
51 
52  const Eigen::VectorXd & value() const override { return f_->value(); }
53  const Eigen::VectorXd & velocity() const override { return f_->velocity(); }
54  const Eigen::VectorXd & normalAcceleration() const override { return f_->normalAcceleration(); }
55 
56 protected:
71  RobotPtr robot,
72  bool ffActive,
73  const std::vector<std::pair<Eigen::DenseIndex, Eigen::DenseIndex>> & activeIndex);
74 
75 protected:
77  void updateJDot();
78 
81  bool ffActive_;
82  std::vector<std::pair<Eigen::DenseIndex, Eigen::DenseIndex>> activeIndex_;
83 };
84 
85 } // namespace robot
86 
87 } // namespace tvm
#define SET_UPDATES(SelfT,...)
Definition: AbstractNode.h:138
#define TVM_DLLAPI
Definition: api.h:35
Definition: Function.h:45
Definition: JointsSelector.h:18
JointsSelector(FunctionPtr f, RobotPtr robot, bool ffActive, const std::vector< std::pair< Eigen::DenseIndex, Eigen::DenseIndex >> &activeIndex)
std::vector< std::pair< Eigen::DenseIndex, Eigen::DenseIndex > > activeIndex_
Definition: JointsSelector.h:82
FunctionPtr f_
Definition: JointsSelector.h:79
const Eigen::VectorXd & velocity() const override
Definition: JointsSelector.h:53
bool ffActive_
Definition: JointsSelector.h:81
const Eigen::VectorXd & normalAcceleration() const override
Definition: JointsSelector.h:54
RobotPtr robot_
Definition: JointsSelector.h:80
Definition: AffineExprDetail.h:95
Definition: probe.h:44
Definition: Clock.h:12
std::shared_ptr< Robot > RobotPtr
Definition: defs.h:62
std::shared_ptr< function::abstract::Function > FunctionPtr
Definition: defs.h:57