47 #include <tf2_eigen/tf2_eigen.hpp>
48 #include <tf2/LinearMath/Quaternion.h>
49 #include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
50 #include <tf2_ros/buffer.h>
52 #include <boost/python.hpp>
53 #include <boost/noncopyable.hpp>
54 #include <eigenpy/eigenpy.hpp>
68 class MoveGroupInterfaceWrapper :
protected py_bindings_tools::ROScppInitializer,
public MoveGroupInterface
73 MoveGroupInterfaceWrapper(
const std::string& group_name,
const std::string& robot_description,
74 const std::string& ns =
"",
double wait_for_servers = 5.0)
75 : py_bindings_tools::ROScppInitializer()
76 , MoveGroupInterface(Options(group_name, robot_description, ros::NodeHandle(ns)),
77 std::shared_ptr<
tf2_ros::Buffer>(), ros::WallDuration(wait_for_servers))
81 bool setJointValueTargetPerJointPythonList(
const std::string& joint, bp::list& values)
86 bool setJointValueTargetPythonIterable(bp::object& values)
91 bool setJointValueTargetPythonDict(bp::dict& values)
93 bp::list k = values.keys();
95 std::map<std::string, double> v;
96 for (
int i = 0; i < l; ++i)
97 v[bp::extract<std::string>(k[i])] = bp::extract<double>(values[k[i]]);
98 return setJointValueTarget(v);
101 bool setJointValueTargetFromPosePython(
const py_bindings_tools::ByteString& pose_str,
const std::string& eef,
104 geometry_msgs::Pose pose_msg;
106 return approx ? setApproximateJointValueTarget(pose_msg, eef) : setJointValueTarget(pose_msg, eef);
109 bool setJointValueTargetFromPoseStampedPython(
const py_bindings_tools::ByteString& pose_str,
const std::string& eef,
112 geometry_msgs::PoseStamped pose_msg;
114 return approx ? setApproximateJointValueTarget(pose_msg, eef) : setJointValueTarget(pose_msg, eef);
117 bool setJointValueTargetFromJointStatePython(
const py_bindings_tools::ByteString& js_str)
119 sensor_msgs::JointState js_msg;
121 return setJointValueTarget(js_msg);
124 bp::list getJointValueTargetPythonList()
126 std::vector<double> values;
129 for (
const double value : values)
134 py_bindings_tools::ByteString getJointValueTarget()
136 moveit_msgs::msg::RobotState msg;
142 void rememberJointValuesFromPythonList(
const std::string&
string, bp::list& values)
147 const char* getPlanningFrameCStr()
const
149 return getPlanningFrame().c_str();
152 py_bindings_tools::ByteString getInterfaceDescriptionPython()
154 moveit_msgs::msg::PlannerInterfaceDescription msg;
155 getInterfaceDescription(msg);
159 bp::list getActiveJointsList()
const
164 bp::list getJointsList()
const
169 bp::list getCurrentJointValuesList()
174 bp::list getRandomJointValuesList()
179 bp::dict getRememberedJointValuesPython()
const
181 const std::map<std::string, std::vector<double>>& rv = getRememberedJointValues();
183 for (
const std::pair<
const std::string, std::vector<double>>& it : rv)
188 bp::list convertPoseToList(
const geometry_msgs::Pose& pose)
const
190 std::vector<double> v(7);
191 v[0] = pose.position.x;
192 v[1] = pose.position.y;
193 v[2] = pose.position.z;
194 v[3] = pose.orientation.x;
195 v[4] = pose.orientation.y;
196 v[5] = pose.orientation.z;
197 v[6] = pose.orientation.w;
201 bp::list convertTransformToList(
const geometry_msgs::Transform& tr)
const
203 std::vector<double> v(7);
204 v[0] = tr.translation.x;
205 v[1] = tr.translation.y;
206 v[2] = tr.translation.z;
207 v[3] = tr.rotation.x;
208 v[4] = tr.rotation.y;
209 v[5] = tr.rotation.z;
210 v[6] = tr.rotation.w;
214 void convertListToTransform(
const bp::list& l, geometry_msgs::Transform& tr)
const
217 tr.translation.x = v[0];
218 tr.translation.y = v[1];
219 tr.translation.z = v[2];
220 tr.rotation.x = v[3];
221 tr.rotation.y = v[4];
222 tr.rotation.z = v[5];
223 tr.rotation.w = v[6];
226 void convertListToPose(
const bp::list& l, geometry_msgs::Pose&
p)
const
232 p.orientation.x = v[3];
233 p.orientation.y = v[4];
234 p.orientation.z = v[5];
235 p.orientation.w = v[6];
238 bp::list getCurrentRPYPython(
const std::string& end_effector_link =
"")
243 bp::list getCurrentPosePython(
const std::string& end_effector_link =
"")
245 geometry_msgs::PoseStamped pose = getCurrentPose(end_effector_link);
246 return convertPoseToList(pose.pose);
249 bp::list getRandomPosePython(
const std::string& end_effector_link =
"")
251 geometry_msgs::PoseStamped pose = getRandomPose(end_effector_link);
252 return convertPoseToList(pose.pose);
255 bp::list getKnownConstraintsList()
const
260 bool placePose(
const std::string& object_name,
const bp::list& pose,
bool plan_only =
false)
262 geometry_msgs::PoseStamped msg;
263 convertListToPose(pose, msg.pose);
264 msg.header.frame_id = getPoseReferenceFrame();
265 msg.header.stamp = ros::Time::now();
267 return place(object_name, msg, plan_only) == moveit::core::MoveItErrorCode::SUCCESS;
270 bool placePoses(
const std::string& object_name,
const bp::list& poses_list,
bool plan_only =
false)
272 int l = bp::len(poses_list);
273 std::vector<geometry_msgs::PoseStamped> poses(l);
274 for (
int i = 0; i < l; ++i)
277 return place(object_name, poses, plan_only) == moveit::core::MoveItErrorCode::SUCCESS;
280 bool placeLocation(
const std::string& object_name,
const py_bindings_tools::ByteString& location_str,
281 bool plan_only =
false)
283 std::vector<moveit_msgs::action::PlaceLocation> locations(1);
286 return place(object_name, std::move(locations), plan_only) == moveit::core::MoveItErrorCode::SUCCESS;
289 bool placeLocations(
const std::string& object_name,
const bp::list& location_list,
bool plan_only =
false)
291 int l = bp::len(location_list);
292 std::vector<moveit_msgs::PlaceLocation> locations(l);
293 for (
int i = 0; i < l; ++i)
296 return place(object_name, std::move(locations), plan_only) == moveit::core::MoveItErrorCode::SUCCESS;
299 bool placeAnywhere(
const std::string& object_name,
bool plan_only =
false)
302 return place(object_name, plan_only) == moveit::core::MoveItErrorCode::SUCCESS;
305 void convertListToArrayOfPoses(
const bp::list& poses, std::vector<geometry_msgs::Pose>& msg)
307 int l = bp::len(poses);
308 for (
int i = 0; i < l; ++i)
310 const bp::list& pose = bp::extract<bp::list>(poses[i]);
312 if (v.size() == 6 || v.size() == 7)
318 tq.setRPY(v[3], v[4], v[5]);
319 Eigen::Quaterniond eq;
320 tf2::convert(tq, eq);
321 p = Eigen::Isometry3d(eq);
324 p = Eigen::Isometry3d(Eigen::Quaterniond(v[6], v[3], v[4], v[5]));
326 geometry_msgs::Pose pm = tf2::toMsg(
p);
330 ROS_WARN(
"Incorrect number of values for a pose: %u", (
unsigned int)v.size());
334 bp::dict getCurrentStateBoundedPython()
336 moveit::core::RobotStatePtr current = getCurrentState();
337 current->enforceBounds();
338 moveit_msgs::msg::RobotState rsmv;
341 for (
size_t x = 0;
x < rsmv.joint_state.name.size(); ++
x)
342 output[rsmv.joint_state.name[
x]] = rsmv.joint_state.position[
x];
346 py_bindings_tools::ByteString getCurrentStatePython()
348 moveit::core::RobotStatePtr current_state = getCurrentState();
349 moveit_msgs::RobotState state_message;
354 void setStartStatePython(
const py_bindings_tools::ByteString& msg_str)
356 moveit_msgs::msg::RobotState msg;
361 bool setPoseTargetsPython(bp::list& poses,
const std::string& end_effector_link =
"")
363 std::vector<geometry_msgs::Pose> msg;
364 convertListToArrayOfPoses(poses, msg);
365 return setPoseTargets(msg, end_effector_link);
367 py_bindings_tools::ByteString getPoseTargetPython(
const std::string& end_effector_link)
373 bool setPoseTargetPython(bp::list& pose,
const std::string& end_effector_link =
"")
376 geometry_msgs::Pose msg;
380 q.setRPY(v[3], v[4], v[5]);
381 tf2::convert(q, msg.orientation);
383 else if (v.size() == 7)
385 msg.orientation.x = v[3];
386 msg.orientation.y = v[4];
387 msg.orientation.z = v[5];
388 msg.orientation.w = v[6];
392 ROS_ERROR(
"Pose description expected to consist of either 6 or 7 values");
395 msg.position.x = v[0];
396 msg.position.y = v[1];
397 msg.position.z = v[2];
398 return setPoseTarget(msg, end_effector_link);
401 const char* getEndEffectorLinkCStr()
const
403 return getEndEffectorLink().c_str();
406 const char* getPoseReferenceFrameCStr()
const
408 return getPoseReferenceFrame().c_str();
411 const char* getNameCStr()
const
413 return getName().c_str();
416 const char* getPlannerIdCStr()
const
418 return getPlannerId().c_str();
421 const char* getPlanningPipelineIdCStr()
const
423 return getPlanningPipelineId().c_str();
426 bp::dict getNamedTargetValuesPython(
const std::string&
name)
429 std::map<std::string, double> positions = getNamedTargetValues(
name);
430 std::map<std::string, double>::iterator iterator;
432 for (iterator = positions.begin(); iterator != positions.end(); ++iterator)
433 output[iterator->first] = iterator->second;
437 bp::list getNamedTargetsPython()
445 return move() == moveit::core::MoveItErrorCode::SUCCESS;
448 bool asyncMovePython()
450 return asyncMove() == moveit::core::MoveItErrorCode::SUCCESS;
453 bool attachObjectPython(
const std::string& object_name,
const std::string& link_name,
const bp::list& touch_links)
458 bool executePython(
const py_bindings_tools::ByteString& plan_str)
460 MoveGroupInterface::Plan
plan;
463 return execute(
plan) == moveit::core::MoveItErrorCode::SUCCESS;
466 bool asyncExecutePython(
const py_bindings_tools::ByteString& plan_str)
468 MoveGroupInterface::Plan
plan;
470 return asyncExecute(
plan) == moveit::core::MoveItErrorCode::SUCCESS;
473 bp::tuple planPython()
475 MoveGroupInterface::Plan
plan;
476 moveit_msgs::MoveItErrorCodes res;
482 plan.planning_time_);
485 py_bindings_tools::ByteString constructMotionPlanRequestPython()
488 constructMotionPlanRequest(request);
492 bp::tuple computeCartesianPathPython(
const bp::list&
waypoints,
double eef_step,
double jump_threshold,
493 bool avoid_collisions)
495 moveit_msgs::msg::Constraints path_constraints_tmp;
496 return doComputeCartesianPathPython(
waypoints, eef_step, jump_threshold, avoid_collisions, path_constraints_tmp);
499 bp::tuple computeCartesianPathConstrainedPython(
const bp::list&
waypoints,
double eef_step,
double jump_threshold,
500 bool avoid_collisions,
501 const py_bindings_tools::ByteString& path_constraints_str)
508 bp::tuple doComputeCartesianPathPython(
const bp::list&
waypoints,
double eef_step,
double jump_threshold,
509 bool avoid_collisions,
const moveit_msgs::msg::Constraints&
path_constraints)
511 std::vector<geometry_msgs::Pose> poses;
512 convertListToArrayOfPoses(
waypoints, poses);
513 moveit_msgs::msg::RobotTrajectory trajectory;
522 int pickGrasp(
const std::string&
object,
const py_bindings_tools::ByteString& grasp_str,
bool plan_only =
false)
524 moveit_msgs::msg::Grasp grasp;
527 return pick(
object, grasp, plan_only).val;
530 int pickGrasps(
const std::string&
object,
const bp::list& grasp_list,
bool plan_only =
false)
532 int l = bp::len(grasp_list);
533 std::vector<moveit_msgs::msg::Grasp> grasps(l);
534 for (
int i = 0; i < l; ++i)
537 return pick(
object, std::move(grasps), plan_only).val;
540 void setPathConstraintsFromMsg(
const py_bindings_tools::ByteString& constraints_str)
542 moveit_msgs::msg::Constraints constraints_msg;
544 setPathConstraints(constraints_msg);
547 py_bindings_tools::ByteString getPathConstraintsPython()
549 moveit_msgs::msg::Constraints constraints_msg(getPathConstraints());
553 void setTrajectoryConstraintsFromMsg(
const py_bindings_tools::ByteString& constraints_str)
555 moveit_msgs::TrajectoryConstraints constraints_msg;
557 setTrajectoryConstraints(constraints_msg);
560 py_bindings_tools::ByteString getTrajectoryConstraintsPython()
562 moveit_msgs::TrajectoryConstraints constraints_msg(getTrajectoryConstraints());
566 py_bindings_tools::ByteString retimeTrajectory(
const py_bindings_tools::ByteString& ref_state_str,
567 const py_bindings_tools::ByteString& traj_str,
568 double velocity_scaling_factor,
double acceleration_scaling_factor,
569 const std::string& algorithm)
572 moveit_msgs::msg::RobotState ref_state_msg;
578 moveit_msgs::msg::RobotTrajectory traj_msg;
580 bool algorithm_found =
true;
584 traj_obj.setRobotTrajectoryMsg(ref_state_obj, traj_msg);
587 if (algorithm ==
"iterative_time_parameterization")
590 time_param.
computeTimeStamps(traj_obj, velocity_scaling_factor, acceleration_scaling_factor);
592 else if (algorithm ==
"iterative_spline_parameterization")
595 time_param.
computeTimeStamps(traj_obj, velocity_scaling_factor, acceleration_scaling_factor);
597 else if (algorithm ==
"time_optimal_trajectory_generation")
600 time_param.
computeTimeStamps(traj_obj, velocity_scaling_factor, acceleration_scaling_factor);
604 ROS_ERROR_STREAM_NAMED(
"move_group_py",
"Unknown time parameterization algorithm: " << algorithm);
605 algorithm_found =
false;
606 traj_msg = moveit_msgs::RobotTrajectory();
611 traj_obj.getRobotTrajectoryMsg(traj_msg);
617 ROS_ERROR(
"Unable to convert RobotState message to RobotState instance.");
618 return py_bindings_tools::ByteString(
"");
622 Eigen::MatrixXd getJacobianMatrixPython(
const bp::list& joint_values,
const bp::object& reference_point = bp::object())
625 std::vector<double> ref;
626 if (reference_point.is_none())
627 ref = { 0.0, 0.0, 0.0 };
631 throw std::invalid_argument(
"reference point needs to have 3 elements, got " + std::to_string(ref.size()));
634 state.setToDefaultValues();
635 auto group = state.getJointModelGroup(getName());
636 state.setJointGroupPositions(
group, v);
637 return state.getJacobian(
group, Eigen::Map<Eigen::Vector3d>(&ref[0]));
640 py_bindings_tools::ByteString enforceBoundsPython(
const py_bindings_tools::ByteString& msg_str)
642 moveit_msgs::RobotState state_msg;
647 state.enforceBounds();
653 ROS_ERROR(
"Unable to convert RobotState message to RobotState instance.");
654 return py_bindings_tools::ByteString(
"");
659 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getJacobianMatrixOverloads, getJacobianMatrixPython, 1, 2)
661 static
void wrap_move_group_interface()
663 eigenpy::enableEigenPy();
665 bp::class_<MoveGroupInterfaceWrapper, boost::noncopyable> move_group_interface_class(
666 "MoveGroupInterface", bp::init<std::string, std::string, bp::optional<std::string, double>>());
668 move_group_interface_class.def(
"async_move", &MoveGroupInterfaceWrapper::asyncMovePython);
669 move_group_interface_class.def(
"move", &MoveGroupInterfaceWrapper::movePython);
670 move_group_interface_class.def(
"execute", &MoveGroupInterfaceWrapper::executePython);
671 move_group_interface_class.def(
"async_execute", &MoveGroupInterfaceWrapper::asyncExecutePython);
673 &MoveGroupInterfaceWrapper::pick;
674 move_group_interface_class.def(
"pick", pick_1);
675 move_group_interface_class.def(
"pick", &MoveGroupInterfaceWrapper::pickGrasp);
676 move_group_interface_class.def(
"pick", &MoveGroupInterfaceWrapper::pickGrasps);
677 move_group_interface_class.def(
"place", &MoveGroupInterfaceWrapper::placePose);
678 move_group_interface_class.def(
"place_poses_list", &MoveGroupInterfaceWrapper::placePoses);
679 move_group_interface_class.def(
"place", &MoveGroupInterfaceWrapper::placeLocation);
680 move_group_interface_class.def(
"place_locations_list", &MoveGroupInterfaceWrapper::placeLocations);
681 move_group_interface_class.def(
"place", &MoveGroupInterfaceWrapper::placeAnywhere);
682 move_group_interface_class.def(
"stop", &MoveGroupInterfaceWrapper::stop);
684 move_group_interface_class.def(
"get_name", &MoveGroupInterfaceWrapper::getNameCStr);
685 move_group_interface_class.def(
"get_planning_frame", &MoveGroupInterfaceWrapper::getPlanningFrameCStr);
686 move_group_interface_class.def(
"get_interface_description", &MoveGroupInterfaceWrapper::getInterfaceDescriptionPython);
688 move_group_interface_class.def(
"get_active_joints", &MoveGroupInterfaceWrapper::getActiveJointsList);
689 move_group_interface_class.def(
"get_joints", &MoveGroupInterfaceWrapper::getJointsList);
690 move_group_interface_class.def(
"get_variable_count", &MoveGroupInterfaceWrapper::getVariableCount);
691 move_group_interface_class.def(
"allow_looking", &MoveGroupInterfaceWrapper::allowLooking);
692 move_group_interface_class.def(
"allow_replanning", &MoveGroupInterfaceWrapper::allowReplanning);
694 move_group_interface_class.def(
"set_pose_reference_frame", &MoveGroupInterfaceWrapper::setPoseReferenceFrame);
696 move_group_interface_class.def(
"set_pose_reference_frame", &MoveGroupInterfaceWrapper::setPoseReferenceFrame);
697 move_group_interface_class.def(
"set_end_effector_link", &MoveGroupInterfaceWrapper::setEndEffectorLink);
698 move_group_interface_class.def(
"get_end_effector_link", &MoveGroupInterfaceWrapper::getEndEffectorLinkCStr);
699 move_group_interface_class.def(
"get_pose_reference_frame", &MoveGroupInterfaceWrapper::getPoseReferenceFrameCStr);
701 move_group_interface_class.def(
"set_pose_target", &MoveGroupInterfaceWrapper::setPoseTargetPython);
703 move_group_interface_class.def(
"set_pose_targets", &MoveGroupInterfaceWrapper::setPoseTargetsPython);
705 move_group_interface_class.def(
"set_position_target", &MoveGroupInterfaceWrapper::setPositionTarget);
706 move_group_interface_class.def(
"set_rpy_target", &MoveGroupInterfaceWrapper::setRPYTarget);
707 move_group_interface_class.def(
"set_orientation_target", &MoveGroupInterfaceWrapper::setOrientationTarget);
709 move_group_interface_class.def(
"get_current_pose", &MoveGroupInterfaceWrapper::getCurrentPosePython);
710 move_group_interface_class.def(
"get_current_rpy", &MoveGroupInterfaceWrapper::getCurrentRPYPython);
712 move_group_interface_class.def(
"get_random_pose", &MoveGroupInterfaceWrapper::getRandomPosePython);
714 move_group_interface_class.def(
"clear_pose_target", &MoveGroupInterfaceWrapper::clearPoseTarget);
715 move_group_interface_class.def(
"clear_pose_targets", &MoveGroupInterfaceWrapper::clearPoseTargets);
717 move_group_interface_class.def(
"set_joint_value_target",
718 &MoveGroupInterfaceWrapper::setJointValueTargetPythonIterable);
719 move_group_interface_class.def(
"set_joint_value_target", &MoveGroupInterfaceWrapper::setJointValueTargetPythonDict);
721 move_group_interface_class.def(
"set_joint_value_target",
722 &MoveGroupInterfaceWrapper::setJointValueTargetPerJointPythonList);
723 bool (MoveGroupInterfaceWrapper::*set_joint_value_target_4)(
const std::string&, double) =
724 &MoveGroupInterfaceWrapper::setJointValueTarget;
725 move_group_interface_class.def(
"set_joint_value_target", set_joint_value_target_4);
727 move_group_interface_class.def(
"set_joint_value_target_from_pose",
728 &MoveGroupInterfaceWrapper::setJointValueTargetFromPosePython);
729 move_group_interface_class.def(
"set_joint_value_target_from_pose_stamped",
730 &MoveGroupInterfaceWrapper::setJointValueTargetFromPoseStampedPython);
731 move_group_interface_class.def(
"set_joint_value_target_from_joint_state_message",
732 &MoveGroupInterfaceWrapper::setJointValueTargetFromJointStatePython);
734 move_group_interface_class.def(
"get_joint_value_target", &MoveGroupInterfaceWrapper::getJointValueTargetPythonList);
736 move_group_interface_class.def(
"set_named_target", &MoveGroupInterfaceWrapper::setNamedTarget);
737 move_group_interface_class.def(
"set_random_target", &MoveGroupInterfaceWrapper::setRandomTarget);
739 void (MoveGroupInterfaceWrapper::*remember_joint_values_2)(
const std::string&) =
740 &MoveGroupInterfaceWrapper::rememberJointValues;
741 move_group_interface_class.def(
"remember_joint_values", remember_joint_values_2);
743 move_group_interface_class.def(
"remember_joint_values", &MoveGroupInterfaceWrapper::rememberJointValuesFromPythonList);
745 move_group_interface_class.def(
"start_state_monitor", &MoveGroupInterfaceWrapper::startStateMonitor);
746 move_group_interface_class.def(
"get_current_joint_values", &MoveGroupInterfaceWrapper::getCurrentJointValuesList);
747 move_group_interface_class.def(
"get_random_joint_values", &MoveGroupInterfaceWrapper::getRandomJointValuesList);
748 move_group_interface_class.def(
"get_remembered_joint_values",
749 &MoveGroupInterfaceWrapper::getRememberedJointValuesPython);
751 move_group_interface_class.def(
"forget_joint_values", &MoveGroupInterfaceWrapper::forgetJointValues);
753 move_group_interface_class.def(
"get_goal_joint_tolerance", &MoveGroupInterfaceWrapper::getGoalJointTolerance);
754 move_group_interface_class.def(
"get_goal_position_tolerance", &MoveGroupInterfaceWrapper::getGoalPositionTolerance);
755 move_group_interface_class.def(
"get_goal_orientation_tolerance",
756 &MoveGroupInterfaceWrapper::getGoalOrientationTolerance);
758 move_group_interface_class.def(
"set_goal_joint_tolerance", &MoveGroupInterfaceWrapper::setGoalJointTolerance);
759 move_group_interface_class.def(
"set_goal_position_tolerance", &MoveGroupInterfaceWrapper::setGoalPositionTolerance);
760 move_group_interface_class.def(
"set_goal_orientation_tolerance",
761 &MoveGroupInterfaceWrapper::setGoalOrientationTolerance);
762 move_group_interface_class.def(
"set_goal_tolerance", &MoveGroupInterfaceWrapper::setGoalTolerance);
764 move_group_interface_class.def(
"set_start_state_to_current_state",
765 &MoveGroupInterfaceWrapper::setStartStateToCurrentState);
766 move_group_interface_class.def(
"set_start_state", &MoveGroupInterfaceWrapper::setStartStatePython);
768 bool (MoveGroupInterfaceWrapper::*set_path_constraints_1)(
const std::string&) =
769 &MoveGroupInterfaceWrapper::setPathConstraints;
770 move_group_interface_class.def(
"set_path_constraints", set_path_constraints_1);
771 move_group_interface_class.def(
"set_path_constraints_from_msg", &MoveGroupInterfaceWrapper::setPathConstraintsFromMsg);
772 move_group_interface_class.def(
"get_path_constraints", &MoveGroupInterfaceWrapper::getPathConstraintsPython);
773 move_group_interface_class.def(
"clear_path_constraints", &MoveGroupInterfaceWrapper::clearPathConstraints);
775 move_group_interface_class.def(
"set_trajectory_constraints_from_msg",
776 &MoveGroupInterfaceWrapper::setTrajectoryConstraintsFromMsg);
777 move_group_interface_class.def(
"get_trajectory_constraints",
778 &MoveGroupInterfaceWrapper::getTrajectoryConstraintsPython);
779 move_group_interface_class.def(
"clear_trajectory_constraints", &MoveGroupInterfaceWrapper::clearTrajectoryConstraints);
780 move_group_interface_class.def(
"get_known_constraints", &MoveGroupInterfaceWrapper::getKnownConstraintsList);
781 move_group_interface_class.def(
"set_constraints_database", &MoveGroupInterfaceWrapper::setConstraintsDatabase);
782 move_group_interface_class.def(
"set_workspace", &MoveGroupInterfaceWrapper::setWorkspace);
783 move_group_interface_class.def(
"set_planning_time", &MoveGroupInterfaceWrapper::setPlanningTime);
784 move_group_interface_class.def(
"get_planning_time", &MoveGroupInterfaceWrapper::getPlanningTime);
785 move_group_interface_class.def(
"set_max_velocity_scaling_factor",
786 &MoveGroupInterfaceWrapper::setMaxVelocityScalingFactor);
787 move_group_interface_class.def(
"set_max_acceleration_scaling_factor",
788 &MoveGroupInterfaceWrapper::setMaxAccelerationScalingFactor);
789 move_group_interface_class.def(
"set_planner_id", &MoveGroupInterfaceWrapper::setPlannerId);
790 move_group_interface_class.def(
"get_planner_id", &MoveGroupInterfaceWrapper::getPlannerIdCStr);
791 move_group_interface_class.def(
"set_planning_pipeline_id", &MoveGroupInterfaceWrapper::setPlanningPipelineId);
792 move_group_interface_class.def(
"get_planning_pipeline_id", &MoveGroupInterfaceWrapper::getPlanningPipelineIdCStr);
793 move_group_interface_class.def(
"set_num_planning_attempts", &MoveGroupInterfaceWrapper::setNumPlanningAttempts);
794 move_group_interface_class.def(
"plan", &MoveGroupInterfaceWrapper::planPython);
795 move_group_interface_class.def(
"construct_motion_plan_request",
796 &MoveGroupInterfaceWrapper::constructMotionPlanRequestPython);
797 move_group_interface_class.def(
"compute_cartesian_path", &MoveGroupInterfaceWrapper::computeCartesianPathPython);
798 move_group_interface_class.def(
"compute_cartesian_path",
799 &MoveGroupInterfaceWrapper::computeCartesianPathConstrainedPython);
800 move_group_interface_class.def(
"set_support_surface_name", &MoveGroupInterfaceWrapper::setSupportSurfaceName);
801 move_group_interface_class.def(
"attach_object", &MoveGroupInterfaceWrapper::attachObjectPython);
802 move_group_interface_class.def(
"detach_object", &MoveGroupInterfaceWrapper::detachObject);
803 move_group_interface_class.def(
"retime_trajectory", &MoveGroupInterfaceWrapper::retimeTrajectory);
804 move_group_interface_class.def(
"get_named_targets", &MoveGroupInterfaceWrapper::getNamedTargetsPython);
805 move_group_interface_class.def(
"get_named_target_values", &MoveGroupInterfaceWrapper::getNamedTargetValuesPython);
806 move_group_interface_class.def(
"get_current_state_bounded", &MoveGroupInterfaceWrapper::getCurrentStateBoundedPython);
807 move_group_interface_class.def(
"get_current_state", &MoveGroupInterfaceWrapper::getCurrentStatePython);
808 move_group_interface_class.def(
"get_jacobian_matrix", &MoveGroupInterfaceWrapper::getJacobianMatrixPython,
809 getJacobianMatrixOverloads());
810 move_group_interface_class.def(
"enforce_bounds", &MoveGroupInterfaceWrapper::enforceBoundsPython);
818 wrap_move_group_interface();
Representation of a robot's state. This includes position, velocity, acceleration and effort.
moveit::core::MoveItErrorCode plan(Plan &plan)
Compute a motion plan that takes the group declared in the constructor from the current state to the ...
const geometry_msgs::msg::PoseStamped & getPoseTarget(const std::string &end_effector_link="") const
const moveit::core::RobotState & getJointValueTarget() const
Get the currently set joint state goal, replaced by private getTargetRobotState()
const moveit::core::RobotState & getTargetRobotState() const
Maintain a sequence of waypoints and the time durations between these waypoints.
bool computeTimeStamps(robot_trajectory::RobotTrajectory &trajectory, const double max_velocity_scaling_factor=1.0, const double max_acceleration_scaling_factor=1.0) const override
This class sets the timestamps of a trajectory to enforce velocity, acceleration constraints....
bool computeTimeStamps(robot_trajectory::RobotTrajectory &trajectory, const double max_velocity_scaling_factor=1.0, const double max_acceleration_scaling_factor=1.0) const override
bool computeTimeStamps(robot_trajectory::RobotTrajectory &trajectory, const double max_velocity_scaling_factor=1.0, const double max_acceleration_scaling_factor=1.0) const override
Vec3fX< details::Vec3Data< double > > Vector3d
void robotStateToRobotStateMsg(const RobotState &state, moveit_msgs::msg::RobotState &robot_state, bool copy_attached_bodies=true)
Convert a MoveIt robot state to a robot state message.
bool robotStateMsgToRobotState(const Transforms &tf, const moveit_msgs::msg::RobotState &robot_state, RobotState &state, bool copy_attached_bodies=true)
Convert a robot state msg (with accompanying extra transforms) to a MoveIt robot state.
Simple interface to MoveIt components.
moveit::core::MoveItErrorCode MoveItErrorCode
Main namespace for MoveIt.
This namespace includes the base class for MoveIt planners.
moveit_msgs::msg::MotionPlanRequest MotionPlanRequest
BOOST_PYTHON_MODULE(_moveit_roscpp_initializer)