Public Member Functions | Protected Member Functions | Protected Attributes
stomp_moveit::cost_functions::CollisionCheck Class Reference

Assigns a cost value to each robot state by evaluating if the robot is in collision. More...

#include <collision_check.h>

Inheritance diagram for stomp_moveit::cost_functions::CollisionCheck:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CollisionCheck ()
virtual bool computeCosts (const Eigen::MatrixXd &parameters, std::size_t start_timestep, std::size_t num_timesteps, int iteration_number, int rollout_number, Eigen::VectorXd &costs, bool &validity) override
 computes the state costs by checking whether the robot is in collision at each time step.
virtual bool configure (const XmlRpc::XmlRpcValue &config) override
 Sets internal members of the plugin from the configuration data.
virtual void done (bool success, int total_iterations, double final_cost, const Eigen::MatrixXd &parameters) override
 Called by the Stomp Task at the end of the optimization process.
virtual std::string getGroupName () const override
virtual std::string getName () const override
virtual bool initialize (moveit::core::RobotModelConstPtr robot_model_ptr, const std::string &group_name, XmlRpc::XmlRpcValue &config) override
 Initializes and configures the Cost Function. Calls the configure method and passes the 'config' value.
virtual bool setMotionPlanRequest (const planning_scene::PlanningSceneConstPtr &planning_scene, const moveit_msgs::MotionPlanRequest &req, const stomp_core::StompConfiguration &config, moveit_msgs::MoveItErrorCodes &error_code) override
 Stores the planning details which will be used during the costs calculations.
virtual ~CollisionCheck ()

Protected Member Functions

bool checkIntermediateCollisions (const Eigen::VectorXd &start, const Eigen::VectorXd &end, double longest_valid_joint_move)
 Checks for collision between consecutive points by dividing the joint move into sub-moves where the maximum joint motion can not exceed the longest_valid_joint_move value.

Protected Attributes

double collision_penalty_
 The value assigned to a collision state.
collision_detection::CollisionRequest collision_request_
collision_detection::CollisionRobotConstPtr collision_robot_
collision_detection::CollisionWorldConstPtr collision_world_
std::string group_name_
std::array
< moveit::core::RobotStatePtr, 3 > 
intermediate_coll_states_
 Used in checking collisions between to consecutive poses.
Eigen::ArrayXd intermediate_costs_slots_
double kernel_window_percentage_
 The value assigned to a collision state.
double longest_valid_joint_move_
 how far can a joint move in between consecutive trajectory points
std::string name_
moveit_msgs::MotionPlanRequest plan_request_
planning_scene::PlanningSceneConstPtr planning_scene_
Eigen::VectorXd raw_costs_
moveit::core::RobotModelConstPtr robot_model_ptr_
moveit::core::RobotStatePtr robot_state_

Detailed Description

Assigns a cost value to each robot state by evaluating if the robot is in collision.

Examples:
All examples are located here stomp_core examples

Definition at line 45 of file collision_check.h.


Constructor & Destructor Documentation

Definition at line 126 of file collision_check.cpp.

Definition at line 135 of file collision_check.cpp.


Member Function Documentation

bool stomp_moveit::cost_functions::CollisionCheck::checkIntermediateCollisions ( const Eigen::VectorXd &  start,
const Eigen::VectorXd &  end,
double  longest_valid_joint_move 
) [protected]

Checks for collision between consecutive points by dividing the joint move into sub-moves where the maximum joint motion can not exceed the longest_valid_joint_move value.

Parameters:
startThe start joint pose
endThe end joint pose
longest_valid_joint_moveThe maximum distance that the joints are allowed to move before checking for collisions.
Returns:
True if the interval is collision free, false otherwise.

Definition at line 315 of file collision_check.cpp.

bool stomp_moveit::cost_functions::CollisionCheck::computeCosts ( const Eigen::MatrixXd &  parameters,
std::size_t  start_timestep,
std::size_t  num_timesteps,
int  iteration_number,
int  rollout_number,
Eigen::VectorXd &  costs,
bool &  validity 
) [override, virtual]

computes the state costs by checking whether the robot is in collision at each time step.

Parameters:
parametersThe parameter values to evaluate for state costs [num_dimensions x num_parameters]
start_timestepstart index into the 'parameters' array, usually 0.
num_timestepsnumber of elements to use from 'parameters' starting from 'start_timestep' *
iteration_numberThe current iteration count in the optimization loop
rollout_numberindex of the noisy trajectory whose cost is being evaluated. *
costsvector containing the state costs per timestep. Sets '0' to all collision-free states.
validitywhether or not the trajectory is valid.
Returns:
false if there was an irrecoverable failure, true otherwise.

