OrocosRTTArmDriverInterface.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 #ifndef OROCOSRTTARMDRIVERINTERFACE_H_
19 #define OROCOSRTTARMDRIVERINTERFACE_H_
20 #include "Joint.h"
21 #include <rtt/TaskContext.hpp>
22 #include <rtt/Command.hpp>
23 #include <rtt/Ports.hpp>
24 #include <rtt/Method.hpp>
25 
26 using namespace RTT;
27 
28 class OrocosRTTArmDriverInterface : public TaskContext
29 {
30 
31 public:
32 
33 
34 
35  ReadDataPort<Jointd> set_position_inport;
36  ReadDataPort<Jointd> set_velocity_inport;
37 
38  WriteDataPort<Jointd> current_position_outport;
39  WriteDataPort<Jointd> current_velocity_outport;
40 
41  Method<void(Jointd)> setMaxVelocity;
42  Method<void(float)> setMaxVelocityFloat;
43  Method<void(Jointd)> setMaxAcceleration;
44  Method<void(float)> setMaxAccelerationFloat;
45 
46  OrocosRTTArmDriverInterface(std::string name) : TaskContext(name),
47  set_position_inport("SetPositionPort"),
48  set_velocity_inport("SetVelocityPort"),
49  current_position_outport("CurrentPositionPort"),
50  current_velocity_outport("CurrentVelocityPort"),
51  setMaxVelocity("setMaxVelocity",
52  &OrocosRTTArmDriverInterface::setMaxVelocityF,
53  this),
54  setMaxVelocityFloat("setMaxVelocityFloat",
55  &OrocosRTTArmDriverInterface::setMaxVelocityFloatF,
56  this),
57  setMaxAcceleration("setMaxAcceleration",
58  &OrocosRTTArmDriverInterface::setMaxAccelerationF,
59  this),
60  setMaxAccelerationFloat("setMaxAccelerationFloat",
61  &OrocosRTTArmDriverInterface::setMaxAccelerationFloatF,
62  this)
63  {
64  this->ports()->addEventPort(&set_position_inport);
65  this->ports()->addEventPort(&set_velocity_inport);
66  this->ports()->addPort(&current_position_outport);
67  this->ports()->addPort(&current_velocity_outport);
68 
69  this->methods()->addMethod( &setMaxVelocity,
70  "Setting maximal velocity of joints.", "Jointd", "maximal velocity in rad per second");
71  this->methods()->addMethod( &setMaxVelocityFloat,
72  "Setting maximal velocity of joints.", "float", "maximal velocity in rad per second");
73  this->methods()->addMethod( &setMaxAcceleration,
74  "Setting maximal acceleration of joints.", "Jointd", "maximal acceleration in rad per second squared");
75  this->methods()->addMethod( &setMaxAccelerationFloat,
76  "Setting maximal acceleration of joints.", "float", "maximal acceleration in rad per second squared");
77 
78  }
80 
81 private:
82  virtual void setMaxVelocityF(Jointd radpersec) = 0;
83  virtual void setMaxVelocityFloatF(float radpersec) = 0;
84  virtual void setMaxAccelerationF(Jointd radpersec) = 0;
85  virtual void setMaxAccelerationFloatF(float radpersec) = 0;
86 
87 
88 };
89 
90 
91 #endif /* OROCOSRTTARMDRIVERINTERFACE_H_ */
Method< void(float)> setMaxAccelerationFloat
ReadDataPort< Jointd > set_velocity_inport
ReadDataPort< Jointd > set_position_inport
WriteDataPort< Jointd > current_position_outport
WriteDataPort< Jointd > current_velocity_outport


schunk_powercube_chain
Author(s): Florian Weisshardt
autogenerated on Mon Nov 25 2019 03:48:21