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();