32 #include <exotica_core/frame_initializer.h> 33 #include <exotica_core/task_map_initializer.h> 45 TaskMapInitializer MapInitializer(init);
52 FrameInitializer frame(eff);
64 if (jacobian.rows() !=
TaskSpaceDim() && jacobian.cols() != q.rows())
73 constexpr
double h = 1e-6;
74 constexpr
double h_inverse = 1.0 / h;
80 Eigen::VectorXd q_backward(q.size()), phi_backward(
TaskSpaceDim());
83 for (
int i = 0; i < jacobian.cols(); ++i)
88 scene_->GetKinematicTree().Update(q_backward);
91 Update(q_backward, phi_backward);
94 jacobian.col(i).noalias() = h_inverse * (phi - phi_backward);
98 scene_->GetKinematicTree().Update(q);
104 const int ndq =
scene_->get_has_quaternion_floating_base() ?
scene_->get_num_positions() - 1 :
scene_->get_num_positions();
107 Eigen::Block<Eigen::Ref<Eigen::MatrixXd>> jacobian_row = jacobian.block(i, 0, 1, ndq);
108 hessian(i).topLeftCorner(ndq, ndq).noalias() = jacobian_row.transpose() * jacobian_row;
121 const int ndq =
scene_->get_has_quaternion_floating_base() ?
scene_->get_num_positions() - 1 :
scene_->get_num_positions();
128 const int ndq =
scene_->get_has_quaternion_floating_base() ?
scene_->get_num_positions() - 1 :
scene_->get_num_positions();
std::vector< KinematicFrameRequest > frames_
void InstantiateObject(const Initializer &init)
Eigen::Ref< Eigen::VectorXd > VectorXdRef
std::shared_ptr< Scene > ScenePtr
virtual void AssignScene(ScenePtr scene)
virtual int TaskSpaceJacobianDim()
virtual void Update(Eigen::VectorXdRefConst q, Eigen::VectorXdRef phi)=0
const Eigen::Ref< const Eigen::VectorXd > & VectorXdRefConst
Convenience wrapper for storing references to sub-matrices/vectors.
Eigen::Ref< Hessian > HessianRef
Eigen::Ref< Eigen::MatrixXd > MatrixXdRef
std::vector< KinematicFrameRequest > GetFrames() const
virtual int TaskSpaceDim()=0
KDL::Frame GetFrame(Eigen::VectorXdRefConst val)
virtual void InstantiateBase(const Initializer &init)