#include <sbpl_arm_planner_node.h>
Public Member Functions | |
bool | init () |
Initialize the planner node. | |
bool | planKinematicPath (motion_planning_msgs::GetMotionPlan::Request &req, motion_planning_msgs::GetMotionPlan::Response &res) |
Planning service call back function. | |
int | run () |
Run the node! | |
SBPLArmPlannerNode () | |
Constructor-doesn't initialize class, you need to run init(). | |
~SBPLArmPlannerNode () | |
Private Member Functions | |
void | attachedObjectCallback (const mapping_msgs::AttachedCollisionObjectConstPtr &attached_object) |
void | attachObject (const mapping_msgs::CollisionObject &obj) |
void | collisionMapCallback (const mapping_msgs::CollisionMapConstPtr &collision_map) |
Callback function that gets called when a new collision map is available. It updates the internal distance field with the map and visualizes it (if desired). | |
void | collisionObjectCallback (const mapping_msgs::CollisionObjectConstPtr &collision_object) |
bool | computeFK (const std::vector< double > &jnt_pos, geometry_msgs::Pose &pose) |
Compute FK using pr2_fk service. | |
void | computeFKwithKDL (const std::vector< double > &jnt_pos, geometry_msgs::Pose &pose, int joint_num) |
Compute FK using the KDL library. | |
bool | computeIK (const geometry_msgs::Pose &pose_stamped_msg, std::vector< double > jnt_pos, std::vector< double > &solution) |
Compute IK using pr2_ik service. | |
void | displayARAStarStates () |
Display states expanded by ARA* search. | |
void | displayShortestPath () |
Computes and visualizes the 3D path to goal returned by heuristic. | |
bool | initChain (std::string robot_description) |
Initialize KDL Chain for using FK. | |
bool | initializePlannerAndEnvironment () |
Initialize the SBPL planner and the sbpl_arm_planner environment. | |
bool | isGoalConstraintSatisfied (const std::vector< double > &angles, const motion_planning_msgs::Constraints &goal) |
Check if path satisfies goal constraints. | |
bool | plan (std::vector< trajectory_msgs::JointTrajectoryPoint > &arm_path) |
Retrieve plan from sbpl. | |
bool | planToPosition (motion_planning_msgs::GetMotionPlan::Request &req, motion_planning_msgs::GetMotionPlan::Response &res) |
Plan a path to a cartesian goal(s). | |
void | printPath (const std::vector< trajectory_msgs::JointTrajectoryPoint > &arm_path) |
Print out the trajectory along with the end effector coords of each waypoint. | |
void | printPath (FILE *fOut, const std::vector< std::vector< double > > path) |
Print the trajectory to a file. | |
void | setArmToMapTransform (std::string &map_frame) |
Set the transform in the environment class (remove this). | |
bool | setGoalPosition (const motion_planning_msgs::Constraints &goals) |
Set cartesian goal(s). | |
bool | setStart (const sensor_msgs::JointState &start_state) |
Set start configuration. | |
void | updateMapFromCollisionMap (const mapping_msgs::CollisionMapConstPtr &collision_map) |
Callback function that's called by the collision map topic. It reformats the collision map for the sbpl grid. | |
void | visualizeAttachedObject (const std::vector< double > &angles) |
void | visualizeAttachedObject (trajectory_msgs::JointTrajectory &traj_msg, int throttle) |
void | visualizeCollisionObjects () |
Visualize voxels occupying known collision objects. | |
void | visualizeElbowPoses () |
void | visualizeGoalPosition (const motion_planning_msgs::Constraints &goal) |
Publish a visualization marker to display the goal end effector position in rviz. | |
Private Attributes | |
double | allocated_time_ |
Maximum time for planner to return a solution. | |
KDL::Chain | arm_chain_ |
std::string | arm_description_filename_ |
std::string | arm_name_ |
bool | attached_object_ |
std::string | attached_object_frame_ |
VisualizeArm * | aviz_ |
std::vector< std::vector < double > > | col_objects_ |
tf::MessageFilter < mapping_msgs::CollisionMap > * | collision_map_filter_ |
message_filters::Subscriber < mapping_msgs::CollisionMap > | collision_map_subscriber_ |
std::string | collision_map_topic_ |
ros::Subscriber | collision_object_subscriber_ |
boost::mutex | colmap_mutex_ |
SBPLCollisionSpace * | cspace_ |
std::vector< std::vector < double > > | dpath_ |
double | env_resolution_ |
std::string | fk_service_name_ |
The name of the forward kinematics service. | |
bool | forward_search_ |
OccupancyGrid * | grid_ |
std::string | ik_service_name_ |
The name of the inverse kinematics service. | |
KDL::JntArray | jnt_pos_ |
KDL::ChainFkSolverPos_recursive * | jnt_to_pose_solver_ |
A FK solver. (The FK service is currently being used). | |
std::vector< std::string > | joint_names_ |
KDL::Frame | kdl_transform_ |
std::string | map_frame_ |
MDPConfig | mdp_cfg_ |
std::string | mprims_filename_ |
ros::NodeHandle | node_handle_ |
std::string | node_name_ |
int | num_joints_ |
std::map< std::string, mapping_msgs::CollisionObject > | object_map_ |
boost::mutex | object_mutex_ |
ros::Subscriber | object_subscriber_ |
SBPLPlanner * | planner_ |
bool | planner_initialized_ |
std::string | planning_joint_ |
ros::ServiceServer | planning_service_ |
bool | print_path_ |
std::string | reference_frame_ |
std::string | robot_description_ |
ros::NodeHandle | root_handle_ |
EnvironmentROBARM3D | sbpl_arm_env_ |
bool | search_mode_ |
std::string | side_ |
"r" - right arm, "l" - left arm | |
tf::TransformListener | tf_ |
int | throttle_ |
std::string | trajectory_type_ |
tf::StampedTransform | transform_ |
bool | use_first_solution_ |
bool | use_research_heuristic_ |
bool | visualize_collision_model_trajectory_ |
bool | visualize_expanded_states_ |
bool | visualize_goal_ |
bool | visualize_heuristic_ |
bool | visualize_trajectory_ |
double | waypoint_time_ |
Time interval sent with each waypoint in trajectory to movearm. |
Definition at line 47 of file sbpl_arm_planner_node.h.
SBPLArmPlannerNode::SBPLArmPlannerNode | ( | ) |
Constructor-doesn't initialize class, you need to run init().
Initializers -------------------------------------------------------------
Definition at line 41 of file sbpl_arm_planner_node.cpp.
SBPLArmPlannerNode::~SBPLArmPlannerNode | ( | ) |
Definition at line 52 of file sbpl_arm_planner_node.cpp.
void SBPLArmPlannerNode::attachedObjectCallback | ( | const mapping_msgs::AttachedCollisionObjectConstPtr & | attached_object | ) | [private] |
Definition at line 246 of file sbpl_arm_planner_node.cpp.
void SBPLArmPlannerNode::attachObject | ( | const mapping_msgs::CollisionObject & | obj | ) | [private] |
Definition at line 328 of file sbpl_arm_planner_node.cpp.
void SBPLArmPlannerNode::collisionMapCallback | ( | const mapping_msgs::CollisionMapConstPtr & | collision_map | ) | [private] |
Callback function that gets called when a new collision map is available. It updates the internal distance field with the map and visualizes it (if desired).
Callbacks ----------------------------------------------------------------
Definition at line 202 of file sbpl_arm_planner_node.cpp.
void SBPLArmPlannerNode::collisionObjectCallback | ( | const mapping_msgs::CollisionObjectConstPtr & | collision_object | ) | [private] |
Definition at line 305 of file sbpl_arm_planner_node.cpp.
bool SBPLArmPlannerNode::computeFK | ( | const std::vector< double > & | jnt_pos, | |
geometry_msgs::Pose & | pose | |||
) | [private] |
Compute FK using pr2_fk service.
Definition at line 860 of file sbpl_arm_planner_node.cpp.
void SBPLArmPlannerNode::computeFKwithKDL | ( | const std::vector< double > & | jnt_pos, | |
geometry_msgs::Pose & | pose, | |||
int | joint_num | |||
) | [private] |
Compute FK using the KDL library.
Definition at line 897 of file sbpl_arm_planner_node.cpp.
bool SBPLArmPlannerNode::computeIK | ( | const geometry_msgs::Pose & | pose_stamped_msg, | |
std::vector< double > | jnt_pos, | |||
std::vector< double > & | solution | |||
) | [private] |
Compute IK using pr2_ik service.
Definition at line 811 of file sbpl_arm_planner_node.cpp.
void SBPLArmPlannerNode::displayARAStarStates | ( | ) | [private] |
Display states expanded by ARA* search.
Definition at line 966 of file sbpl_arm_planner_node.cpp.
void SBPLArmPlannerNode::displayShortestPath | ( | ) | [private] |
Computes and visualizes the 3D path to goal returned by heuristic.
Definition at line 1077 of file sbpl_arm_planner_node.cpp.
bool SBPLArmPlannerNode::init | ( | ) |
Initialize the planner node.
Definition at line 64 of file sbpl_arm_planner_node.cpp.
bool SBPLArmPlannerNode::initChain | ( | std::string | robot_description | ) | [private] |
Initialize KDL Chain for using FK.
Definition at line 918 of file sbpl_arm_planner_node.cpp.
bool SBPLArmPlannerNode::initializePlannerAndEnvironment | ( | ) | [private] |
Initialize the SBPL planner and the sbpl_arm_planner environment.
Definition at line 150 of file sbpl_arm_planner_node.cpp.
bool SBPLArmPlannerNode::isGoalConstraintSatisfied | ( | const std::vector< double > & | angles, | |
const motion_planning_msgs::Constraints & | goal | |||
) | [private] |
Check if path satisfies goal constraints.
Definition at line 725 of file sbpl_arm_planner_node.cpp.
bool SBPLArmPlannerNode::plan | ( | std::vector< trajectory_msgs::JointTrajectoryPoint > & | arm_path | ) | [private] |
Retrieve plan from sbpl.
Definition at line 671 of file sbpl_arm_planner_node.cpp.
bool SBPLArmPlannerNode::planKinematicPath | ( | motion_planning_msgs::GetMotionPlan::Request & | req, | |
motion_planning_msgs::GetMotionPlan::Response & | res | |||
) |
Planning service call back function.
Definition at line 651 of file sbpl_arm_planner_node.cpp.
bool SBPLArmPlannerNode::planToPosition | ( | motion_planning_msgs::GetMotionPlan::Request & | req, | |
motion_planning_msgs::GetMotionPlan::Response & | res | |||
) | [private] |
Plan a path to a cartesian goal(s).
Definition at line 480 of file sbpl_arm_planner_node.cpp.
void SBPLArmPlannerNode::printPath | ( | const std::vector< trajectory_msgs::JointTrajectoryPoint > & | arm_path | ) | [private] |
Print out the trajectory along with the end effector coords of each waypoint.
a | vector of points |
Definition at line 1093 of file sbpl_arm_planner_node.cpp.
void SBPLArmPlannerNode::printPath | ( | FILE * | fOut, | |
const std::vector< std::vector< double > > | path | |||
) | [private] |
Print the trajectory to a file.
Definition at line 1114 of file sbpl_arm_planner_node.cpp.
int SBPLArmPlannerNode::run | ( | ) |
Run the node!
Definition at line 144 of file sbpl_arm_planner_node.cpp.
void SBPLArmPlannerNode::setArmToMapTransform | ( | std::string & | map_frame | ) | [private] |
Set the transform in the environment class (remove this).
Definition at line 941 of file sbpl_arm_planner_node.cpp.
bool SBPLArmPlannerNode::setGoalPosition | ( | const motion_planning_msgs::Constraints & | goals | ) | [private] |
Set cartesian goal(s).
Definition at line 405 of file sbpl_arm_planner_node.cpp.
bool SBPLArmPlannerNode::setStart | ( | const sensor_msgs::JointState & | start_state | ) | [private] |
Set start configuration.
Planner Interface -------------------------------------------------------
Definition at line 376 of file sbpl_arm_planner_node.cpp.
void SBPLArmPlannerNode::updateMapFromCollisionMap | ( | const mapping_msgs::CollisionMapConstPtr & | collision_map | ) | [private] |
Callback function that's called by the collision map topic. It reformats the collision map for the sbpl grid.
Definition at line 207 of file sbpl_arm_planner_node.cpp.
void SBPLArmPlannerNode::visualizeAttachedObject | ( | const std::vector< double > & | angles | ) | [private] |
Definition at line 1061 of file sbpl_arm_planner_node.cpp.
void SBPLArmPlannerNode::visualizeAttachedObject | ( | trajectory_msgs::JointTrajectory & | traj_msg, | |
int | throttle | |||
) | [private] |
Definition at line 1039 of file sbpl_arm_planner_node.cpp.
void SBPLArmPlannerNode::visualizeCollisionObjects | ( | ) | [private] |
Visualize voxels occupying known collision objects.
Definition at line 1017 of file sbpl_arm_planner_node.cpp.
void SBPLArmPlannerNode::visualizeElbowPoses | ( | ) | [private] |
Definition at line 1005 of file sbpl_arm_planner_node.cpp.
void SBPLArmPlannerNode::visualizeGoalPosition | ( | const motion_planning_msgs::Constraints & | goal | ) | [private] |
Publish a visualization marker to display the goal end effector position in rviz.
Definition at line 996 of file sbpl_arm_planner_node.cpp.
double sbpl_arm_planner::SBPLArmPlannerNode::allocated_time_ [private] |
Maximum time for planner to return a solution.
Definition at line 88 of file sbpl_arm_planner_node.h.
KDL::Chain sbpl_arm_planner::SBPLArmPlannerNode::arm_chain_ [private] |
Definition at line 141 of file sbpl_arm_planner_node.h.
std::string sbpl_arm_planner::SBPLArmPlannerNode::arm_description_filename_ [private] |
Definition at line 120 of file sbpl_arm_planner_node.h.
std::string sbpl_arm_planner::SBPLArmPlannerNode::arm_name_ [private] |
Definition at line 118 of file sbpl_arm_planner_node.h.
bool sbpl_arm_planner::SBPLArmPlannerNode::attached_object_ [private] |
Definition at line 108 of file sbpl_arm_planner_node.h.
std::string sbpl_arm_planner::SBPLArmPlannerNode::attached_object_frame_ [private] |
Definition at line 122 of file sbpl_arm_planner_node.h.
Definition at line 133 of file sbpl_arm_planner_node.h.
std::vector<std::vector<double> > sbpl_arm_planner::SBPLArmPlannerNode::col_objects_ [private] |
Definition at line 73 of file sbpl_arm_planner_node.h.
tf::MessageFilter<mapping_msgs::CollisionMap>* sbpl_arm_planner::SBPLArmPlannerNode::collision_map_filter_ [private] |
Definition at line 68 of file sbpl_arm_planner_node.h.
message_filters::Subscriber<mapping_msgs::CollisionMap> sbpl_arm_planner::SBPLArmPlannerNode::collision_map_subscriber_ [private] |
Definition at line 67 of file sbpl_arm_planner_node.h.
std::string sbpl_arm_planner::SBPLArmPlannerNode::collision_map_topic_ [private] |
Definition at line 112 of file sbpl_arm_planner_node.h.
ros::Subscriber sbpl_arm_planner::SBPLArmPlannerNode::collision_object_subscriber_ [private] |
Definition at line 71 of file sbpl_arm_planner_node.h.
boost::mutex sbpl_arm_planner::SBPLArmPlannerNode::colmap_mutex_ [private] |
Definition at line 135 of file sbpl_arm_planner_node.h.
SBPLCollisionSpace* sbpl_arm_planner::SBPLArmPlannerNode::cspace_ [private] |
Definition at line 131 of file sbpl_arm_planner_node.h.
std::vector<std::vector<double> > sbpl_arm_planner::SBPLArmPlannerNode::dpath_ [private] |
Definition at line 124 of file sbpl_arm_planner_node.h.
double sbpl_arm_planner::SBPLArmPlannerNode::env_resolution_ [private] |
Definition at line 94 of file sbpl_arm_planner_node.h.
std::string sbpl_arm_planner::SBPLArmPlannerNode::fk_service_name_ [private] |
The name of the forward kinematics service.
Definition at line 79 of file sbpl_arm_planner_node.h.
bool sbpl_arm_planner::SBPLArmPlannerNode::forward_search_ [private] |
Definition at line 97 of file sbpl_arm_planner_node.h.
OccupancyGrid* sbpl_arm_planner::SBPLArmPlannerNode::grid_ [private] |
Definition at line 132 of file sbpl_arm_planner_node.h.
std::string sbpl_arm_planner::SBPLArmPlannerNode::ik_service_name_ [private] |
The name of the inverse kinematics service.
Definition at line 82 of file sbpl_arm_planner_node.h.
KDL::JntArray sbpl_arm_planner::SBPLArmPlannerNode::jnt_pos_ [private] |
Definition at line 142 of file sbpl_arm_planner_node.h.
KDL::ChainFkSolverPos_recursive* sbpl_arm_planner::SBPLArmPlannerNode::jnt_to_pose_solver_ [private] |
A FK solver. (The FK service is currently being used).
Definition at line 76 of file sbpl_arm_planner_node.h.
std::vector<std::string> sbpl_arm_planner::SBPLArmPlannerNode::joint_names_ [private] |
Definition at line 123 of file sbpl_arm_planner_node.h.
KDL::Frame sbpl_arm_planner::SBPLArmPlannerNode::kdl_transform_ [private] |
Definition at line 143 of file sbpl_arm_planner_node.h.
std::string sbpl_arm_planner::SBPLArmPlannerNode::map_frame_ [private] |
Definition at line 116 of file sbpl_arm_planner_node.h.
MDPConfig sbpl_arm_planner::SBPLArmPlannerNode::mdp_cfg_ [private] |
Definition at line 128 of file sbpl_arm_planner_node.h.
std::string sbpl_arm_planner::SBPLArmPlannerNode::mprims_filename_ [private] |
Definition at line 121 of file sbpl_arm_planner_node.h.
ros::NodeHandle sbpl_arm_planner::SBPLArmPlannerNode::node_handle_ [private] |
Definition at line 64 of file sbpl_arm_planner_node.h.
std::string sbpl_arm_planner::SBPLArmPlannerNode::node_name_ [private] |
Definition at line 114 of file sbpl_arm_planner_node.h.
int sbpl_arm_planner::SBPLArmPlannerNode::num_joints_ [private] |
Definition at line 110 of file sbpl_arm_planner_node.h.
std::map<std::string, mapping_msgs::CollisionObject> sbpl_arm_planner::SBPLArmPlannerNode::object_map_ [private] |
Definition at line 125 of file sbpl_arm_planner_node.h.
boost::mutex sbpl_arm_planner::SBPLArmPlannerNode::object_mutex_ [private] |
Definition at line 136 of file sbpl_arm_planner_node.h.
ros::Subscriber sbpl_arm_planner::SBPLArmPlannerNode::object_subscriber_ [private] |
Definition at line 66 of file sbpl_arm_planner_node.h.
SBPLPlanner* sbpl_arm_planner::SBPLArmPlannerNode::planner_ [private] |
Definition at line 130 of file sbpl_arm_planner_node.h.
bool sbpl_arm_planner::SBPLArmPlannerNode::planner_initialized_ [private] |
Definition at line 102 of file sbpl_arm_planner_node.h.
std::string sbpl_arm_planner::SBPLArmPlannerNode::planning_joint_ [private] |
Definition at line 117 of file sbpl_arm_planner_node.h.
ros::ServiceServer sbpl_arm_planner::SBPLArmPlannerNode::planning_service_ [private] |
Definition at line 65 of file sbpl_arm_planner_node.h.
bool sbpl_arm_planner::SBPLArmPlannerNode::print_path_ [private] |
Definition at line 103 of file sbpl_arm_planner_node.h.
std::string sbpl_arm_planner::SBPLArmPlannerNode::reference_frame_ [private] |
Definition at line 115 of file sbpl_arm_planner_node.h.
std::string sbpl_arm_planner::SBPLArmPlannerNode::robot_description_ [private] |
Definition at line 113 of file sbpl_arm_planner_node.h.
ros::NodeHandle sbpl_arm_planner::SBPLArmPlannerNode::root_handle_ [private] |
Definition at line 64 of file sbpl_arm_planner_node.h.
EnvironmentROBARM3D sbpl_arm_planner::SBPLArmPlannerNode::sbpl_arm_env_ [private] |
Definition at line 129 of file sbpl_arm_planner_node.h.
bool sbpl_arm_planner::SBPLArmPlannerNode::search_mode_ [private] |
Definition at line 98 of file sbpl_arm_planner_node.h.
std::string sbpl_arm_planner::SBPLArmPlannerNode::side_ [private] |
"r" - right arm, "l" - left arm
Definition at line 85 of file sbpl_arm_planner_node.h.
tf::TransformListener sbpl_arm_planner::SBPLArmPlannerNode::tf_ [private] |
Definition at line 139 of file sbpl_arm_planner_node.h.
int sbpl_arm_planner::SBPLArmPlannerNode::throttle_ [private] |
Definition at line 109 of file sbpl_arm_planner_node.h.
std::string sbpl_arm_planner::SBPLArmPlannerNode::trajectory_type_ [private] |
Definition at line 119 of file sbpl_arm_planner_node.h.
tf::StampedTransform sbpl_arm_planner::SBPLArmPlannerNode::transform_ [private] |
Definition at line 140 of file sbpl_arm_planner_node.h.
bool sbpl_arm_planner::SBPLArmPlannerNode::use_first_solution_ [private] |
Definition at line 107 of file sbpl_arm_planner_node.h.
Definition at line 106 of file sbpl_arm_planner_node.h.
Definition at line 105 of file sbpl_arm_planner_node.h.
Definition at line 99 of file sbpl_arm_planner_node.h.
bool sbpl_arm_planner::SBPLArmPlannerNode::visualize_goal_ [private] |
Definition at line 101 of file sbpl_arm_planner_node.h.
bool sbpl_arm_planner::SBPLArmPlannerNode::visualize_heuristic_ [private] |
Definition at line 100 of file sbpl_arm_planner_node.h.
bool sbpl_arm_planner::SBPLArmPlannerNode::visualize_trajectory_ [private] |
Definition at line 104 of file sbpl_arm_planner_node.h.
double sbpl_arm_planner::SBPLArmPlannerNode::waypoint_time_ [private] |
Time interval sent with each waypoint in trajectory to movearm.
Definition at line 92 of file sbpl_arm_planner_node.h.