Skip to main content

pro_rrt Namespace

Definition​

namespace pro_rrt { ... }

Namespaces Index​

namespaceinternal
namespacescenario_runner

Classes Index​

structConstraints

Definition of kinematic constraints to take into account during planning. More...

structJointRangeConstraint
structJointRangeEntry

One row of the joint_range_constraint BT input port (per-joint tightening of URDF limits). More...

structPlanarRotationConstraint
structPlanningError

Definition of planning error return type with a string and optional collision results. More...

classPlanningTestFixture
structRRTParams

Configuration parameters for the RRT planner. More...

structScenarioInput
structScenarioOutput

Outcome of a single planTrajectoryToJointGoal(...) call as captured for scenario logging. More...

structTrajectoryParams

Parameters for the trajectory generation. More...

structTrajectorySummary

Summary statistics of the planned trajectory — present iff planning succeeded. More...

Typedefs Index​

usingConfigurationValidator = std::function< bool(const Eigen::VectorXd &)>

Caller-supplied validation of one joint-space configuration, &&-ed after the planner's built-in constraint and collision checks by the overloads below that accept it. More...

usingContactMap = moveit_pro::base::collision_detection::CollisionResult::ContactMap

Functions Index​

ConstraintscreatePlanarOrientationConstraint (const moveit_pro::base::LinkModel *link, double angle_tolerance)

Create planar orientation constraints for a set of links. More...

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. More...

std::vector< Constraints >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. More...

tl::expected< trajectory_msgs::msg::JointTrajectory, PlanningError >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. More...

tl::expected< trajectory_msgs::msg::JointTrajectory, PlanningError >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, const ConfigurationValidator &extra_validator)

Overload of planTrajectoryToJointGoal whose planned path additionally avoids every configuration extra_validator rejects. See ConfigurationValidator for the contract. More...

tl::expected< trajectory_msgs::msg::JointTrajectory, PlanningError >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. More...

tl::expected< trajectory_msgs::msg::JointTrajectory, PlanningError >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, const ConfigurationValidator &extra_validator)

Overload of planTrajectoryToJointGoal whose planned path additionally avoids every configuration extra_validator rejects. See ConfigurationValidator for the contract and the RobotState overload above for how far the blended trajectory may depart from the validated path. More...

tl::expected< rrtconnect::ConfigPath, PlanningError >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. More...

tl::expected< rrtconnect::ConfigPath, PlanningError >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, const ConfigurationValidator &extra_validator)

Overload of planPathToJointGoal that additionally rejects every configuration extra_validator rejects. More...

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. More...

