Cartesian Planning: While MoveIt plans free space motion (i.e. move from A to B), Descartes plans robot joint motion for semi-constrained Cartesian paths (i.e. ones whose waypoints may have less than a fully specified 6DOF pose).
Efficient, Repeatable, Scale-able Planning: The paths that result from Descartes appear very similar to human generated paths, but without all the effort. The plans are also repeatable and scale-able to the complexity of the problem (easy paths are planned very quickly, hard paths take time but are still solved).
Dynamic Re-planning: Path planning structures are maintained in memory after planning is complete. When changes are made to the desired path, an updated robot joint trajectory can be generated nearly instantaneously.
Offline Planning: Similar to MoveIt, but different than other planners, Descartes is primarily focus逆解ed on offline or sense/plan/act applications. Real-time planning is not a feature of Descartes.
稠密求解器,DensePlanner takes a brute force approach to finding a sequence of joint solutions that defines an “optimum” path through a sequence of input descartes_core::TrajectoryPt’s. Optimum is defined as the path with minimal joint changes. It works by expanding all of the valid inverse kinematic solutions for every trajectory point passed in. Edges are added between every possible pair of solutions from contigous user trajectory points. Dijkstra’s algorithm is then used to find a path with minimal joint motion through the graph.
稀疏规划器,SparsePlanner attempts to optimize the process used by DensePlanner by not expanding every point. Instead a subset of the points are expanded and the planner attempts to use joint interpolation to find a satisfactory solution to the not-expanded points (thereby reducing the number of IK solutions required).
Defines the position and orientation of the tool relative to a world coordinate frame. It can also apply tolerances for the relevant variables that determine the tool pose
Extends the CartTrajectoryPt by specifying a free axis of rotation for the tool. Useful whenever the orientation about the tool’s approach vector doesn’t have to be defined
descartes_utilities
接口类
说明
descartes_utilities::toRosJointPoints
笛卡尔规划结果转化为标准ROS关节信息
三、应用
3.1 实现流程
3.2 相关函数
生成笛卡尔运动轨迹数据
descartes_core::TrajectoryPtPtr makeCartesianPoint(const Eigen::Isometry3d &pose) {
using namespace descartes_core;
using namespace descartes_trajectory;
return TrajectoryPtPtr(new CartTrajectoryPt(TolerancedFrame(pose)));
}
转换规划数据到ROS格式
trajectory_msgs::JointTrajectory toROSJointTrajectory(
const TrajectoryVec &trajectory, const descartes_core::RobotModel &model,
const std::vector<std::string> &joint_names, double time_delay) {
// Fill out information about our trajectory
trajectory_msgs::JointTrajectory result;
result.header.stamp = ros::Time::now();
result.header.frame_id = "base_link";
result.joint_names = joint_names;
// For keeping track of time-so-far in the trajectory
double time_offset = 0.0;
// Loop through the trajectory
int len = trajectory.size();
for (int i = 0; i < len; i++) {
// Find nominal joint solution at this point
std::vector<double> joints;
trajectory[i].get()->getNominalJointPose(std::vector<double>(), model,
joints);
// Fill out a ROS trajectory point
trajectory_msgs::JointTrajectoryPoint pt;
pt.positions = joints;
// velocity, acceleration, and effort are given dummy values
// we'll let the controller figure them out
pt.velocities.resize(joints.size(), 0.0);
pt.accelerations.resize(joints.size(), 0.0);
pt.effort.resize(joints.size(), 0.0);
// set the time into the trajectory
pt.time_from_start = ros::Duration(time_offset);
// increment time
time_offset += time_delay;
result.points.push_back(pt);
}
return result;
}