5 #ifndef CHOREO_PROCESS_PLANNING_COMMON_UTILS_H 6 #define CHOREO_PROCESS_PLANNING_COMMON_UTILS_H 10 #include <Eigen/Geometry> 13 #include <descartes_core/trajectory_pt.h> 14 #include <descartes_core/robot_model.h> 17 #include <sensor_msgs/JointState.h> 18 #include <moveit_msgs/CollisionObject.h> 19 #include <moveit_msgs/AttachedCollisionObject.h> 20 #include <geometry_msgs/PoseArray.h> 21 #include <geometry_msgs/Point.h> 28 const geometry_msgs::Point& pt);
35 trajectory_msgs::JointTrajectory
toROSTrajectory(
const DescartesTraj& solution,
36 const descartes_core::RobotModel& model);
38 trajectory_msgs::JointTrajectory
toROSTrajectory(
const std::vector<std::vector<double>>& solution,
39 const descartes_core::RobotModel& model);
42 trajectory_msgs::JointTrajectory& traj,
43 const std::string world_frame);
46 trajectory_msgs::JointTrajectory& traj,
47 const double sim_time_scale = 0.0);
58 static inline std::vector<double>
extractJoints(
const descartes_core::RobotModel& model,
59 const descartes_core::TrajectoryPt& pt)
61 std::vector<double> dummy, result;
62 pt.getNominalJointPose(dummy, model, result);
66 DescartesTraj
createJointPath(
const std::vector<double>& start,
const std::vector<double>& stop,
67 double dtheta =
M_PI / 180.0);
69 trajectory_msgs::JointTrajectory
getMoveitPlan(
const std::string& group_name,
70 const std::vector<double>& joints_start,
71 const std::vector<double>& joints_stop,
72 moveit::core::RobotModelConstPtr model);
75 const std::vector<double>& joints_start,
76 const std::vector<double>& joints_stop,
77 const std::vector<double>& initial_pose,
78 moveit::core::RobotModelConstPtr model,
79 const bool force_insert_reset =
false);
81 trajectory_msgs::JointTrajectory
planFreeMove(descartes_core::RobotModel& model,
82 const std::string& group_name,
83 moveit::core::RobotModelConstPtr moveit_model,
84 const std::vector<double>& start,
85 const std::vector<double>& stop);
89 const std::vector<double>& target);
92 #endif //CHOREO_PROCESS_PLANNING_COMMON_UTILS_H static std::vector< double > extractJoints(const descartes_core::RobotModel &model, const descartes_core::TrajectoryPt &pt)
bool addCollisionObject(ros::ServiceClient &planning_scene, const moveit_msgs::CollisionObject &c_obj)
bool clearAllCollisionObjects(ros::ServiceClient &planning_scene)
Eigen::Affine3d createNominalTransform(const geometry_msgs::Pose &ref_pose, const geometry_msgs::Point &pt)
void appendTrajectoryHeaders(const trajectory_msgs::JointTrajectory &orig_traj, trajectory_msgs::JointTrajectory &traj, const double sim_time_scale=0.0)
trajectory_msgs::JointTrajectory toROSTrajectory(const DescartesTraj &solution, const descartes_core::RobotModel &model)
std::vector< double > getCurrentJointState(const std::string &topic)
DescartesTraj createJointPath(const std::vector< double > &start, const std::vector< double > &stop, double dtheta=M_PI/180.0)
moveit_msgs::AttachedCollisionObject addFullEndEffectorCollisionObject(bool is_add)
void fillTrajectoryHeaders(const std::vector< std::string > &joints, trajectory_msgs::JointTrajectory &traj, const std::string world_frame)
trajectory_msgs::JointTrajectory getMoveitPlan(const std::string &group_name, const std::vector< double > &joints_start, const std::vector< double > &joints_stop, moveit::core::RobotModelConstPtr model)
trajectory_msgs::JointTrajectory getMoveitTransitionPlan(const std::string &group_name, const std::vector< double > &joints_start, const std::vector< double > &joints_stop, const std::vector< double > &initial_pose, moveit::core::RobotModelConstPtr model, const bool force_insert_reset=false)
trajectory_msgs::JointTrajectory planFreeMove(descartes_core::RobotModel &model, const std::string &group_name, moveit::core::RobotModelConstPtr moveit_model, const std::vector< double > &start, const std::vector< double > &stop)
std::vector< descartes_core::TrajectoryPtPtr > DescartesTraj
double freeSpaceCostFunction(const std::vector< double > &source, const std::vector< double > &target)