pr2_arm_kinematics.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 
57 namespace pr2_arm_kinematics
58 {
59  class PR2ArmKinematics
60  {
61  public:
62 
73  PR2ArmKinematics(bool create_transform_listener = true);
74 
75  virtual ~PR2ArmKinematics();
76 
81  bool isActive();
82 
88  virtual bool getPositionIK(moveit_msgs::GetPositionIK::Request &request,
89  moveit_msgs::GetPositionIK::Response &response);
90 
96  bool getPositionFK(moveit_msgs::GetPositionFK::Request &request,
97  moveit_msgs::GetPositionFK::Response &response);
98 
99  protected:
100 
101  // Helper function that assumes that everything is in the correct frame
102  bool getPositionIKHelper(moveit_msgs::GetPositionIK::Request &request,
103  moveit_msgs::GetPositionIK::Response &response);
104 
105  virtual bool transformPose(const std::string& des_frame,
106  const geometry_msgs::PoseStamped& pose_in,
107  geometry_msgs::PoseStamped& pose_out);
108 
109  bool active_;
110  int free_angle_;
112  double search_discretization_;
117  std::string root_name_;
118  int dimension_;
120  KDL::Chain kdl_chain_;
121  moveit_msgs::KinematicSolverInfo ik_solver_info_, fk_solver_info_;
122  };
123 }
124 
125 #endif
pr2_arm_ik_solver.h
pr2_arm_kinematics::PR2ArmKinematics::~PR2ArmKinematics
virtual ~PR2ArmKinematics()
Definition: pr2_arm_kinematics.cpp:128
pr2_arm_kinematics
Namespace for the PR2ArmKinematics.
pr2_arm_kinematics::PR2ArmKinematics::getPositionFK
bool getPositionFK(moveit_msgs::GetPositionFK::Request &request, moveit_msgs::GetPositionFK::Response &response)
This is the basic forward kinematics service that will return information about the kinematics node.
Definition: pr2_arm_kinematics.cpp:227
boost::shared_ptr< pr2_arm_kinematics::PR2ArmIKSolver >
ros.h
pr2_arm_kinematics::PR2ArmKinematics::dimension_
int dimension_
Definition: pr2_arm_kinematics.h:182
pr2_arm_kinematics::PR2ArmKinematics::ik_solver_info_
moveit_msgs::KinematicSolverInfo ik_solver_info_
Definition: pr2_arm_kinematics.h:185
urdf::Model
pr2_arm_kinematics::PR2ArmKinematics::pr2_arm_ik_solver_
boost::shared_ptr< pr2_arm_kinematics::PR2ArmIKSolver > pr2_arm_ik_solver_
Definition: pr2_arm_kinematics.h:178
pr2_arm_kinematics::PR2ArmKinematics::kdl_chain_
KDL::Chain kdl_chain_
Definition: pr2_arm_kinematics.h:184
pr2_arm_kinematics::PR2ArmKinematics::ik_service_
ros::ServiceServer ik_service_
Definition: pr2_arm_kinematics.h:179
pr2_arm_kinematics::PR2ArmKinematics::root_handle_
ros::NodeHandle root_handle_
Definition: pr2_arm_kinematics.h:177
ros::ServiceServer
pr2_arm_kinematics::PR2ArmKinematics::transformPose
virtual bool transformPose(const std::string &des_frame, const geometry_msgs::PoseStamped &pose_in, geometry_msgs::PoseStamped &pose_out)
Definition: pr2_arm_kinematics.cpp:281
pr2_arm_kinematics::PR2ArmKinematics::robot_model_
urdf::Model robot_model_
Definition: pr2_arm_kinematics.h:175
pr2_arm_kinematics::PR2ArmKinematics::search_discretization_
double search_discretization_
Definition: pr2_arm_kinematics.h:176
pr2_arm_kinematics::PR2ArmKinematics::tf_
tf::TransformListener * tf_
Definition: pr2_arm_kinematics.h:180
pr2_arm_kinematics::PR2ArmKinematics::isActive
bool isActive()
Specifies if the node is active or not.
Definition: pr2_arm_kinematics.cpp:135
pr2_arm_kinematics::PR2ArmKinematics::PR2ArmKinematics
PR2ArmKinematics(bool create_transform_listener=true)
Definition: pr2_arm_kinematics.cpp:58
transform_listener.h
tf.h
pr2_arm_kinematics::PR2ArmKinematics::ik_solver_info_service_
ros::ServiceServer ik_solver_info_service_
Definition: pr2_arm_kinematics.h:179
pr2_arm_kinematics::PR2ArmKinematics::getPositionIK
virtual bool getPositionIK(moveit_msgs::GetPositionIK::Request &request, moveit_msgs::GetPositionIK::Response &response)
This is the basic IK service method that will compute and return an IK solution.
Definition: pr2_arm_kinematics.cpp:142
pr2_arm_kinematics::PR2ArmKinematics::root_name_
std::string root_name_
Definition: pr2_arm_kinematics.h:181
tf_kdl.h
tf::TransformListener
pr2_arm_kinematics::PR2ArmKinematics::free_angle_
int free_angle_
Definition: pr2_arm_kinematics.h:174
pr2_arm_kinematics::PR2ArmKinematics::fk_solver_info_service_
ros::ServiceServer fk_solver_info_service_
Definition: pr2_arm_kinematics.h:179
pr2_arm_kinematics::PR2ArmKinematics::getPositionIKHelper
bool getPositionIKHelper(moveit_msgs::GetPositionIK::Request &request, moveit_msgs::GetPositionIK::Response &response)
Definition: pr2_arm_kinematics.cpp:172
pr2_arm_kinematics::PR2ArmKinematics::active_
bool active_
Definition: pr2_arm_kinematics.h:173
pr2_arm_kinematics::PR2ArmKinematics::jnt_to_pose_solver_
boost::shared_ptr< KDL::ChainFkSolverPos_recursive > jnt_to_pose_solver_
Definition: pr2_arm_kinematics.h:183
pr2_arm_kinematics::PR2ArmKinematics::fk_service_
ros::ServiceServer fk_service_
Definition: pr2_arm_kinematics.h:179
pr2_arm_kinematics::PR2ArmKinematics::node_handle_
ros::NodeHandle node_handle_
Definition: pr2_arm_kinematics.h:177
ros::NodeHandle
angles.h
pr2_arm_kinematics::PR2ArmKinematics::fk_solver_info_
moveit_msgs::KinematicSolverInfo fk_solver_info_
Definition: pr2_arm_kinematics.h:185


pr2_arm_kinematics
Author(s): Sachin Chitta
autogenerated on Wed Mar 2 2022 00:45:20