MoveIt Pro API
Core Behaviors for MoveIt Pro
Loading...
Searching...
No Matches
pro_rrt Namespace Reference

Namespaces

namespace  internal
 
namespace  scenario_runner
 

Classes

struct  Constraints
 Definition of kinematic constraints to take into account during planning. More...
 
struct  JointRangeConstraint
 
struct  JointRangeEntry
 One row of the joint_range_constraint BT input port (per-joint tightening of URDF limits). More...
 
struct  PlanarRotationConstraint
 
struct  PlanningError
 Definition of planning error return type with a string and optional collision results. More...
 
class  PlanningTestFixture
 
struct  RRTParams
 Configuration parameters for the RRT planner. More...
 
struct  ScenarioInput
 
struct  ScenarioOutput
 Outcome of a single planTrajectoryToJointGoal(...) call as captured for scenario logging. More...
 
struct  TrajectoryParams
 Parameters for the trajectory generation. More...
 
struct  TrajectorySummary
 Summary statistics of the planned trajectory — present iff planning succeeded. More...
 

Typedefs

using ContactMap = moveit_pro::base::collision_detection::CollisionResult::ContactMap
 

Functions

Constraints createPlanarOrientationConstraint (const moveit_pro::base::LinkModel *link, double angle_tolerance)
 Create planar orientation constraints for a set of links.
 
tl::expected< JointRangeConstraint, std::string > buildJointRangeConstraint (const moveit_pro::base::JointModelGroup &group, const std::vector< std::string > &joint_names, const std::vector< double > &lowers, const std::vector< double > &uppers)
 Build a JointRangeConstraint sized to the group's active joints from per-joint bounds.
 
std::vector< ConstraintscreatePlanarOrientationConstraints (const moveit_pro::base::JointModelGroup &joint_model_group, const std::vector< std::string > &constrained_link_names, double angle_tolerance)
 Create planar orientation constraints for a set of links.
 
tl::expected< trajectory_msgs::msg::JointTrajectory, PlanningErrorplanTrajectoryToJointGoal (const moveit_pro::base::JointModelGroup &group, const moveit_pro::base::RobotState &start_state, const moveit_pro::base::RobotState &goal_state, const RRTParams &rrt_params, const std::vector< Constraints > &constraints, const TrajectoryParams &trajectory_params, moveit_pro::base::planning_scene::PlanningScene &planning_scene)
 Plan a trajectory from a start state to a goal state, for the given planning group, in the given planning_scene.
 
tl::expected< trajectory_msgs::msg::JointTrajectory, PlanningErrorplanTrajectoryToJointGoal (const moveit_pro::base::JointModelGroup &group, const Eigen::VectorXd &initial_joint_positions, const Eigen::VectorXd &goal_joint_positions, const RRTParams &rrt_params, const std::vector< Constraints > &constraints, const TrajectoryParams &trajectory_params, moveit_pro::base::planning_scene::PlanningScene &planning_scene)
 Plan a trajectory from initial joint positions to goal joint positions, for the given planning group, in the given planning_scene.
 
tl::expected< rrtconnect::ConfigPath, PlanningErrorplanPathToJointGoal (const moveit_pro::base::JointModelGroup &group, const Eigen::VectorXd &initial_joint_positions, const Eigen::VectorXd &goal_joint_positions, const RRTParams &rrt_params, const std::vector< Constraints > &constraints, moveit_pro::base::planning_scene::PlanningScene &planning_scene)
 Plan a path from initial joint positions to goal joint positions, for the given planning group, in the given planning_scene.
 
std::optional< std::string > checkInputsProRRT (double velocity_scale_factor, double acceleration_scale_factor, int trajectory_sampling_rate, double link_padding, bool keep_orientation, double keep_orientation_tolerance)
 Check if a given set of inputs for ProRRT are valid.
 
bool collisionValidationFunction (const moveit_pro::base::JointModelGroup &group, const Eigen::VectorXd &goal_positions, moveit_pro::base::planning_scene::PlanningScene &planning_scene)
 Validate a joint-space configuration by checking for collisions in the given planning scene.
 
bool collisionValidationFunction (const moveit_pro::base::JointModelGroup &group, const Eigen::VectorXd &goal_positions, moveit_pro::base::planning_scene::PlanningScene &planning_scene, bool pad_environment_collisions, bool pad_self_collisions)
 Overload of collisionValidationFunction that chooses which collision checks apply the link padding set in the planning scene.
 
std::string toJsonString (const ScenarioInput &req)
 
tl::expected< void, std::string > fromJsonString (std::string_view json, ScenarioInput &out)
 
std::string toJsonString (const ScenarioOutput &res)
 
tl::expected< void, std::string > fromJsonString (std::string_view json, ScenarioOutput &out)
 

