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  void starting(const ros::Time& /*time*/);
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
realtime_tools::RealtimeBuffer
realtime_publisher.h
node_handle.h
effort_controllers::JointGroupPositionController::update
void update(const ros::Time &, const ros::Duration &)
Definition: joint_group_position_controller.cpp:170
realtime_buffer.h
effort_controllers::JointGroupPositionController::enforceJointLimits
void enforceJointLimits(double &command, unsigned int index)
Definition: joint_group_position_controller.cpp:222
effort_controllers
Definition: joint_effort_controller.h:42
effort_controllers::JointGroupPositionController::~JointGroupPositionController
~JointGroupPositionController()
Definition: joint_group_position_controller.cpp:94
controller_interface::Controller
effort_controllers::JointGroupPositionController::JointGroupPositionController
JointGroupPositionController()
Forward command controller for a set of effort controlled joints (torque or force).
Definition: joint_group_position_controller.cpp:93
effort_controllers::JointGroupPositionController::joint_names_
std::vector< std::string > joint_names_
Definition: joint_group_position_controller.h:147
controller.h
joint_command_interface.h
model.h
effort_controllers::JointGroupPositionController::n_joints_
unsigned int n_joints_
Definition: joint_group_position_controller.h:150
hardware_interface::EffortJointInterface
effort_controllers::JointGroupPositionController::sub_command_
ros::Subscriber sub_command_
Definition: joint_group_position_controller.h:153
effort_controllers::JointGroupPositionController::commandCB
void commandCB(const std_msgs::Float64MultiArrayConstPtr &msg)
Definition: joint_group_position_controller.cpp:212
effort_controllers::JointGroupPositionController::init
bool init(hardware_interface::EffortJointInterface *hw, ros::NodeHandle &n)
Definition: joint_group_position_controller.cpp:96
ros::Time
effort_controllers::JointGroupPositionController::joint_urdfs_
std::vector< urdf::JointConstSharedPtr > joint_urdfs_
Definition: joint_group_position_controller.h:157
effort_controllers::JointGroupPositionController::commands_buffer_
realtime_tools::RealtimeBuffer< std::vector< double > > commands_buffer_
Definition: joint_group_position_controller.h:149
pid.h
effort_controllers::JointGroupPositionController::joints_
std::vector< hardware_interface::JointHandle > joints_
Definition: joint_group_position_controller.h:148
effort_controllers::JointGroupPositionController::pid_controllers_
std::vector< control_toolbox::Pid > pid_controllers_
Definition: joint_group_position_controller.h:155
ros::Duration
effort_controllers::JointGroupPositionController::starting
void starting(const ros::Time &)
Definition: joint_group_position_controller.cpp:158
ros::NodeHandle
ros::Subscriber


effort_controllers
Author(s): Vijay Pradeep
autogenerated on Fri May 24 2024 02:41:22