20#ifndef ROBOT_ENV_EVALUATOR_ROBOT_ENV_EVALUATOR_HPP
21#define ROBOT_ENV_EVALUATOR_ROBOT_ENV_EVALUATOR_HPP
23#include <pinocchio/multibody/model.hpp>
24#include <pinocchio/multibody/data.hpp>
25#include <pinocchio/multibody/geometry.hpp>
31namespace robot_env_evaluator
46 Eigen::Matrix4d obstacle_pose;
55 Eigen::Vector3d normal_vector;
56 Eigen::Vector3d nearest_point_on_robot;
57 Eigen::Vector3d nearest_point_on_object;
58 std::string contacted_robot_link;
59 Eigen::VectorXd projector_jointspace_to_dist;
60 Eigen::VectorXd projector_dist_to_jointspace;
98 const std::string& ee_name,
99 const std::vector<std::string>& joint_names,
100 const pinocchio::GeometryModel& collision_model,
101 const pinocchio::GeometryModel& visual_model = pinocchio::GeometryModel());
121 const int joint_index = -1);
134 const std::string& frame_name);
146 void jacobian(
const Eigen::VectorXd& q,
148 const int joint_index = -1);
159 const std::string& frame_name);
169 const std::vector<obstacleInput>& obstacles,
170 std::vector<distanceResult>& distances);
190 const double frame_index,
The main functionality class, which provides functionalities for evaluating robot environment informa...
void forwardKinematics(const Eigen::VectorXd &q, Eigen::Matrix4d &T, const int joint_index=-1)
The forward kinematics function for a specific joint, specified by the index.
pinocchio::Data data_
The robot data, initialized from the model.
void jacobianFrame(const Eigen::VectorXd &q, const double frame_index, Eigen::MatrixXd &J)
Get the Jacobian of specific frame.
bool calculate_self_collision_
Whether to calculate self-collision in distance computation.
Eigen::VectorXd buffered_q_
The buffered joint configuration. This is used to avoid unnecessary computation.
void forwardKinematicsByFrameName(const Eigen::VectorXd &q, Eigen::Matrix4d &T, const std::string &frame_name)
The forward kinematics function for a specific frame, specified by the name.
void computeModelData(const Eigen::VectorXd &q)
Compute the model data from the joint configuration.
double robust_pinv_lambda_
The lambda value for the robust pseudo-inverse projector.
pinocchio::GeometryModel visual_model_
The visual model.
bool projector_dist_to_control_with_zero_orientation_
Whether to use the full Jacobian and set the orientation to zero when calculating the projector.
bool projector_dist_to_control_enable_
Whether to calculate the projector from distance to control space.
~RobotEnvEvaluator()=default
Destroy the Robot Env Evaluator object.
void jacobianByFrameName(const Eigen::VectorXd &q, Eigen::MatrixXd &J, const std::string &frame_name)
Get the jacobian of specific frame, specified by the name.
pinocchio::GeometryData geom_data_
The geometry data for collision computation.
int ee_index_
The internal index for end-effector.frame.
std::vector< double > joint_indices_
The joint indices for the robot model.
void computeDistances(const Eigen::VectorXd &q, const std::vector< obstacleInput > &obstacles, std::vector< distanceResult > &distances)
The distance computation function between the robot and obstacles.
pinocchio::GeometryModel collision_model_
The collision model.
void jacobian(const Eigen::VectorXd &q, Eigen::MatrixXd &J, const int joint_index=-1)
The jacobian function for a specific joint, specified by the index.
pinocchio::GeometryModel geom_model_
The geometry model for collision computation.
pinocchio::Model model_
The robot model.
std::variant< coal::Sphere > Obstacle
The Obstacle class, a variant of different coal primitive shapes.
Store the distance result between objects.