Detailed Description

JSON serialization for pro_rrt scenario capture/replay. Lives next to the planner so the input/output struct shapes stay synchronized with pro_rrt's public API. The public surface is string-based — nlohmann::json is an implementation detail of the .cpp, never exposed in the header. That isolation lets pro_rrt pick its own JSON library independently of consumers (notably behavior, which transitively pulls a different nlohmann ABI through BT.CPP's bundled contrib/json.hpp).

JSON serialization implementation. nlohmann::json is used here as a local helper and never leaks into the public header — the public API takes/returns std::string instead. Using the system nlohmann_json package (rather than the version vendored inside BT.CPP) keeps pro_rrt independent of behaviortree_cpp.

Typedef Documentation

◆ ContactMap

using pro_rrt::ContactMap = typedef moveit_pro::base::collision_detection::CollisionResult::ContactMap

Function Documentation

◆ buildJointRangeConstraint()

tl::expected< JointRangeConstraint, std::string > pro_rrt::buildJointRangeConstraint ( const moveit_pro::base::JointModelGroup &  group,
const std::vector< std::string > &  joint_names,
const std::vector< double > &  lowers,
const std::vector< double > &  uppers 
)

Build a JointRangeConstraint sized to the group's active joints from per-joint bounds.

Joints not present in joint_names get +/- infinity, so they are no-ops against the URDF limits because the existing cwiseMax/cwiseMin clamps the constraint against the joint model limits.

Parameters
groupThe planning group. The size of the resulting JointRangeConstraint matches group.getActiveVariableCount().
joint_namesThe names of the joints to constrain. Every entry must be an active joint of group. Duplicates are rejected.
lowersThe per-joint lower bounds, parallel to joint_names.
uppersThe per-joint upper bounds, parallel to joint_names.
Returns
The constraint, or an error string if any precondition is violated (mismatched sizes, unknown joint name, duplicate joint name, or lower > upper).

◆ checkInputsProRRT()

std::optional< std::string > pro_rrt::checkInputsProRRT ( double  velocity_scale_factor,
double  acceleration_scale_factor,
int  trajectory_sampling_rate,
double  link_padding,
bool  keep_orientation,
double  keep_orientation_tolerance 
)

Check if a given set of inputs for ProRRT are valid.

Parameters
velocity_scale_factorHow much to scale the velocity of the trajectory, relative to the maximum robot velocity defined in configs.
acceleration_scale_factorHow much to scale the acceleration of the trajectory, relative to the maximum robot acceleration defined in configs.
trajectory_sampling_rateThe sampling rate of the output trajectory in Hz.
link_paddingThe padding to be used for collision checking, in meters.
keep_orientationWhether to keep the orientation of the robot's end effector fixed during planning.
keep_orientation_toleranceThe angle tolerance to use for the orientation constraint.
Returns
an optional string in case of invalid inputs, or nullptr otherwise.

◆ collisionValidationFunction() [1/2]

bool pro_rrt::collisionValidationFunction ( const moveit_pro::base::JointModelGroup &  group,
const Eigen::VectorXd &  goal_positions,
moveit_pro::base::planning_scene::PlanningScene &  planning_scene 
)

Validate a joint-space configuration by checking for collisions in the given planning scene.

This function sets the joint positions of the robot model in the input planning scene to the input goal_positions and performs a collision check. The collision check is performed against the robot's self-collision and the environment. The link padding set in the planning scene is taken into account in both collision checks, and the world object padding in the environment check.

Parameters
groupJoint model group associated with goal_positions.
goal_positionsJoint-space configuration to validate. Must hold one value per active variable of groupsize() == group.getActiveVariableCount() — since a longer vector would otherwise be silently truncated and the check would answer for a different configuration than the caller asked about.
planning_scenePlanning scene to perform the collision check against.
Returns
True if the input goal_positions are collision-free in the input planning_scene, false otherwise.

◆ collisionValidationFunction() [2/2]

bool pro_rrt::collisionValidationFunction ( const moveit_pro::base::JointModelGroup &  group,
const Eigen::VectorXd &  goal_positions,
moveit_pro::base::planning_scene::PlanningScene &  planning_scene,
bool  pad_environment_collisions,
bool  pad_self_collisions 
)

Overload of collisionValidationFunction that chooses which collision checks apply the link padding set in the planning scene.

Parameters
pad_environment_collisionsWhether the link padding applies to collision checks between robot links and the environment.
pad_self_collisionsWhether the link padding applies to self-collision checks (robot links against each other, against other robot bodies, and against attached objects).
Returns
True if the input goal_positions are collision-free in the input planning_scene, false otherwise.

◆ createPlanarOrientationConstraint()

