cartesian_wrench.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2014, Fetch Robotics Inc.
5  * Copyright (c) 2013, Unbounded Robotics Inc.
6  * Copyright (c) 2008, Willow Garage, Inc.
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of Unbounded Robotics nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *********************************************************************/
36 
37 /*
38  * Derived a bit from pr2_controllers/cartesian_wrench_controller.cpp
39  * Author: Michael Ferguson, Wim Meeussen
40  */
41 
42 #ifndef ROBOT_CONTROLLERS_CARTESIAN_WRENCH_H
43 #define ROBOT_CONTROLLERS_CARTESIAN_WRENCH_H
44 
45 #include <string>
46 #include <vector>
47 #include <boost/shared_ptr.hpp>
48 
49 #include <ros/ros.h>
53 #include <geometry_msgs/Wrench.h>
54 
55 #include <kdl/chain.hpp>
56 #include <kdl/chainjnttojacsolver.hpp>
57 #include <kdl/frames.hpp>
58 
59 #include <tf/transform_datatypes.h>
60 #include <tf/transform_listener.h>
61 
62 namespace robot_controllers
63 {
64 
66 {
67 public:
70 
78  virtual int init(ros::NodeHandle& nh, ControllerManager* manager);
79 
85  virtual bool start();
86 
94  virtual bool stop(bool force);
95 
102  virtual bool reset();
103 
109  virtual void update(const ros::Time& now, const ros::Duration& dt);
110 
112  virtual std::string getType()
113  {
114  return "robot_controllers/CartesianWrenchController";
115  }
116 
118  virtual std::vector<std::string> getCommandedNames();
119 
121  virtual std::vector<std::string> getClaimedNames();
122 
124  void command(const geometry_msgs::Wrench::ConstPtr& goal);
125 
126 private:
127  void updateJoints();
128 
131 
132  bool enabled_;
133  std::string root_link_;
135 
137 
143 
146 
148  std::vector<JointHandlePtr> joints_;
149 };
150 
151 } // namespace robot_controllers
152 
153 #endif // ROBOT_CONTROLLERS_CARTESIAN_WRENCH_H
virtual bool start()
Attempt to start the controller. This should be called only by the ControllerManager instance...
virtual void update(const ros::Time &now, const ros::Duration &dt)
This is the update loop for the controller.
virtual std::vector< std::string > getCommandedNames()
Get the names of joints/controllers which this controller commands.
virtual std::string getType()
Get the type of this controller.
void command(const geometry_msgs::Wrench::ConstPtr &goal)
Controller command.
boost::shared_ptr< KDL::ChainJntToJacSolver > jac_solver_
goal
virtual int init(ros::NodeHandle &nh, ControllerManager *manager)
Initialize the controller and any required data structures.
virtual bool stop(bool force)
Attempt to stop the controller. This should be called only by the ControllerManager instance...
virtual bool reset()
Cleanly reset the controller to it&#39;s initial state. Some controllers may choose to stop themselves...
virtual std::vector< std::string > getClaimedNames()
Get the names of joints/controllers which this controller exclusively claims.


robot_controllers
Author(s): Michael Ferguson
autogenerated on Sun Sep 27 2020 03:22:39