scaled_joint_command_interface.h
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // Copyright (C) 2012, hiDOF INC.
5 // Copyright (C) 2019, FZI Forschungszentrum Informatik (Scaling extension)
6 //
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions are met:
9 // * Redistributions of source code must retain the above copyright notice,
10 // this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above copyright
12 // notice, this list of conditions and the following disclaimer in the
13 // documentation and/or other materials provided with the distribution.
14 // * Neither the name of hiDOF, Inc. nor the names of its
15 // contributors may be used to endorse or promote products derived from
16 // this software without specific prior written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 // POSSIBILITY OF SUCH DAMAGE.
29 //
31 // -- END LICENSE BLOCK ------------------------------------------------
32 
33 //----------------------------------------------------------------------
40 //----------------------------------------------------------------------
41 
42 #ifndef UR_CONTROLLERS_SCALED_JOINT_COMMAND_INTERFACE_H_INCLUDED
43 #define UR_CONTROLLERS_SCALED_JOINT_COMMAND_INTERFACE_H_INCLUDED
44 
48 
49 namespace ur_controllers
50 {
52 {
53 public:
55 
56  {
57  }
58 
64  ScaledJointHandle(const hardware_interface::JointStateHandle& js, double* cmd, double* scaling_factor)
65  : hardware_interface::JointHandle(js, cmd), scaling_factor_(scaling_factor)
66  {
67  if (scaling_factor_ == nullptr)
68  {
69  throw hardware_interface::HardwareInterfaceException("Cannot create handle '" + js.getName() +
70  "'. Scaling factor pointer is null.");
71  }
72  }
73 
74  virtual ~ScaledJointHandle() = default;
75 
76  void setScalingFactor(double scaling_factor)
77  {
78  assert(scaling_factor_);
79  *scaling_factor_ = scaling_factor;
80  }
81  double getScalingFactor() const
82  {
83  assert(scaling_factor_);
84  return *scaling_factor_;
85  }
86 
87 private:
88  double* scaling_factor_;
89 };
90 
107  : public hardware_interface::HardwareResourceManager<ScaledJointHandle, hardware_interface::ClaimResources>
108 {
109 };
110 
113 {
114 };
115 
118 {
119 };
120 
123 {
124 };
125 } // namespace ur_controllers
126 #endif // ifndef UR_CONTROLLERS_SCALED_JOINT_COMMAND_INTERFACE_H_INCLUDED
ScaledJointCommandInterface for commanding velocity-based joints.
ScaledJointHandle(const hardware_interface::JointStateHandle &js, double *cmd, double *scaling_factor)
ScaledJointCommandInterface for commanding position-based joints.
Hardware interface to support commanding an array of joints.
ScaledJointCommandInterface for commanding effort-based joints.
virtual ~ScaledJointHandle()=default


ur_controllers
Author(s):
autogenerated on Sun Aug 22 2021 02:38:05