Constraints pro_rrt::createPlanarOrientationConstraint ( const moveit_pro::base::LinkModel *  link,
double  angle_tolerance 
)

Create planar orientation constraints for a set of links.

Parameters
linkThe link to constrain.
angle_toleranceThe angle tolerance to use for the orientation constraint.
Returns
The planar orientation constraint.

◆ createPlanarOrientationConstraints()

std::vector< Constraints > pro_rrt::createPlanarOrientationConstraints ( const moveit_pro::base::JointModelGroup &  joint_model_group,
const std::vector< std::string > &  constrained_link_names,
double  angle_tolerance 
)

Create planar orientation constraints for a set of links.

Parameters
joint_model_groupThe joint model group to define constraints for.
constrained_link_namesThe names of the links to constrain.
angle_toleranceThe angle tolerance to use for the orientation constraint.
Returns
The planar orientation constraints.

◆ fromJsonString() [1/2]

tl::expected< void, std::string > pro_rrt::fromJsonString ( std::string_view  json,
ScenarioInput out 
)

◆ fromJsonString() [2/2]

tl::expected< void, std::string > pro_rrt::fromJsonString ( std::string_view  json,
ScenarioOutput out 
)

◆ planPathToJointGoal()

tl::expected< rrtconnect::ConfigPath, PlanningError > pro_rrt::planPathToJointGoal ( const moveit_pro::base::JointModelGroup &  group,
const Eigen::VectorXd &  initial_joint_positions,
const Eigen::VectorXd &  goal_joint_positions,
const RRTParams rrt_params,
const std::vector< Constraints > &  constraints,
moveit_pro::base::planning_scene::PlanningScene &  planning_scene 
)

Plan a path from initial joint positions to goal joint positions, for the given planning group, in the given planning_scene.

Parameters
groupJoint model group to plan motion for.
initial_joint_positionsThe initial joint positions of group.
goal_joint_positionsThe desired goal joint positions for group.
rrt_paramsConfiguration parameters for the RRT planner.
constraintsThe kinematic constraints to take into account during planning.
planning_sceneThe planning scene to plan in, i.e. the obstacles around the robot.
Returns
the planned path as a rrtconnect::ConfigPath if one is found, or a PlanningError if the planning fails.

◆ planTrajectoryToJointGoal() [1/2]

tl::expected< trajectory_msgs::msg::JointTrajectory, PlanningError > pro_rrt::planTrajectoryToJointGoal ( const moveit_pro::base::JointModelGroup &  group,
const Eigen::VectorXd &  initial_joint_positions,
const Eigen::VectorXd &  goal_joint_positions,
const RRTParams rrt_params,
const std::vector< Constraints > &  constraints,
const TrajectoryParams trajectory_params,
moveit_pro::base::planning_scene::PlanningScene &  planning_scene 
)

Plan a trajectory from initial joint positions to goal joint positions, for the given planning group, in the given planning_scene.

Parameters
groupJoint model group to plan motion for.
initial_joint_positionsThe initial joint positions of group.
goal_joint_positionsThe desired goal joint positions for group.
rrt_paramsConfiguration parameters for the RRT planner.
constraintsThe kinematic constraints to take into account during planning.
trajectory_paramsParameters for the trajectory generation.
planning_sceneThe planning scene to plan in, i.e. the obstacles around the robot.
Returns
the planned trajectory as a trajectory_msgs::msg::JointTrajectory if one is found, or a PlanningError if the planning fails.

◆ planTrajectoryToJointGoal() [2/2]

tl::expected< trajectory_msgs::msg::JointTrajectory, PlanningError > pro_rrt::planTrajectoryToJointGoal ( const moveit_pro::base::JointModelGroup &  group,
const moveit_pro::base::RobotState &  start_state,
const moveit_pro::base::RobotState &  goal_state,
const RRTParams rrt_params,
const std::vector< Constraints > &  constraints,
const TrajectoryParams trajectory_params,
moveit_pro::base::planning_scene::PlanningScene &  planning_scene 
)

Plan a trajectory from a start state to a goal state, for the given planning group, in the given planning_scene.

Parameters
groupJoint model group to plan motion for.
start_stateThe start state of the robot.
goal_stateThe goal state of the robot.
rrt_paramsConfiguration parameters for the RRT planner.
constraintsThe kinematic constraints to take into account during planning.
trajectory_paramsParameters for the trajectory generation.
planning_sceneThe planning scene to plan in, i.e. the obstacles around the robot.
Returns
the planned trajectory as a trajectory_msgs::msg::JointTrajectory if one is found, or a PlanningError if the planning fails.

◆ toJsonString() [1/2]

std::string pro_rrt::toJsonString ( const ScenarioInput req)

◆ toJsonString() [2/2]

std::string pro_rrt::toJsonString ( const ScenarioOutput res)