Robowflex  v0.1
Making MoveIt Easy
robowflex_library/src/planning.cpp
Go to the documentation of this file.
1 /* Author: Zachary Kingston */
2 
3 #include <moveit/robot_state/conversions.h>
4 
5 #include <robowflex_library/io.h>
12 
13 #define ROBOWFLEX_HAS_CARTESIAN_INTERPOLATOR \
14  ROBOWFLEX_INCLUDE_EXISTS("moveit/robot_state/cartesian_interpolator.h")
15 
16 #if ROBOWFLEX_HAS_CARTESIAN_INTERPOLATOR
17 #include <moveit/robot_state/cartesian_interpolator.h>
18 #endif
19 
20 using namespace robowflex;
21 
22 ///
23 /// Planner
24 ///
25 
27  : robot_(robot), handler_(robot_->getHandler(), name), name_(name)
28 {
29 }
30 
32 {
33  return robot_;
34 }
35 
37 {
38  return name_;
39 }
40 
41 void Planner::preRun(const SceneConstPtr & /*scene*/,
42  const planning_interface::MotionPlanRequest & /*request*/)
43 {
44 }
45 
47  const SceneConstPtr & /*scene*/, const planning_interface::MotionPlanRequest & /*request*/) const
48 
49 {
50  return {};
51 }
52 
53 ///
54 /// PoolPlanner
55 ///
56 
57 PoolPlanner::PoolPlanner(const RobotPtr &robot, unsigned int n, const std::string &name)
58  : Planner(robot, name), pool_(n)
59 {
60 }
61 
64 {
65  return pool_.submit(make_function([&] {
67  cv_.wait(lock, [&] { return !planners_.empty(); });
68 
69  auto planner = planners_.front();
70  planners_.pop();
71 
72  lock.unlock();
73 
74  auto result = planner->plan(scene, request);
75 
76  lock.lock();
77  planners_.emplace(planner);
78  cv_.notify_one();
79 
80  return result;
81  }));
82 }
83 
86 {
87  auto job = submit(scene, request);
88  return job->get();
89 }
90 
92 {
93  return planners_.front()->getPlannerConfigs();
94 }
95 
96 ///
97 /// SimpleCartesianPlanner
98 ///
99 
101  : Planner(robot, name)
102 {
103 }
104 
107 {
109  if (request.goal_constraints.size() > 1)
110  {
111  RBX_ERROR("SimpleCartesianPlanner only supports queries with a single goal!");
112  temp.error_code_.val = moveit_msgs::MoveItErrorCodes::INVALID_GOAL_CONSTRAINTS;
113  return temp;
114  }
115 
116  const auto &goal = request.goal_constraints[0];
117  if (not goal.joint_constraints.empty() or not goal.visibility_constraints.empty())
118  {
119  RBX_ERROR("SimpleCartesianPlanner only supports pose goals!");
120  temp.error_code_.val = moveit_msgs::MoveItErrorCodes::INVALID_GOAL_CONSTRAINTS;
121  return temp;
122  }
123 
124  if (goal.position_constraints.size() != 1 and goal.orientation_constraints.size() != 1)
125  {
126  RBX_ERROR("SimpleCartesianPlanner requires single position and orientation constraint!");
127  temp.error_code_.val = moveit_msgs::MoveItErrorCodes::INVALID_GOAL_CONSTRAINTS;
128  return temp;
129  }
130 
131  // Get sampleable region through IK Query
132  const auto &pc = goal.position_constraints[0];
133  const auto &oc = goal.orientation_constraints[0];
134  Robot::IKQuery query(request.group_name, pc, oc);
135  query.attempts = request.num_planning_attempts;
136  query.timeout = request.allowed_planning_time;
137  query.scene = scene;
138 
139  // Get starting state
140  auto state = robot_->allocState();
141  moveit::core::robotStateMsgToRobotState(request.start_state, *state);
142 
143  return plan(*state, query);
144 }
145 
147  const Robot::IKQuery &request)
148 {
150  if (request.tips.size() > 1)
151  {
152  RBX_ERROR("SimpleCartesianPlanner only supports queries with a single goal!");
153  response.error_code_.val = moveit_msgs::MoveItErrorCodes::INVALID_GOAL_CONSTRAINTS;
154  return response;
155  }
156 
157  std::string tip = request.tips[0];
158  if (tip.empty())
159  {
160  const auto &tips = robot_->getSolverTipFrames(request.group);
161  if (tips.size() == 1)
162  tip = tips[0];
163  else
164  {
165  RBX_ERROR("Request needs tip frame name!");
166  response.error_code_.val = moveit_msgs::MoveItErrorCodes::INVALID_GOAL_CONSTRAINTS;
167  return response;
168  }
169  }
170 
171  // Get JMG, link model, and GSVCF
172  const auto &model = robot_->getModelConst();
173  const auto &jmg = model->getJointModelGroup(request.group);
174  const auto &lm = model->getLinkModel(tip);
175 
177  if (request.scene)
178  gsvcf = request.scene->getGSVCF(false);
179 
181 
184 
185  double time = 0;
186  bool success = false;
187  ros::WallTime start_time = ros::WallTime::now();
188 
189  for (std::size_t i = 0; //
190  not success //
191  and ((request.attempts) ? i < request.attempts : true) //
192  and ((request.timeout > 0.) ? time < request.timeout : true); //
193  ++i)
194  {
195  auto state = start;
196 
197  RobotPose pose;
198  request.sampleRegion(pose, 0);
199 
200 #if ROBOWFLEX_HAS_CARTESIAN_INTERPOLATOR
201  double percentage = //
202  moveit::core::CartesianInterpolator::computeCartesianPath( //
203  &state, jmg, traj, lm, pose, true, step, jump, gsvcf);
204 #else
205  double percentage = //
206  state.computeCartesianPath( //
207  jmg, traj, lm, pose, true, step, jump, gsvcf);
208 #endif
209 
210  // Check if successful, output is percent of path computed.
211  success = std::fabs(percentage - 1.) < constants::eps;
212  time = (ros::WallTime::now() - start_time).toSec();
213  }
214 
215  Trajectory output(robot_, request.group);
216  for (const auto &state : traj)
217  output.addSuffixWaypoint(*state);
218 
220 
221  response.trajectory_ = output.getTrajectory();
222  response.planning_time_ = time;
223 
224  if (success)
225  response.error_code_.val = moveit_msgs::MoveItErrorCodes::SUCCESS;
226  else
227  response.error_code_.val = moveit_msgs::MoveItErrorCodes::FAILURE;
228 
229  return response;
230 }
231 
232 void SimpleCartesianPlanner::setMaxStep(double position, double rotation)
233 {
234  max_step_pos_ = position;
235  max_step_rot_ = rotation;
236 }
237 
238 void SimpleCartesianPlanner::setJumpThreshold(double prismatic, double revolute)
239 {
240  jump_threshold_pri_ = prismatic;
241  jump_threshold_rev_ = revolute;
242 }
243 
245 {
246  return std::vector<std::string>{"cartesian"};
247 }
248 
249 ///
250 /// PipelinePlanner
251 ///
252 
254 {
255 }
256 
259 {
261  if (pipeline_)
262  pipeline_->generatePlan(scene->getSceneConst(), request, response);
263 
264  return response;
265 }
266 
267 ///
268 /// OMPL
269 ///
270 
271 bool OMPL::loadOMPLConfig(IO::Handler &handler, const std::string &config_file,
272  std::vector<std::string> &configs)
273 {
274  if (config_file.empty())
275  return false;
276 
277  const auto &config = IO::loadFileToYAML(config_file);
278  if (!config.first)
279  {
280  RBX_ERROR("Failed to load planner configs.");
281  return false;
282  }
283 
284  handler.loadYAMLtoROS(config.second);
285 
286  const auto &planner_configs = config.second["planner_configs"];
287  if (planner_configs)
288  {
289  for (YAML::const_iterator it = planner_configs.begin(); it != planner_configs.end(); ++it)
290  configs.push_back(it->first.as<std::string>());
291  }
292 
293  return true;
294 }
295 
296 ///
297 /// OMPL::Settings
298 ///
299 
301  : max_goal_samples(10)
302  , max_goal_sampling_attempts(1000)
303  , max_planning_threads(4)
304  , max_solution_segment_length(0.0)
305  , max_state_sampling_attempts(4)
306  , minimum_waypoint_count(10)
307  , simplify_solutions(true)
308  , hybridize_solutions(true)
309  , interpolate_solutions(true)
310  , use_constraints_approximations(false)
311  , display_random_valid_states(false)
312  , link_for_exploration_tree("")
313  , maximum_waypoint_distance(0.0)
314 {
315 }
316 
318 {
319  const std::string prefix = "ompl/";
320  handler.setParam(prefix + "max_goal_samples", max_goal_samples);
321  handler.setParam(prefix + "max_goal_sampling_attempts", max_goal_sampling_attempts);
322  handler.setParam(prefix + "max_planning_threads", max_planning_threads);
323  handler.setParam(prefix + "max_solution_segment_length", max_solution_segment_length);
324  handler.setParam(prefix + "max_state_sampling_attempts", max_state_sampling_attempts);
325  handler.setParam(prefix + "minimum_waypoint_count", minimum_waypoint_count);
326  handler.setParam(prefix + "simplify_solutions", simplify_solutions);
327  handler.setParam(prefix + "use_constraints_approximations", use_constraints_approximations);
328  handler.setParam(prefix + "display_random_valid_states", display_random_valid_states);
329  handler.setParam(prefix + "link_for_exploration_tree", link_for_exploration_tree);
330  handler.setParam(prefix + "maximum_waypoint_distance", maximum_waypoint_distance);
331 }
332 
333 ///
334 /// OMPL::PipelinePlanner
335 ///
336 
337 const std::string OMPL::OMPLPipelinePlanner::DEFAULT_PLUGIN("ompl_interface/OMPLPlanner");
340  {"default_planner_request_adapters/AddTimeParameterization", //
341  "default_planner_request_adapters/FixWorkspaceBounds", //
342  "default_planner_request_adapters/FixStartStateBounds", //
343  "default_planner_request_adapters/FixStartStateCollision", //
344  "default_planner_request_adapters/FixStartStatePathConstraints"});
345 
347  : PipelinePlanner(robot, name)
348 {
349 }
350 
351 bool OMPL::OMPLPipelinePlanner::initialize(const std::string &config_file, const OMPL::Settings &settings,
352  const std::string &plugin,
353  const std::vector<std::string> &adapters)
354 {
355  if (!loadOMPLConfig(handler_, config_file, configs_))
356  return false;
357 
358  handler_.setParam("planning_plugin", plugin);
359 
361  for (std::size_t i = 0; i < adapters.size(); ++i)
362  {
363  ss << adapters[i];
364  if (i < adapters.size() - 1)
365  ss << " ";
366  }
367 
368  handler_.setParam("request_adapters", ss.str());
369  settings.setParam(handler_);
370 
371  pipeline_.reset(new planning_pipeline::PlanningPipeline(robot_->getModelConst(), handler_.getHandle(),
372  "planning_plugin", "request_adapters"));
373 
374  return true;
375 }
376 
378 {
379  return configs_;
380 }
381 
382 ///
383 /// Opt
384 ///
385 
386 bool opt::loadConfig(IO::Handler &handler, const std::string &config_file)
387 {
388  if (config_file.empty())
389  return false;
390 
391  const auto &config = IO::loadFileToYAML(config_file);
392  if (!config.first)
393  {
394  RBX_ERROR("Failed to load planner configs.");
395  return false;
396  }
397 
398  handler.loadYAMLtoROS(config.second);
399 
400  return true;
401 }
402 
403 ///
404 /// opt::CHOMPSettings
405 ///
406 
408  : planning_time_limit(10.0)
409  , max_iterations(200)
410  , max_iterations_after_collision_free(5)
411  , smoothness_cost_weight(0.1)
412  , obstacle_cost_weight(0.0)
413  , learning_rate(0.01)
414  , animate_path(true)
415  , add_randomness(false)
416  , smoothness_cost_velocity(0.0)
417  , smoothness_cost_acceleration(1.0)
418  , smoothness_cost_jerk(0.0)
419  , hmc_discretization(0.01)
420  , hmc_stochasticity(0.01)
421  , hmc_annealing_factor(0.99)
422  , use_hamiltonian_monte_carlo(false)
423  , ridge_factor(0.001)
424  , use_pseudo_inverse(false)
425  , pseudo_inverse_ridge_factor(1e-4)
426  , animate_endeffector(false)
427  , animate_endeffector_segment("")
428  , joint_update_limit(0.1)
429  , collision_clearence(0.2)
430  , collision_threshold(0.07)
431  , random_jump_amount(1.0)
432  , use_stochastic_descent(true)
433  , enable_failure_recovery(true)
434  , max_recovery_attempts(5)
435  , trajectory_initialization_method("quintic-spline")
436  , start_state_max_bounds_error(0.1)
437 {
438 }
439 
441 {
442  const std::string prefix;
443  handler.setParam(prefix + "planning_time_limit", planning_time_limit);
444  handler.setParam(prefix + "max_iterations", max_iterations);
445  handler.setParam(prefix + "max_iterations_after_collision_free", max_iterations_after_collision_free);
446  handler.setParam(prefix + "smoothness_cost_weight", smoothness_cost_weight);
447  handler.setParam(prefix + "obstacle_cost_weight", obstacle_cost_weight);
448  handler.setParam(prefix + "learning_rate", learning_rate);
449  handler.setParam(prefix + "animate_path", animate_path);
450  handler.setParam(prefix + "add_randomness", add_randomness);
451  handler.setParam(prefix + "smoothness_cost_velocity", smoothness_cost_velocity);
452  handler.setParam(prefix + "smoothness_cost_acceleration", smoothness_cost_acceleration);
453  handler.setParam(prefix + "smoothness_cost_jerk", smoothness_cost_jerk);
454  handler.setParam(prefix + "hmc_discretization", hmc_discretization);
455  handler.setParam(prefix + "hmc_stochasticity", hmc_stochasticity);
456  handler.setParam(prefix + "hmc_annealing_factor", hmc_annealing_factor);
457  handler.setParam(prefix + "use_hamiltonian_monte_carlo", use_hamiltonian_monte_carlo);
458  handler.setParam(prefix + "ridge_factor", ridge_factor);
459  handler.setParam(prefix + "use_pseudo_inverse", use_pseudo_inverse);
460  handler.setParam(prefix + "pseudo_inverse_ridge_factor", pseudo_inverse_ridge_factor);
461  handler.setParam(prefix + "animate_endeffector", animate_endeffector);
462  handler.setParam(prefix + "animate_endeffector_segment", animate_endeffector_segment);
463  handler.setParam(prefix + "joint_update_limit", joint_update_limit);
464  handler.setParam(prefix + "collision_clearence", collision_clearence);
465  handler.setParam(prefix + "collision_threshold", collision_threshold);
466  handler.setParam(prefix + "random_jump_amount", random_jump_amount);
467  handler.setParam(prefix + "use_stochastic_descent", use_stochastic_descent);
468  handler.setParam(prefix + "enable_failure_recovery", enable_failure_recovery);
469  handler.setParam(prefix + "max_recovery_attempts", max_recovery_attempts);
470  handler.setParam(prefix + "trajectory_initialization_method", trajectory_initialization_method);
471  handler.setParam(prefix + "start_state_max_bounds_error", start_state_max_bounds_error);
472 }
473 
474 ///
475 /// opt::CHOMPPipelinePlanner
476 ///
477 
478 const std::string opt::CHOMPPipelinePlanner::DEFAULT_PLUGIN("chomp_interface/CHOMPPlanner");
481  {"default_planner_request_adapters/FixWorkspaceBounds", //
482  "default_planner_request_adapters/FixStartStateBounds", //
483  "default_planner_request_adapters/FixStartStateCollision", //
484  "default_planner_request_adapters/FixStartStatePathConstraints", //
485  // "default_planner_request_adapters/ResolveConstraintFrames", //
486  "default_planner_request_adapters/AddTimeParameterization"});
487 
489  : PipelinePlanner(robot, name)
490 {
491 }
492 
494  const std::vector<std::string> &adapters)
495 {
496  settings.setParam(handler_);
497  return finishInitialize(plugin, adapters);
498 }
499 
500 bool opt::CHOMPPipelinePlanner::initialize(const std::string &config_file, const std::string &plugin,
501  const std::vector<std::string> &adapters)
502 {
503  if (!loadConfig(handler_, config_file))
504  return false;
505 
506  return finishInitialize(plugin, adapters);
507 }
508 
510  const std::vector<std::string> &adapters)
511 {
512  configs_.emplace_back("chomp");
513  handler_.setParam("planning_plugin", plugin);
514 
516  for (std::size_t i = 0; i < adapters.size(); ++i)
517  {
518  ss << adapters[i];
519  if (i < adapters.size() - 1)
520  ss << " ";
521  }
522 
523  handler_.setParam("request_adapters", ss.str());
524  pipeline_.reset(new planning_pipeline::PlanningPipeline(robot_->getModelConst(), handler_.getHandle(),
525  "planning_plugin", "request_adapters"));
526 
527  return true;
528 }
529 
531 {
532  return configs_;
533 }
534 
535 ///
536 /// opt::TrajOptPipelinePlanner
537 ///
538 
539 const std::string opt::TrajOptPipelinePlanner::DEFAULT_PLUGIN("trajopt_interface/TrajOptPlanner");
542  {"default_planner_request_adapters/AddTimeParameterization", //
543  "default_planner_request_adapters/FixWorkspaceBounds", //
544  "default_planner_request_adapters/FixStartStateBounds", //
545  "default_planner_request_adapters/FixStartStateCollision", //
546  "default_planner_request_adapters/FixStartStatePathConstraints"});
547 
549  : PipelinePlanner(robot, name)
550 {
551 }
552 
553 bool opt::TrajOptPipelinePlanner::initialize(const std::string &config_file, const std::string &plugin,
554  const std::vector<std::string> &adapters)
555 {
556  if (!loadConfig(handler_, config_file))
557  return false;
558 
559  handler_.setParam("planning_plugin", plugin);
560 
562  for (std::size_t i = 0; i < adapters.size(); ++i)
563  {
564  ss << adapters[i];
565  if (i < adapters.size() - 1)
566  ss << " ";
567  }
568 
569  handler_.setParam("request_adapters", ss.str());
570 
571  pipeline_.reset(new planning_pipeline::PlanningPipeline(robot_->getModelConst(), handler_.getHandle(),
572  "planning_plugin", "request_adapters"));
573 
574  return true;
575 }
ROS parameter server handler to handle namespacing and automatic parameter deletion.
Definition: handler.h:19
void setParam(const std::string &key, const T &value)
Sets a parameter on the parameter server.
Definition: handler.h:53
void loadYAMLtoROS(const YAML::Node &node, const std::string &prefix="")
Loads the contents of a YAML node to the parameter server under a prefix.
OMPLPipelinePlanner(const RobotPtr &robot, const std::string &name="")
static const std::string DEFAULT_PLUGIN
The default OMPL plugin.
static const std::vector< std::string > DEFAULT_ADAPTERS
The default planning adapters.
std::vector< std::string > getPlannerConfigs() const override
Return all planner configurations offered by this planner. Any of the configurations returned can be ...
bool initialize(const std::string &config_file="", const Settings &settings=Settings(), const std::string &plugin=DEFAULT_PLUGIN, const std::vector< std::string > &adapters=DEFAULT_ADAPTERS)
Initialize planning pipeline. Loads OMPL planning plugin plugin with the planning adapters adapters....
Settings descriptor for settings provided by the default MoveIt! OMPL planning pipeline.
void setParam(IO::Handler &handler) const
Sets member variables on the parameter server using handler.
Settings()
Constructor. Initialized here so an empty class can be used as default arguments in a function.
A motion planner that uses the MoveIt! planning pipeline to load a planner plugin.
PipelinePlanner(const RobotPtr &robot, const std::string &name="")
Constructor.
planning_pipeline::PlanningPipelinePtr pipeline_
Loaded planning pipeline plugin.
planning_interface::MotionPlanResponse plan(const SceneConstPtr &scene, const planning_interface::MotionPlanRequest &request) override
Plan a motion given a request and a scene. Uses the planning pipeline's generatePlan() method,...
An abstract interface to a motion planning algorithm.
const RobotPtr getRobot() const
Return the robot for this planner.
const std::string & getName() const
Get the name of the planner.
const std::string name_
Namespace for the planner.
virtual void preRun(const SceneConstPtr &scene, const planning_interface::MotionPlanRequest &request)
This function is called before benchmarking.
virtual std::map< std::string, ProgressProperty > getProgressProperties(const SceneConstPtr &scene, const planning_interface::MotionPlanRequest &request) const
Retrieve the planner progress property map for this planner given a specific request.
Planner(const RobotPtr &robot, const std::string &name="")
Constructor. Takes in a robot description and an optional namespace name. If name is specified,...
std::shared_ptr< Pool::Job< planning_interface::MotionPlanResponse > > submit(const SceneConstPtr &scene, const planning_interface::MotionPlanRequest &request)
Submit a motion planning request job to the queue.
planning_interface::MotionPlanResponse plan(const SceneConstPtr &scene, const planning_interface::MotionPlanRequest &request) override
Plan a motion given a request and a scene. Forwards the planning request onto the thread pool to be e...
std::condition_variable cv_
Planner condition variable.
std::queue< PlannerPtr > planners_
Motion planners.
std::vector< std::string > getPlannerConfigs() const override
Return all planner configurations offered by this planner. Any of the configurations returned can be ...
PoolPlanner(const RobotPtr &robot, unsigned int n=std::thread::hardware_concurrency(), const std::string &name="")
Constructor. Takes in a robot description and an optional namespace name. If name is specified,...
std::shared_ptr< Job< RT > > submit(const std::function< RT(Args...)> &&function, Args &&... args) const
Submit a function with arguments to be processed by the thread pool. Submitted functions must be wrap...
Definition: pool.h:209
A shared pointer wrapper for robowflex::Robot.
A const shared pointer wrapper for robowflex::Scene.
planning_interface::MotionPlanResponse plan(const robot_state::RobotState &start, const Robot::IKQuery &request)
Plan a Cartesian motion (interpolation) given a request and a scene from a start configuration....
void setJumpThreshold(double prismatic, double revolute)
Set the maximum difference in joint configurations allowed by the planner between output waypoints.
SimpleCartesianPlanner(const RobotPtr &robot, const std::string &name="")
Constructor.
std::vector< std::string > getPlannerConfigs() const override
Return all planner configurations offered by this planner. Any of the configurations returned can be ...
double max_step_rot_
Max EE step size for rotation in radians.
double max_step_pos_
Max EE step size for position in meters.
void setMaxStep(double position, double rotation)
Set the maximum step size allowed by the planner between output waypoints.
The Trajectory class is a wrapper around MoveIt!'s robot_trajectory::RobotTrajectory,...
Definition: trajectory.h:43
bool computeTimeParameterization(double max_velocity=1., double max_acceleration=1.)
Computes the time parameterization of a path according to a desired max velocity or acceleration.
Definition: trajectory.cpp:91
void addSuffixWaypoint(const robot_state::RobotState &state, double dt=1.)
Add a waypoint at the end of the trajectory.
Definition: trajectory.cpp:64
robot_trajectory::RobotTrajectoryPtr & getTrajectory()
Get a reference to the trajectory.
Definition: trajectory.cpp:74
static const std::string DEFAULT_PLUGIN
The default CHOMP plugin.
CHOMPPipelinePlanner(const RobotPtr &robot, const std::string &name="")
bool initialize(const std::string &config_file, const std::string &plugin=DEFAULT_PLUGIN, const std::vector< std::string > &adapters=DEFAULT_ADAPTERS)
Initialize planning pipeline. Loads CHOMP planning plugin plugin with the planning adapters adapters....
static const std::vector< std::string > DEFAULT_ADAPTERS
The default planning adapters.
std::vector< std::string > getPlannerConfigs() const override
Return all planner configurations offered by this planner. Any of the configurations returned can be ...
bool finishInitialize(const std::string &plugin, const std::vector< std::string > &adapters)
Finalize the initialization process after parameters are set.
Settings descriptor for settings provided by the default MoveIt! CHOMP planning pipeline.
void setParam(IO::Handler &handler) const
Sets member variables on the parameter server using handler.
CHOMPSettings()
Constructor. Initialized here so an empty class can be used as default arguments in a function.
TrajOptPipelinePlanner(const RobotPtr &robot, const std::string &name="")
bool initialize(const std::string &config_file="", const std::string &plugin=DEFAULT_PLUGIN, const std::vector< std::string > &adapters=DEFAULT_ADAPTERS)
Initialize planning pipeline. Loads TrajOpt planning plugin plugin with the planning adapters adapter...
static const std::vector< std::string > DEFAULT_ADAPTERS
The default planning adapters.
static const std::string DEFAULT_PLUGIN
The default TrajOpt plugin.
T empty(T... args)
T fabs(T... args)
#define RBX_ERROR(fmt,...)
Output a error logging message.
Definition: log.h:102
bool robotStateMsgToRobotState(const Transforms &tf, const moveit_msgs::RobotState &robot_state, RobotState &state, bool copy_attached_bodies=true)
boost::function< bool(RobotState *robot_state, const JointModelGroup *joint_group, const double *joint_group_variable_values)> GroupStateValidityCallbackFn
moveit_msgs::MotionPlanRequest MotionPlanRequest
Functions for loading and animating robots in Blender.
std::pair< bool, YAML::Node > loadFileToYAML(const std::string &path)
Loads a file to a YAML node.
bool loadOMPLConfig(IO::Handler &handler, const std::string &config_file, std::vector< std::string > &configs)
Loads an OMPL configuration YAML file onto the parameter server.
static const double eps
Definition: constants.h:16
bool loadConfig(IO::Handler &handler, const std::string &config_file)
Loads configuration YAML file onto the parameter server.
Main namespace. Contains all library classes and functions.
Definition: scene.cpp:25
std::decay< decltype(std::declval< moveit::core::Transforms >().getTransform("")) >::type RobotPose
A pose (point in SE(3)) used in various functions. Defined from what MoveIt! uses.
Definition: adapter.h:24
Functions for loading and animating scenes in Blender.
T push_back(T... args)
const std::vector< std::string > tips
T size(T... args)
T str(T... args)
moveit_msgs::MoveItErrorCodes error_code_
robot_trajectory::RobotTrajectoryPtr trajectory_
Robot IK Query options. IK queries in Robowflex consist of: a) A position specified by some geometric...
std::string group
Target joint group to do IK for.
bool sampleRegion(RobotPose &pose, std::size_t index) const
Sample desired end-effector pose for region at index.
SceneConstPtr scene
If provided, use this scene for collision checking.
std::size_t attempts
IK attempts (samples within regions).
std::vector< std::string > tips
List of end-effectors.