26 Pimpl(
const Model& m,
const Eigen::VectorXi& selectedDofs,
int whichPart)
28 , dofs(selectedDofs.size())
29 , size(selectedDofs.size())
32 J = Eigen::MatrixXd::Zero(size, model.
nbDofs());
34 for (
int i=0; i<
size; i++)
36 if (selectedDofs(i)<0)
37 throw std::runtime_error(
"[PartialState::PartialState] some selected dofs are negative");
45 for (
int i=0; i<
size; i++)
47 dofs(i) = selectedDofs(i);
55 for (
int i=0; i<
size; i++)
57 dofs(i) = decal+selectedDofs(i);
64 throw std::runtime_error(
"[PartialState::PartialState] invalid specified part (specify FULL_STATE, or INTERNAL)");
122 pimpl->tau = VectorXd::Zero(
getSize());
123 pimpl->q = VectorXd::Zero(
getSize());
124 pimpl->qdot = VectorXd::Zero(
getSize());
125 pimpl->qddot = VectorXd::Zero(
getSize());
137 for (
int i=0; i<
getSize(); i++)
138 pimpl->q(i) = tmp(
getDofs()(i));
147 for (
int i=0; i<
getSize(); i++)
148 pimpl->qdot(i) = tmp(
getDofs()(i));
165 throw std::runtime_error(
"[PartialModelState::getInertiaMatrix] Not Implemented");
184 throw std::runtime_error(
"[PartialModelState::getInertiaMatrixInverse] Not Implemented");
220 pimpl->tau = VectorXd::Zero(
getSize());
221 pimpl->q = VectorXd::Zero(
getSize());
222 pimpl->qdot = VectorXd::Zero(
getSize());
223 pimpl->qddot = VectorXd::Zero(
getSize());
253 throw std::runtime_error(
"[PartialModelState::getInertiaMatrix] Not Implemented");
258 throw std::runtime_error(
"[PartialModelState::getInertiaMatrixInverse] Not Implemented");
274 pimpl->qddot =
qddot;
virtual ~PartialTargetState()
Eigen::VectorXi & getDofs() const
const VectorXd & getValue() const
virtual const Eigen::VectorXd & qdot() const
void set_tau(const Eigen::VectorXd &tau)
virtual const Eigen::VectorXd & qddot() const
virtual const Eigen::VectorXd & tau() const
virtual const Eigen::VectorXd & qdot() const
PartialTargetState(const std::string &name, const Model &model, const Eigen::VectorXi &selectedDofs, int whichPart)
Define partial state classes that can be used to control some joints of the robot.
virtual ~PartialModelState()
const Model & getModel() const
Optimization-based Robot Controller namespace. a library of classes to write and solve optimization p...
Variable & getConfigurationVariable() const
const Eigen::MatrixXd & getJacobian() const
virtual const Eigen::MatrixXd & getInertiaMatrixInverse() const
A abstract partial state.
virtual const Eigen::VectorXd & q() const
virtual const Eigen::MatrixXd & getInertiaMatrixInverse() const
PartialState(const std::string &name, const Model &model, const Eigen::VectorXi &selectedDofs, int whichPart)
void set_q(const Eigen::VectorXd &q)
virtual const Eigen::MatrixXd & getInertiaMatrix() const
PartialModelState(const std::string &name, const Model &model, const Eigen::VectorXi &selectedDofs, int whichPart)
virtual const Eigen::VectorXd & q() const
void set_qddot(const Eigen::VectorXd &qddot)
bool hasFixedRoot() const
void set_qdot(const Eigen::VectorXd &qdot)
virtual const Eigen::MatrixXd & getInertiaMatrix() const
virtual ~PartialState()=0
virtual const Eigen::VectorXd & tau() const
Pimpl(const Model &m, const Eigen::VectorXi &selectedDofs, int whichPart)
virtual const Eigen::VectorXd & qddot() const
Variable & getVelocityVariable() const