boolcollisionValidationFunction (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. More...

boolcollisionValidationFunction (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. More...

std::stringtoJsonString (const ScenarioInput &req)
tl::expected< void, std::string >fromJsonString (std::string_view json, ScenarioInput &out)
std::stringtoJsonString (const ScenarioOutput &res)
tl::expected< void, std::string >fromJsonString (std::string_view json, ScenarioOutput &out)

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.

Typedefs​

ConfigurationValidator​

using pro_rrt::ConfigurationValidator = typedef std::function<bool(const Eigen::VectorXd&)>

Caller-supplied validation of one joint-space configuration, &&-ed after the planner's built-in constraint and collision checks by the overloads below that accept it.

Receives one value per active variable of the planning group, in the group's active-variable order. Return true to accept the configuration. An empty function disables the extra validation.

Sampling: the predicate is evaluated at configurations, not swept along segments. Two accepted samples one configuration_space_step apart do not by themselves prove the straight segment between them is accepted, so either make the accepted set convex (a coupled linear bound such as |q4 + q6| <= c is, and then no segment can cross it between accepted samples) or build a margin of at least the chord sag at that step into the bound.

Continuous joints: their values are in the same frame as the initial joint positions the caller passed, not folded to [-pi, pi], so an accumulated-rotation bound reads the accumulated value. An independent continuous joint with no explicit position bounds (moveit_pro::base::canShiftByWholeTurns) is searched within initial +/- pi and its goal is moved to the nearest equivalent winding before the predicate judges it, so such a joint cannot wind or unwind more than half a turn in one plan. A continuous joint that drives a mimic keeps its goal winding as given.

joint_costs bias the search metric; this predicate rejects. Both can be used together, and a cost never softens a rejection.

Invocation: called synchronously on the planning thread, only for configurations the built-in checks already accept, on every sampled configuration and on every subdivision sample of every proposed transition. Keep it cheap and deterministic, and do not read or modify the planning scene from it: the scene's current state is the planner's scratch space while a plan runs. It must not throw: signal a rejected configuration by returning false, since an exception propagates out of the planner as an internal error. A start or goal it rejects is reported as such in the returned PlanningError, and a search that finds no path says the function was active. It applies wherever the planner validates a configuration (tree extension, refinement, shortcutting) and not to the timed trajectory; see the trajectory overloads. Scenario capture cannot record the function, so a captured scenario replays without it.

Definition at line 295 of file pro_rrt.hpp.

ContactMap​

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

Definition at line 46 of file pro_rrt.cpp.

Functions​

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
group

The planning group. The size of the resulting JointRangeConstraint matches group.getActiveVariableCount().

joint_names

The names of the joints to constrain. Every entry must be an active joint of group. Duplicates are rejected.

lowers

The per-joint lower bounds, parallel to joint_names.

uppers

The 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).

Definition at line 730 of file pro_rrt.cpp.

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_factor

How much to scale the velocity of the trajectory, relative to the maximum robot velocity defined in configs.

acceleration_scale_factor

How much to scale the acceleration of the trajectory, relative to the maximum robot acceleration defined in configs.

trajectory_sampling_rate

The sampling rate of the output trajectory in Hz.

link_padding

The padding to be used for collision checking, in meters.

keep_orientation

Whether to keep the orientation of the robot's end effector fixed during planning.

keep_orientation_tolerance

The angle tolerance to use for the orientation constraint.

Returns

an optional string in case of invalid inputs, or nullptr otherwise.

Definition at line 1430 of file pro_rrt.cpp.

collisionValidationFunction()​

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. A non-finite configuration returns false without changing the planning scene or calling the collision checker.

Parameters
group

Joint model group associated with goal_positions.

goal_positions

Joint-space configuration to validate. Must hold one value per active variable of group — size() == 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_scene

Planning scene to perform the collision check against.

Returns

True if the input goal_positions are finite and collision-free in the input planning_scene, false otherwise.

Definition at line 1460 of file pro_rrt.cpp.

collisionValidationFunction()​

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_collisions

Whether the link padding applies to collision checks between robot links and the environment.

pad_self_collisions

Whether 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 finite and collision-free in the input planning_scene, false otherwise.

Definition at line 1467 of file pro_rrt.cpp.

createPlanarOrientationConstraint()​

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

Create planar orientation constraints for a set of links.

Parameters
link

The link to constrain.

angle_tolerance

The angle tolerance to use for the orientation constraint.

Returns

The planar orientation constraint.

Definition at line 705 of file pro_rrt.cpp.

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_group

The joint model group to define constraints for.

constrained_link_names

The names of the links to constrain.

angle_tolerance

The angle tolerance to use for the orientation constraint.

Returns

The planar orientation constraints.

Definition at line 716 of file pro_rrt.cpp.

fromJsonString()​

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

Definition at line 353 of file scenario_interface.cpp.

fromJsonString()​

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

Definition at line 358 of file scenario_interface.cpp.

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
group

Joint model group to plan motion for.

initial_joint_positions

The initial joint positions of group. Non-finite values return a PlanningError.

goal_joint_positions

The desired goal joint positions for group. Non-finite values return a PlanningError.

rrt_params

Configuration parameters for the RRT planner.

constraints

The kinematic constraints to take into account during planning.

planning_scene

The 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.

Definition at line 1234 of file pro_rrt.cpp.

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, const ConfigurationValidator & extra_validator)

Overload of planPathToJointGoal that additionally rejects every configuration extra_validator rejects.

The predicate is &&-ed after the built-in constraint and collision validation, so the returned path is validated against it at the same resolution as against collisions: on every tree extension, on the optional RRT* refinement, and on every shortcut candidate. See ConfigurationValidator for the contract.

Definition at line 1244 of file pro_rrt.cpp.

planTrajectoryToJointGoal()​

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
group

Joint model group to plan motion for.

start_state

The start state of the robot. Non-finite active joint positions return a PlanningError.

goal_state

The goal state of the robot. Non-finite active joint positions return a PlanningError.

rrt_params

Configuration parameters for the RRT planner.

constraints

The kinematic constraints to take into account during planning.

trajectory_params

Parameters for the trajectory generation.

planning_scene

The 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.

Definition at line 788 of file pro_rrt.cpp.

planTrajectoryToJointGoal()​

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, const ConfigurationValidator & extra_validator)

Overload of planTrajectoryToJointGoal whose planned path additionally avoids every configuration extra_validator rejects. See ConfigurationValidator for the contract.

The predicate is enforced on the planned path at the planner's sample resolution and is not re-applied to the timed trajectory: blending by up to trajectory_params.max_deviation can move a trajectory sample slightly into a region the predicate rejects. Reduce max_deviation or build that margin into the predicate when it matters. The optional sanity collision check re-validates the trajectory for collisions only.

Definition at line 798 of file pro_rrt.cpp.

planTrajectoryToJointGoal()​

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
group

Joint model group to plan motion for.

initial_joint_positions

The initial joint positions of group. Non-finite values return a PlanningError.

goal_joint_positions

The desired goal joint positions for group. Non-finite values return a PlanningError.

rrt_params

Configuration parameters for the RRT planner.

constraints

The kinematic constraints to take into account during planning.

trajectory_params

Parameters for the trajectory generation.

planning_scene

The 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.

Definition at line 829 of file pro_rrt.cpp.

planTrajectoryToJointGoal()​

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, const ConfigurationValidator & extra_validator)

Overload of planTrajectoryToJointGoal whose planned path additionally avoids every configuration extra_validator rejects. See ConfigurationValidator for the contract and the RobotState overload above for how far the blended trajectory may depart from the validated path.

Definition at line 839 of file pro_rrt.cpp.

toJsonString()​

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

Definition at line 325 of file scenario_interface.cpp.

toJsonString()​

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

Definition at line 330 of file scenario_interface.cpp.


The documentation for this namespace was generated from the following files:


Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.