transmission.h
Go to the documentation of this file.
1 // Copyright (C) 2013, PAL Robotics S.L.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright notice,
7 // this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name of PAL Robotics S.L. nor the names of its
12 // contributors may be used to endorse or promote products derived from
13 // this software without specific prior written permission.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 // POSSIBILITY OF SUCH DAMAGE.
27 
29 
30 #pragma once
31 
32 
33 #include <cstddef>
34 #include <string>
35 #include <vector>
36 #include <memory>
37 #include <stdexcept>
38 
39 namespace transmission_interface
40 {
41 
51 {
52  std::vector<double*> position;
53  std::vector<double*> velocity;
54  std::vector<double*> effort;
55  std::vector<double*> absolute_position;
56  std::vector<double*> torque_sensor;
57 };
58 
63 struct JointData
64 {
65  std::vector<double*> position;
66  std::vector<double*> velocity;
67  std::vector<double*> effort;
68  std::vector<double*> absolute_position;
69  std::vector<double*> torque_sensor;
70 };
71 
92 {
93 public:
94  virtual ~Transmission() = default;
95 
104  virtual void actuatorToJointEffort(const ActuatorData& act_data,
105  JointData& jnt_data) = 0;
106 
115  virtual void actuatorToJointVelocity(const ActuatorData& act_data,
116  JointData& jnt_data) = 0;
117 
126  virtual void actuatorToJointPosition(const ActuatorData& act_data,
127  JointData& jnt_data) = 0;
128 
130  JointData&)
131  {
132  throw std::runtime_error("transmission does not support actuator to joint absolute position");
133  }
134 
136  JointData&)
137  {
138  throw std::runtime_error("transmission does not support actuator to joint torque sensor");
139  }
140 
141  virtual bool hasActuatorToJointAbsolutePosition() const {return false;}
142  virtual bool hasActuatorToJointTorqueSensor() const {return false;}
143 
152  virtual void jointToActuatorEffort(const JointData& jnt_data,
153  ActuatorData& act_data) = 0;
154 
163  virtual void jointToActuatorVelocity(const JointData& jnt_data,
164  ActuatorData& act_data) = 0;
165 
174  virtual void jointToActuatorPosition(const JointData& jnt_data,
175  ActuatorData& act_data) = 0;
176 
178  virtual std::size_t numActuators() const = 0;
179 
181  virtual std::size_t numJoints() const = 0;
182 };
183 
184 typedef std::shared_ptr<Transmission> TransmissionSharedPtr;
185 
186 } // transmission_interface
std::vector< double * > absolute_position
Definition: transmission.h:68
std::vector< double * > velocity
Definition: transmission.h:66
virtual void actuatorToJointTorqueSensor(const ActuatorData &, JointData &)
Definition: transmission.h:135
std::vector< double * > absolute_position
Definition: transmission.h:55
Contains pointers to raw data representing the position, velocity and acceleration of a transmission&#39;...
Definition: transmission.h:63
std::vector< double * > position
Definition: transmission.h:52
virtual void actuatorToJointAbsolutePosition(const ActuatorData &, JointData &)
Definition: transmission.h:129
std::vector< double * > torque_sensor
Definition: transmission.h:69
std::vector< double * > torque_sensor
Definition: transmission.h:56
virtual bool hasActuatorToJointTorqueSensor() const
Definition: transmission.h:142
Contains pointers to raw data representing the position, velocity and acceleration of a transmission&#39;...
Definition: transmission.h:50
virtual bool hasActuatorToJointAbsolutePosition() const
Definition: transmission.h:141
std::vector< double * > velocity
Definition: transmission.h:53
std::vector< double * > position
Definition: transmission.h:65
std::shared_ptr< Transmission > TransmissionSharedPtr
Definition: transmission.h:184
std::vector< double * > effort
Definition: transmission.h:67
std::vector< double * > effort
Definition: transmission.h:54
Abstract base class for representing mechanical transmissions.
Definition: transmission.h:91


transmission_interface
Author(s): Adolfo Rodriguez Tsouroukdissian
autogenerated on Mon Feb 28 2022 23:30:26