Skip to content

Commit 8b4aa43

Browse files
committed
Merge branch 'master' into ros2
2 parents 08c1447 + 5d23cb8 commit 8b4aa43

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

core/include/moveit/task_constructor/stages.h

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "stages/generate_grasp_pose.h"
4848
#include "stages/generate_place_pose.h"
4949
#include "stages/generate_pose.h"
50+
#include "stages/generate_random_pose.h"
5051
#include "stages/modify_planning_scene.h"
5152
#include "stages/move_relative.h"
5253
#include "stages/move_to.h"

core/python/bindings/src/stages.cpp

+21
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ PYBIND11_SMART_HOLDER_TYPE_CASTERS(Connect)
5757
PYBIND11_SMART_HOLDER_TYPE_CASTERS(FixCollisionObjects)
5858
PYBIND11_SMART_HOLDER_TYPE_CASTERS(GenerateGraspPose)
5959
PYBIND11_SMART_HOLDER_TYPE_CASTERS(GeneratePlacePose)
60+
PYBIND11_SMART_HOLDER_TYPE_CASTERS(GenerateRandomPose)
6061
PYBIND11_SMART_HOLDER_TYPE_CASTERS(GeneratePose)
6162
PYBIND11_SMART_HOLDER_TYPE_CASTERS(Pick)
6263
PYBIND11_SMART_HOLDER_TYPE_CASTERS(Place)
@@ -405,6 +406,26 @@ void export_stages(pybind11::module& m) {
405406
)")
406407
.def(py::init<const std::string&>(), "name"_a);
407408

409+
py::enum_<GenerateRandomPose::PoseDimension>(m, "PoseDimension",
410+
R"(Define the dimensions of a pose that can be randomized.)")
411+
.value("X", GenerateRandomPose::PoseDimension::X, "X dimension")
412+
.value("Y", GenerateRandomPose::PoseDimension::Y, "Y dimension")
413+
.value("Z", GenerateRandomPose::PoseDimension::Z, "Z dimension")
414+
.value("ROLL", GenerateRandomPose::PoseDimension::ROLL, "Roll dimension")
415+
.value("PITCH", GenerateRandomPose::PoseDimension::PITCH, "Pitch dimension")
416+
.value("YAW", GenerateRandomPose::PoseDimension::YAW, "Yaw dimension");
417+
418+
properties::class_<GenerateRandomPose, GeneratePose>(m, "GenerateRandomPose", R"(
419+
Monitoring generator stage which can be used to generate random poses, based on solutions provided
420+
by the monitored stage and the specified pose dimension samplers.
421+
)")
422+
.def(py::init<const std::string&>(), "name"_a)
423+
.def("set_max_solutions", &GenerateRandomPose::setMaxSolutions, "max_solutions"_a)
424+
.def("sample_dimension", [](GenerateRandomPose& self, const GenerateRandomPose::PoseDimension pose_dimension,
425+
const double width) {
426+
self.sampleDimension<std::uniform_real_distribution>(pose_dimension, width);
427+
}, "pose_dimension"_a, "width"_a);
428+
408429
properties::class_<Pick, SerialContainer>(m, "Pick", R"(
409430
The Pick stage is a specialization of the PickPlaceBase class, which
410431
wraps the pipeline to pick or place an object with a given end effector.

core/src/solvers/cartesian_path.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ PlannerInterface::Result CartesianPath::plan(const planning_scene::PlanningScene
8989
Eigen::Isometry3d ik_pose_world;
9090

9191
if (!utils::getRobotTipForFrame(props.property("ik_frame"), *from, jmg, error_msg, link, ik_pose_world))
92-
return { false, error_msg };
92+
return { false, "CartesianPath: " + error_msg };
9393

9494
Eigen::Isometry3d offset = from->getCurrentState().getGlobalLinkTransform(link).inverse() * ik_pose_world;
9595

@@ -136,7 +136,7 @@ PlannerInterface::Result CartesianPath::plan(const planning_scene::PlanningScene
136136
props.get<double>("max_acceleration_scaling_factor"));
137137

138138
if (achieved_fraction < props.get<double>("min_fraction")) {
139-
return { false, "min_fraction not met. Achieved: " + std::to_string(achieved_fraction) };
139+
return { false, "CartesianPath: min_fraction not met. Achieved: " + std::to_string(achieved_fraction) };
140140
}
141141
return { true, "achieved fraction: " + std::to_string(achieved_fraction) };
142142
}

0 commit comments

Comments
 (0)