tool_goal_pose.h
Go to the documentation of this file.
00001 
00026 #ifndef INDUSTRIAL_MOVEIT_STOMP_MOVEIT_INCLUDE_STOMP_MOVEIT_COST_FUNCTIONS_TOOL_GOAL_POSE_H_
00027 #define INDUSTRIAL_MOVEIT_STOMP_MOVEIT_INCLUDE_STOMP_MOVEIT_COST_FUNCTIONS_TOOL_GOAL_POSE_H_
00028 
00029 #include <Eigen/Sparse>
00030 #include <moveit/robot_model/robot_model.h>
00031 #include <moveit/collision_detection_fcl/collision_world_fcl.h>
00032 #include <moveit/collision_detection_fcl/collision_robot_fcl.h>
00033 #include "stomp_moveit/cost_functions/stomp_cost_function.h"
00034 
00035 namespace stomp_moveit
00036 {
00037 namespace cost_functions
00038 {
00039 
00048 class ToolGoalPose: public StompCostFunction
00049 {
00050 public:
00051   ToolGoalPose();
00052   virtual ~ToolGoalPose();
00053 
00061   virtual bool initialize(moveit::core::RobotModelConstPtr robot_model_ptr,
00062                           const std::string& group_name,XmlRpc::XmlRpcValue& config) override;
00063 
00069   virtual bool configure(const XmlRpc::XmlRpcValue& config) override;
00070 
00079   virtual bool setMotionPlanRequest(const planning_scene::PlanningSceneConstPtr& planning_scene,
00080                    const moveit_msgs::MotionPlanRequest &req,
00081                    const stomp_core::StompConfiguration &config,
00082                    moveit_msgs::MoveItErrorCodes& error_code) override;
00083 
00084 
00096   virtual bool computeCosts(const Eigen::MatrixXd& parameters,
00097                             std::size_t start_timestep,
00098                             std::size_t num_timesteps,
00099                             int iteration_number,
00100                             int rollout_number,
00101                             Eigen::VectorXd& costs,
00102                             bool& validity) override;
00103 
00104   virtual std::string getGroupName() const override
00105   {
00106     return group_name_;
00107   }
00108 
00109 
00110   virtual std::string getName() const override
00111   {
00112     return name_ + "/" + group_name_;
00113   }
00114 
00123   virtual void done(bool success,int total_iterations,double final_cost,const Eigen::MatrixXd& parameters) override{}
00124 
00125 protected:
00126 
00127   std::string name_;
00128 
00129   // robot details
00130   std::string group_name_;
00131   std::string tool_link_;
00132   moveit::core::RobotModelConstPtr robot_model_;
00133   moveit::core::RobotStatePtr state_;
00134 
00135   // planning context information
00136   planning_scene::PlanningSceneConstPtr planning_scene_;
00137   moveit_msgs::MotionPlanRequest plan_request_;
00138 
00139   // goal pose
00140   Eigen::Affine3d tool_goal_pose_;                    
00142   // ros parameters
00143   Eigen::ArrayXi dof_nullity_;                        
00144   std::pair<double,double> position_error_range_;     
00145   std::pair<double,double> orientation_error_range_;  
00146   double position_cost_weight_;                       
00147   double orientation_cost_weight_;                    
00149   // support variables
00150   Eigen::VectorXd last_joint_pose_;
00151   Eigen::Affine3d last_tool_pose_;
00152   Eigen::VectorXd tool_twist_error_;
00153 
00154 
00155 };
00156 
00157 } /* namespace cost_functions */
00158 } /* namespace stomp_moveit */
00159 
00160 #endif /* INDUSTRIAL_MOVEIT_STOMP_MOVEIT_INCLUDE_STOMP_MOVEIT_COST_FUNCTIONS_TOOL_GOAL_POSE_H_ */


stomp_plugins
Author(s): Jorge Nicho
autogenerated on Sat Jun 8 2019 19:24:15