pr2_arm_kinematics_plugin.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2008, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 
35 /* Author: Sachin Chitta */
36 
37 #ifndef PR2_ARM_IK_NODE_H
38 #define PR2_ARM_IK_NODE_H
39 
40 #include <ros/ros.h>
41 #include <tf/tf.h>
42 #include <tf/transform_listener.h>
43 
44 #include <angles/angles.h>
46 #include <tf_conversions/tf_kdl.h>
47 
48 #include <moveit_msgs/GetPositionFK.h>
49 #include <moveit_msgs/GetPositionIK.h>
50 #include <moveit_msgs/KinematicSolverInfo.h>
51 #include <moveit_msgs/MoveItErrorCodes.h>
52 
53 #include <kdl/chainfksolverpos_recursive.hpp>
54 
55 #include <boost/shared_ptr.hpp>
56 
58 
60 namespace pr2_arm_kinematics
61 {
62 class PR2ArmKinematicsPlugin : public kinematics::KinematicsBase
63 {
64 public:
65 
70 
75  bool isActive();
76 
77  virtual bool getPositionIK(const geometry_msgs::Pose &ik_pose,
78  const std::vector<double> &ik_seed_state,
79  std::vector<double> &solution,
80  moveit_msgs::MoveItErrorCodes &error_code,
82 
83  virtual bool searchPositionIK(const geometry_msgs::Pose &ik_pose,
84  const std::vector<double> &ik_seed_state,
85  double timeout,
86  std::vector<double> &solution,
87  moveit_msgs::MoveItErrorCodes &error_code,
89 
90  virtual bool searchPositionIK(const geometry_msgs::Pose &ik_pose,
91  const std::vector<double> &ik_seed_state,
92  double timeout,
93  const std::vector<double> &consistency_limits,
94  std::vector<double> &solution,
95  moveit_msgs::MoveItErrorCodes &error_code,
97 
98  virtual bool searchPositionIK(const geometry_msgs::Pose &ik_pose,
99  const std::vector<double> &ik_seed_state,
100  double timeout,
101  std::vector<double> &solution,
102  const IKCallbackFn &solution_callback,
103  moveit_msgs::MoveItErrorCodes &error_code,
105 
106  virtual bool searchPositionIK(const geometry_msgs::Pose &ik_pose,
107  const std::vector<double> &ik_seed_state,
108  double timeout,
109  const std::vector<double> &consistency_limits,
110  std::vector<double> &solution,
111  const IKCallbackFn &solution_callback,
112  moveit_msgs::MoveItErrorCodes &error_code,
114 
115  virtual bool getPositionFK(const std::vector<std::string> &link_names,
116  const std::vector<double> &joint_angles,
117  std::vector<geometry_msgs::Pose> &poses) const;
118 
123  virtual bool initialize(const std::string& robot_description,
124  const std::string& group_name,
125  const std::string& base_frame,
126  const std::string& tip_frame,
127  double search_discretization);
128 
132  const std::vector<std::string>& getJointNames() const;
133 
137  const std::vector<std::string>& getLinkNames() const;
138 
139 protected:
140 
141  bool active_;
142  int free_angle_;
144  ros::NodeHandle node_handle_, root_handle_;
146  ros::ServiceServer ik_service_,fk_service_,ik_solver_info_service_,fk_solver_info_service_;
147  //tf::TransformListener tf_;
148  std::string root_name_;
149  int dimension_;
152  moveit_msgs::KinematicSolverInfo ik_solver_info_, fk_solver_info_;
153 
154 };
155 }
156 
157 #endif
const std::vector< std::string > & getJointNames() const
Namespace for the PR2ArmKinematics.
const std::vector< std::string > & getLinkNames() const
pr2_arm_kinematics::PR2ArmIKSolverPtr pr2_arm_ik_solver_
virtual bool searchPositionIK(const geometry_msgs::Pose &ik_pose, const std::vector< double > &ik_seed_state, double timeout, std::vector< double > &solution, moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions()) const
moveit_msgs::KinematicSolverInfo fk_solver_info_
std::shared_ptr< KDL::ChainFkSolverPos_recursive > jnt_to_pose_solver_
virtual bool getPositionFK(const std::vector< std::string > &link_names, const std::vector< double > &joint_angles, std::vector< geometry_msgs::Pose > &poses) const
virtual bool getPositionIK(const geometry_msgs::Pose &ik_pose, const std::vector< double > &ik_seed_state, std::vector< double > &solution, moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions()) const
urdf::ModelInterfaceSharedPtr robot_model_
boost::function< void(const geometry_msgs::Pose &ik_pose, const std::vector< double > &ik_solution, moveit_msgs::MoveItErrorCodes &error_code)> IKCallbackFn
moveit_msgs::KinematicSolverInfo ik_solver_info_
virtual bool initialize(const std::string &robot_description, const std::string &group_name, const std::string &base_name, const std::string &tip_name, double search_discretization)


pr2_arm_kinematics
Author(s): Sachin Chitta
autogenerated on Wed Jun 5 2019 21:35:32