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 #pragma once
39 
40 
41 #include <control_msgs/JointControllerState.h>
42 #include <control_toolbox/pid.h>
47 #include <ros/node_handle.h>
48 #include <std_msgs/Float64MultiArray.h>
49 #include <urdf/model.h>
50 
51 namespace effort_controllers
52 {
53 
67 class JointGroupPositionController : public controller_interface::Controller<hardware_interface::EffortJointInterface>
68 {
69 public:
72 
74  void update(const ros::Time& /*time*/, const ros::Duration& /*period*/);
75 
76  std::vector< std::string > joint_names_;
77  std::vector< hardware_interface::JointHandle > joints_;
79  unsigned int n_joints_;
80 
81 private:
83 
84  std::vector<control_toolbox::Pid> pid_controllers_;
86  std::vector<urdf::JointConstSharedPtr> joint_urdfs_;
87 
88  void commandCB(const std_msgs::Float64MultiArrayConstPtr& msg);
89  void enforceJointLimits(double &command, unsigned int index);
90 }; // class
91 
92 } // namespace
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 Fri Feb 3 2023 03:19:08