40 #include <moveit_msgs/RobotTrajectory.h> 51 #include <tf/transform_listener.h> 56 #include <eigen3/Eigen/Core> 78 ROS_INFO_STREAM(
"Param max_iterations_after_collision_free was not set. Using default value: " 106 ROS_INFO_STREAM(
"Param smoothness_cost_acceleration was not set. Using default value: " 128 ROS_INFO_STREAM(
"Param pseudo_inverse_ridge_factor was not set. Using default value: " 155 ROS_INFO_STREAM(
"Param trajectory_initialization_method was not set. Using New value as: " 162 return "CHOMP Optimizer";
168 std::vector<std::size_t>& added_path_index)
const 172 bool solved = planner(ps, req, res);
175 collision_detection::CollisionDetectorAllocatorPtr hybrid_cd(
181 planning_scene->setActiveCollisionDetector(hybrid_cd,
true);
185 moveit_msgs::MotionPlanDetailedResponse res_detailed_moveit_msgs;
190 moveit_msgs::RobotTrajectory trajectory_msgs_from_response;
191 res.
trajectory_->getRobotTrajectoryMsg(trajectory_msgs_from_response);
192 res_detailed_moveit_msgs.trajectory.resize(1);
193 res_detailed_moveit_msgs.trajectory[0] = trajectory_msgs_from_response;
195 bool planning_success = chompPlanner.
solve(planning_scene, req,
params_, res_detailed_moveit_msgs);
197 if (planning_success)
200 res_detailed.
trajectory_[0] = robot_trajectory::RobotTrajectoryPtr(
204 robot_state::robotStateMsgToRobotState(res_detailed_moveit_msgs.trajectory_start, start_state);
205 res_detailed.
trajectory_[0]->setRobotTrajectoryMsg(start_state, res_detailed_moveit_msgs.trajectory[0]);
208 res_detailed.
error_code_ = res_detailed_moveit_msgs.error_code;
211 res_detailed.
error_code_ = res_detailed_moveit_msgs.error_code;
216 if (planning_success)
double smoothness_cost_weight_
robot_trajectory::RobotTrajectoryPtr trajectory_
std::string trajectory_initialization_method_
double planning_time_limit_
static CollisionDetectorAllocatorPtr create()
virtual bool adaptAndPlan(const PlannerFn &planner, const planning_scene::PlanningSceneConstPtr &ps, const planning_interface::MotionPlanRequest &req, planning_interface::MotionPlanResponse &res, std::vector< std::size_t > &added_path_index) const
std::vector< std::string > description_
double collision_threshold_
double pseudo_inverse_ridge_factor_
double smoothness_cost_acceleration_
double joint_update_limit_
moveit_msgs::MoveItErrorCodes error_code_
moveit_msgs::MoveItErrorCodes error_code_
double smoothness_cost_jerk_
double obstacle_cost_weight_
std::vector< double > processing_time_
bool solve(const planning_scene::PlanningSceneConstPtr &planning_scene, const moveit_msgs::MotionPlanRequest &req, const ChompParameters ¶ms, moveit_msgs::MotionPlanDetailedResponse &res) const
moveit_msgs::MotionPlanRequest MotionPlanRequest
double smoothness_cost_velocity_
bool use_stochastic_descent_
boost::function< bool(const planning_scene::PlanningSceneConstPtr &planning_scene, const planning_interface::MotionPlanRequest &req, planning_interface::MotionPlanResponse &res)> PlannerFn
chomp::ChompParameters params_
#define ROS_INFO_STREAM(args)
std::vector< robot_trajectory::RobotTrajectoryPtr > trajectory_
bool getParam(const std::string &key, std::string &s) const
virtual std::string getDescription() const
CLASS_LOADER_REGISTER_CLASS(chomp::OptimizerAdapter, planning_request_adapter::PlanningRequestAdapter)
int max_iterations_after_collision_free_