Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Needed to make source code modifications for STOMP pipeline planner support #284

Closed
timling96 opened this issue Aug 12, 2021 · 1 comment

Comments

@timling96
Copy link

timling96 commented Aug 12, 2021

Description of Issue

When integrating the stomp motion plan capabilities into the MTC framework using the pipeline_planner, the planning would result in the following warings and errors.
[ WARN] [1628763414.607187821]: JointLimits/panda_arm Requested Start State is out of bounds
[ERROR] [1628763420.218975661]: STOMP failed to find a valid solution after 41 iterations

I managed to work around this problem, by making some changes to the "pipeline_planner.cpp" file. (changes made are described below)
Is there a more elegant solution to this issue, without changing the source code of the library?

System Configuration

Ubuntu 20.04.2 LTS
ROS distro: noetic
ROS version: 1

Component Version

MoveIt version: master branch, built from source (https://github.com/ros-planning/moveit.git)
MTC: master branch, built from source (https://github.com/ros-planning/moveit_task_constructor.git)
stomp_ros: melodic-devel branch, built from source (https://github.com/ros-industrial/stomp_ros.git)
panda_moveit_config: melodic-devel branch (https://github.com/ros-planning/panda_moveit_config.git)

Steps to Reproduce the Issue

  1. Install dependencies
  2. Create simple cpp motion planning task using the stomp pipeline planner

Solution

(Necessary changes made to moveit_task_constructor/core/src/solvers/pipeline_planner.cpp)

  1. Include moveit/robot_state/conversions.h
  2. Copy the current state information from the "from" planning scene (from->CurrentState()) into the motion planning request start_state
#include <moveit/task_constructor/solvers/pipeline_planner.h>
#include <moveit/task_constructor/task.h>
#include <moveit/planning_scene/planning_scene.h>
#include <moveit/planning_pipeline/planning_pipeline.h>
#include <moveit_msgs/MotionPlanRequest.h>
#include <moveit/kinematic_constraints/utils.h>
#include <eigen_conversions/eigen_msg.h>

--> #include <moveit/robot_state/conversions.h>

...
bool PipelinePlanner::plan(const planning_scene::PlanningSceneConstPtr& from,
                           const planning_scene::PlanningSceneConstPtr& to, const moveit::core::JointModelGroup* jmg,
                           double timeout, robot_trajectory::RobotTrajectoryPtr& result,
                           const moveit_msgs::Constraints& path_constraints) {
	const auto& props = properties();
	moveit_msgs::MotionPlanRequest req;
	initMotionPlanRequest(req, props, jmg, timeout);

	req.goal_constraints.resize(1);
	req.goal_constraints[0] = kinematic_constraints::constructGoalConstraints(to->getCurrentState(), jmg,
	                                                                          props.get<double>("goal_joint_tolerance"));
	req.path_constraints = path_constraints;
	--> if (planner_->getPlannerPluginName() == "stomp_moveit/StompPlannerManager")
	-->    moveit::core::robotStateToRobotStateMsg(from->getCurrentState(), req.start_state);
	::planning_interface::MotionPlanResponse res;
	bool success = planner_->generatePlan(from, req, res);
	result = res.trajectory_;
	return success;
}
...
@v4hn
Copy link
Contributor

v4hn commented Aug 12, 2021

This is a known bug in the stomp_ros package with a trivial PR to fix this open for over a year now.

What's the situation there @gavanderhoorn ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants