joint_group_position_controller.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2008, Willow Garage, Inc.
5  * Copyright (c) 2012, hiDOF, Inc.
6  * Copyright (c) 2013, PAL Robotics, S.L.
7  * Copyright (c) 2014, Fraunhofer IPA
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  *
14  * * Redistributions of source code must retain the above copyright
15  * notice, this list of conditions and the following disclaimer.
16  * * Redistributions in binary form must reproduce the above
17  * copyright notice, this list of conditions and the following
18  * disclaimer in the documentation and/or other materials provided
19  * with the distribution.
20  * * Neither the name of the Willow Garage nor the names of its
21  * contributors may be used to endorse or promote products derived
22  * from this software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35  * POSSIBILITY OF SUCH DAMAGE.
36  *********************************************************************/
37 
38 #ifndef EFFORT_CONTROLLERS_JOINT_GROUP_POSITION_CONTROLLER_H
39 #define EFFORT_CONTROLLERS_JOINT_GROUP_POSITION_CONTROLLER_H
40 
41 #include <ros/node_handle.h>
42 #include <urdf/model.h>
43 #include <control_toolbox/pid.h>
44 #include <boost/scoped_ptr.hpp>
48 #include <std_msgs/Float64MultiArray.h>
49 #include <control_msgs/JointControllerState.h>
51 
52 namespace effort_controllers
53 {
54 
68 class JointGroupPositionController : public controller_interface::Controller<hardware_interface::EffortJointInterface>
69 {
70 public:
73 
75  void update(const ros::Time& /*time*/, const ros::Duration& /*period*/);
76 
77  std::vector< std::string > joint_names_;
78  std::vector< hardware_interface::JointHandle > joints_;
80  unsigned int n_joints_;
81 
82 private:
84 
85  std::vector<control_toolbox::Pid> pid_controllers_;
87  std::vector<urdf::JointConstSharedPtr> joint_urdfs_;
88 
89  void commandCB(const std_msgs::Float64MultiArrayConstPtr& msg);
90  void enforceJointLimits(double &command, unsigned int index);
91 }; // class
92 
93 } // namespace
94 
95 #endif
std::vector< hardware_interface::JointHandle > joints_
void commandCB(const std_msgs::Float64MultiArrayConstPtr &msg)
Forward command controller for a set of effort controlled joints (torque or force).
JointGroupPositionController()
Forward command controller for a set of effort controlled joints (torque or force).
void enforceJointLimits(double &command, unsigned int index)
void update(const ros::Time &, const ros::Duration &)
realtime_tools::RealtimeBuffer< std::vector< double > > commands_buffer_
bool init(hardware_interface::EffortJointInterface *hw, ros::NodeHandle &n)


effort_controllers
Author(s): Vijay Pradeep
autogenerated on Sat Apr 18 2020 03:58:11