11 template <
size_t NJOINTS>
14 throw std::runtime_error(
"RBD: JointPositionPIDController.h, clone() not implemented");
17 template <
size_t NJOINTS>
22 template <
size_t NJOINTS>
24 const Eigen::Matrix<double, NJOINTS, 1>& desiredPosition,
25 const Eigen::Matrix<double, NJOINTS, 1>& desiredVelocity,
26 const std::vector<PIDController::parameters_t>& parameters)
28 assert(parameters.size() == NJOINTS);
30 for (
size_t i = 0;
i < NJOINTS;
i++)
32 jointControllers_.push_back(
37 template <
size_t NJOINTS>
39 const Eigen::Matrix<double, NJOINTS, 1>& desiredPosition,
40 const Eigen::Matrix<double, NJOINTS, 1>& desiredVelocity,
41 const PIDController::parameters_t& parameters)
43 for (
size_t i = 0;
i < NJOINTS;
i++)
45 jointControllers_.push_back(
50 template <
size_t NJOINTS>
57 for (
size_t i = 0;
i < NJOINTS;
i++)
63 template <
size_t NJOINTS>
66 for (
size_t i = 0;
i < NJOINTS;
i++)
68 jointControllers_[
i].setDesiredState(desiredPosition(
i));
72 template <
size_t NJOINTS>
75 assert(0 <= jointId && jointId < NJOINTS);
77 jointControllers_[jointId].setDesiredState(desiredPosition);
80 template <
size_t NJOINTS>
83 PIDController::parameters_t parameters;
88 for (
size_t i = 0;
i < NJOINTS;
i++)
90 jointControllers_[
i].changeParameters(parameters);
94 template <
size_t NJOINTS>
97 for (
size_t i = 0;
i < NJOINTS;
i++)
99 jointControllers_[
i].reset();
joint state and joint velocity
Definition: JointState.h:21
virtual JointPositionPIDController< NJOINTS > * clone() const override
Definition: JointPositionPIDController-impl.h:12
A joint position controller using a PID controller for all joints.
Definition: JointPositionPIDController.h:19
void setDesiredPosition(const Eigen::Matrix< double, NJOINTS, 1 > &desiredPosition)
Definition: JointPositionPIDController-impl.h:64
void computeControl(const core::StateVector< STATE_DIM > &state, const core::Time &t, core::ControlVector< NJOINTS > &control) override
Definition: JointPositionPIDController-impl.h:51
void setAllPIDGains(double kp, double ki, double kd)
Definition: JointPositionPIDController-impl.h:81
SCALAR & getVelocity(size_t i)
Definition: JointState.h:136
virtual ~JointPositionPIDController()
Definition: JointPositionPIDController-impl.h:18
JointPositionPIDController(const Eigen::Matrix< double, NJOINTS, 1 > &desiredPosition=Eigen::Matrix< double, NJOINTS, 1 >::Zero(), const Eigen::Matrix< double, NJOINTS, 1 > &desiredVelocity=Eigen::Matrix< double, NJOINTS, 1 >::Zero(), const std::vector< PIDController::parameters_t > ¶meters=std::vector< PIDController::parameters_t >(NJOINTS, PIDController::parameters_t()))
Definition: JointPositionPIDController-impl.h:23
SCALAR & getPosition(size_t i)
Definition: JointState.h:81
void reset()
Definition: JointPositionPIDController-impl.h:95