Implements stomp_moveit::cost_functions::StompCostFunction.

Definition at line 192 of file collision_check.cpp.

Sets internal members of the plugin from the configuration data.

Parameters:
configThe configuration data. Usually loaded from the ros parameter server
Returns:
true if succeeded, false otherwise.

Implements stomp_moveit::cost_functions::StompCostFunction.

Definition at line 361 of file collision_check.cpp.

void stomp_moveit::cost_functions::CollisionCheck::done ( bool  success,
int  total_iterations,
double  final_cost,
const Eigen::MatrixXd &  parameters 
) [override, virtual]

Called by the Stomp Task at the end of the optimization process.

Parameters:
successWhether the optimization succeeded
total_iterationsNumber of iterations used
final_costThe cost value after optimizing.
parametersThe parameters generated at the end of current iteration [num_dimensions x num_timesteps]

Reimplemented from stomp_moveit::cost_functions::StompCostFunction.

Definition at line 403 of file collision_check.cpp.

virtual std::string stomp_moveit::cost_functions::CollisionCheck::getGroupName ( ) const [inline, override, virtual]

Reimplemented from stomp_moveit::cost_functions::StompCostFunction.

Definition at line 101 of file collision_check.h.

virtual std::string stomp_moveit::cost_functions::CollisionCheck::getName ( ) const [inline, override, virtual]

Reimplemented from stomp_moveit::cost_functions::StompCostFunction.

Definition at line 107 of file collision_check.h.

bool stomp_moveit::cost_functions::CollisionCheck::initialize ( moveit::core::RobotModelConstPtr  robot_model_ptr,
const std::string &  group_name,
XmlRpc::XmlRpcValue config 
) [override, virtual]

Initializes and configures the Cost Function. Calls the configure method and passes the 'config' value.

Parameters:
robot_model_ptrA pointer to the robot model.
group_nameThe designated planning group.
configThe configuration data. Usually loaded from the ros parameter server
Returns:
true if succeeded, false otherwise.

Implements stomp_moveit::cost_functions::StompCostFunction.

Definition at line 140 of file collision_check.cpp.

bool stomp_moveit::cost_functions::CollisionCheck::setMotionPlanRequest ( const planning_scene::PlanningSceneConstPtr &  planning_scene,
const moveit_msgs::MotionPlanRequest req,
const stomp_core::StompConfiguration &  config,
moveit_msgs::MoveItErrorCodes &  error_code 
) [override, virtual]

Stores the planning details which will be used during the costs calculations.

Parameters:
planning_sceneA smart pointer to the planning scene
reqThe motion planning request
configThe Stomp configuration.
error_codeMoveit error code.
Returns:
true if succeeded, false otherwise.

Implements stomp_moveit::cost_functions::StompCostFunction.

Definition at line 148 of file collision_check.cpp.


Member Data Documentation

The value assigned to a collision state.

Definition at line 138 of file collision_check.h.

Definition at line 147 of file collision_check.h.

collision_detection::CollisionRobotConstPtr stomp_moveit::cost_functions::CollisionCheck::collision_robot_ [protected]

Definition at line 148 of file collision_check.h.

collision_detection::CollisionWorldConstPtr stomp_moveit::cost_functions::CollisionCheck::collision_world_ [protected]

Definition at line 149 of file collision_check.h.

Definition at line 129 of file collision_check.h.

std::array<moveit::core::RobotStatePtr,3 > stomp_moveit::cost_functions::CollisionCheck::intermediate_coll_states_ [protected]

Used in checking collisions between to consecutive poses.

Definition at line 152 of file collision_check.h.

Definition at line 144 of file collision_check.h.

The value assigned to a collision state.

Definition at line 139 of file collision_check.h.

how far can a joint move in between consecutive trajectory points

Definition at line 140 of file collision_check.h.

Definition at line 126 of file collision_check.h.

Definition at line 135 of file collision_check.h.

planning_scene::PlanningSceneConstPtr stomp_moveit::cost_functions::CollisionCheck::planning_scene_ [protected]

Definition at line 134 of file collision_check.h.

Definition at line 143 of file collision_check.h.

moveit::core::RobotModelConstPtr stomp_moveit::cost_functions::CollisionCheck::robot_model_ptr_ [protected]

Definition at line 130 of file collision_check.h.

moveit::core::RobotStatePtr stomp_moveit::cost_functions::CollisionCheck::robot_state_ [protected]

Definition at line 131 of file collision_check.h.


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


stomp_moveit
Author(s): Jorge Nicho
autogenerated on Sat Jun 8 2019 19:24:01