cob_lookat_action_server.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 #include <string>
19 #include <vector>
20 #include <math.h>
21 
22 #include <ros/ros.h>
23 
27 
28 #include <cob_lookat_action/LookAtAction.h>
29 #include <control_msgs/FollowJointTrajectoryAction.h>
30 #include <trajectory_msgs/JointTrajectory.h>
31 #include <trajectory_msgs/JointTrajectoryPoint.h>
32 #include <move_base_msgs/MoveBaseAction.h>
33 
35 #include <tf/transform_datatypes.h>
36 #include <tf_conversions/tf_kdl.h>
39 
40 #include <kdl/chainfksolverpos_recursive.hpp>
41 #include <kdl/chainiksolverpos_lma.hpp>
42 
43 
44 
46 {
47 protected:
48 
50 
54  std::string fjt_name_;
55  std::string mbl_name_;
56  std::string lookat_name_;
57  cob_lookat_action::LookAtFeedback lookat_fb_;
58  cob_lookat_action::LookAtResult lookat_res_;
59 
60  std::vector<std::string> joint_names_;
61  std::string chain_base_link_;
62  std::string chain_tip_link_;
63 
65  std::shared_ptr<KDL::ChainFkSolverPos_recursive> fk_solver_pos_main_;
66  std::shared_ptr<KDL::ChainFkSolverPos_recursive> fk_solver_pos_;
67  std::shared_ptr<KDL::ChainIkSolverPos_LMA> ik_solver_pos_;
68 
69  std::shared_ptr<tf2_ros::Buffer> tf_buffer_;
70  std::shared_ptr<tf2_ros::TransformListener> tf_listener_;
72 
73 public:
74 
75  CobLookAtAction(std::string action_name) :
76  fjt_name_("joint_trajectory_controller/follow_joint_trajectory"),
77  mbl_name_("/docker_control/move_base_linear"),
78  lookat_name_(action_name)
79  {}
80 
82 
83  bool init();
84  void goalCB(const cob_lookat_action::LookAtGoalConstPtr &goal);
85 };
std::shared_ptr< KDL::ChainFkSolverPos_recursive > fk_solver_pos_
std::shared_ptr< tf2_ros::Buffer > tf_buffer_
std::shared_ptr< KDL::ChainIkSolverPos_LMA > ik_solver_pos_
CobLookAtAction(std::string action_name)
actionlib::SimpleActionClient< control_msgs::FollowJointTrajectoryAction > * fjt_ac_
std::shared_ptr< tf2_ros::TransformListener > tf_listener_
std::vector< std::string > joint_names_
ros::Duration buffer_duration_
cob_lookat_action::LookAtFeedback lookat_fb_
cob_lookat_action::LookAtResult lookat_res_
void goalCB(const cob_lookat_action::LookAtGoalConstPtr &goal)
actionlib::SimpleActionClient< move_base_msgs::MoveBaseAction > * mbl_ac_
std::shared_ptr< KDL::ChainFkSolverPos_recursive > fk_solver_pos_main_
actionlib::SimpleActionServer< cob_lookat_action::LookAtAction > * lookat_as_


cob_lookat_action
Author(s): Felix Messmer
autogenerated on Sun Dec 6 2020 03:25:48