cob_twist_controller.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 #ifndef COB_TWIST_CONTROLLER_COB_TWIST_CONTROLLER_H
19 #define COB_TWIST_CONTROLLER_COB_TWIST_CONTROLLER_H
20 
21 #include <ros/ros.h>
22 
23 #include <std_msgs/ColorRGBA.h>
24 #include <sensor_msgs/JointState.h>
25 #include <geometry_msgs/Twist.h>
26 #include <nav_msgs/Odometry.h>
27 
28 #include <urdf/model.h>
29 
31 #include <kdl/chainfksolvervel_recursive.hpp>
32 #include <kdl/jntarray.hpp>
33 #include <kdl/jntarrayvel.hpp>
34 #include <kdl/frames.hpp>
35 
36 #include <tf/transform_listener.h>
37 #include <tf/tf.h>
38 
39 #include <boost/thread/mutex.hpp>
40 #include <boost/shared_ptr.hpp>
41 
42 #include <dynamic_reconfigure/server.h>
43 #include <pluginlib/class_loader.h>
44 
45 #include <cob_twist_controller/TwistControllerConfig.h>
50 
52 {
53 private:
55 
57 
60 
62 
64 
67 
68  KDL::Chain chain_;
70  KDL::Twist twist_odometry_cb_;
71 
73 
78 
80 
82 
83 public:
85  {
86  }
87 
89  {
90  this->jntToCartSolver_vel_.reset();
91  this->p_inv_diff_kin_solver_.reset();
92  this->controller_interface_.reset();
93  this->reconfigure_server_.reset();
94  }
95 
96  bool initialize();
97 
99 
100  void reconfigureCallback(cob_twist_controller::TwistControllerConfig& config, uint32_t level);
101  void checkSolverAndConstraints(cob_twist_controller::TwistControllerConfig& config);
102  void jointstateCallback(const sensor_msgs::JointState::ConstPtr& msg);
103  void odometryCallback(const nav_msgs::Odometry::ConstPtr& msg);
104 
105  void twistCallback(const geometry_msgs::Twist::ConstPtr& msg);
106  void twistStampedCallback(const geometry_msgs::TwistStamped::ConstPtr& msg);
107 
108  void solveTwist(KDL::Twist twist);
109  void visualizeTwist(KDL::Twist twist);
110 
111  boost::recursive_mutex reconfig_mutex_;
113 };
114 
115 #endif // COB_TWIST_CONTROLLER_COB_TWIST_CONTROLLER_H
CobTwistController::twist_odometry_cb_
KDL::Twist twist_odometry_cb_
Definition: cob_twist_controller.h:70
CobTwistController::twist_controller_params_
TwistControllerParams twist_controller_params_
Definition: cob_twist_controller.h:72
ros::Publisher
class_loader.h
boost::shared_ptr< KDL::ChainFkSolverVel_recursive >
CobTwistController::CobTwistController
CobTwistController()
Definition: cob_twist_controller.h:84
ros.h
controller_interface_base.h
CobTwistController::interface_loader_
boost::shared_ptr< pluginlib::ClassLoader< cob_twist_controller::ControllerInterfaceBase > > interface_loader_
Definition: cob_twist_controller.h:77
CobTwistController::jointstateCallback
void jointstateCallback(const sensor_msgs::JointState::ConstPtr &msg)
Definition: cob_twist_controller.cpp:518
CobTwistController::odometryCallback
void odometryCallback(const nav_msgs::Odometry::ConstPtr &msg)
Definition: cob_twist_controller.cpp:547
CobTwistController::~CobTwistController
~CobTwistController()
Definition: cob_twist_controller.h:88
CobTwistController::reconfig_mutex_
boost::recursive_mutex reconfig_mutex_
Definition: cob_twist_controller.h:111
CobTwistController::twist_direction_pub_
ros::Publisher twist_direction_pub_
Definition: cob_twist_controller.h:63
CobTwistController::register_link_client_
ros::ServiceClient register_link_client_
Definition: cob_twist_controller.h:65
CobTwistController::joint_states_
JointStates joint_states_
Definition: cob_twist_controller.h:69
CobTwistController::nh_
ros::NodeHandle nh_
Definition: cob_twist_controller.h:54
CobTwistController
Definition: cob_twist_controller.h:51
CallbackDataMediator
Represents a data pool for distribution of collected data from ROS callback.
Definition: callback_data_mediator.h:30
CobTwistController::tf_listener_
tf::TransformListener tf_listener_
Definition: cob_twist_controller.h:81
CobTwistController::twistStampedCallback
void twistStampedCallback(const geometry_msgs::TwistStamped::ConstPtr &msg)
Orientation of twist_stamped_msg is with respect to coordinate system given in header....
Definition: cob_twist_controller.cpp:367
CobTwistController::registerCollisionLinks
bool registerCollisionLinks()
Definition: cob_twist_controller.cpp:205
CobTwistController::initialize
bool initialize()
Definition: cob_twist_controller.cpp:33
model.h
CobTwistController::p_inv_diff_kin_solver_
boost::shared_ptr< InverseDifferentialKinematicsSolver > p_inv_diff_kin_solver_
Definition: cob_twist_controller.h:75
ros::ServiceClient
CobTwistController::visualizeTwist
void visualizeTwist(KDL::Twist twist)
Definition: cob_twist_controller.cpp:429
CobTwistController::twist_stamped_sub_
ros::Subscriber twist_stamped_sub_
Definition: cob_twist_controller.h:59
CobTwistController::controller_interface_
boost::shared_ptr< cob_twist_controller::ControllerInterfaceBase > controller_interface_
Definition: cob_twist_controller.h:76
CobTwistController::callback_data_mediator_
CallbackDataMediator callback_data_mediator_
Definition: cob_twist_controller.h:79
kdl_parser.hpp
CobTwistController::twist_sub_
ros::Subscriber twist_sub_
Definition: cob_twist_controller.h:58
CobTwistController::obstacle_distance_sub_
ros::Subscriber obstacle_distance_sub_
Definition: cob_twist_controller.h:66
transform_listener.h
tf.h
inverse_differential_kinematics_solver.h
CobTwistController::checkSolverAndConstraints
void checkSolverAndConstraints(cob_twist_controller::TwistControllerConfig &config)
Definition: cob_twist_controller.cpp:251
tf::TransformListener
CobTwistController::jntToCartSolver_vel_
boost::shared_ptr< KDL::ChainFkSolverVel_recursive > jntToCartSolver_vel_
Definition: cob_twist_controller.h:74
CobTwistController::odometry_sub_
ros::Subscriber odometry_sub_
Definition: cob_twist_controller.h:61
CobTwistController::reconfigure_server_
boost::shared_ptr< dynamic_reconfigure::Server< cob_twist_controller::TwistControllerConfig > > reconfigure_server_
Definition: cob_twist_controller.h:112
CobTwistController::reconfigureCallback
void reconfigureCallback(cob_twist_controller::TwistControllerConfig &config, uint32_t level)
Definition: cob_twist_controller.cpp:235
TwistControllerParams
Definition: cob_twist_controller_data_types.h:209
JointStates
Definition: cob_twist_controller_data_types.h:112
CobTwistController::twistCallback
void twistCallback(const geometry_msgs::Twist::ConstPtr &msg)
Orientation of twist_msg is with respect to chain_base coordinate system.
Definition: cob_twist_controller.cpp:390
CobTwistController::chain_
KDL::Chain chain_
Definition: cob_twist_controller.h:68
CobTwistController::jointstate_sub_
ros::Subscriber jointstate_sub_
Definition: cob_twist_controller.h:56
CobTwistController::solveTwist
void solveTwist(KDL::Twist twist)
Orientation of twist is with respect to chain_base coordinate system.
Definition: cob_twist_controller.cpp:398
ros::NodeHandle
ros::Subscriber
cob_twist_controller_data_types.h
callback_data_mediator.h


cob_twist_controller
Author(s): Felix Messmer , Marco Bezzon , Christoph Mark , Francisco Moreno
autogenerated on Mon May 1 2023 02:44:43