OrocosRTTArmDriverInterface.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *   http://www.apache.org/licenses/LICENSE-2.0
00009 
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 
00018 #ifndef OROCOSRTTARMDRIVERINTERFACE_H_
00019 #define OROCOSRTTARMDRIVERINTERFACE_H_
00020 #include "Joint.h"
00021 #include <rtt/TaskContext.hpp>
00022 #include <rtt/Command.hpp>
00023 #include <rtt/Ports.hpp>
00024 #include <rtt/Method.hpp>
00025 
00026 using namespace RTT;
00027 
00028 class OrocosRTTArmDriverInterface : public TaskContext
00029 {
00030 
00031 public:
00032 
00033 
00034 
00035         ReadDataPort<Jointd>  set_position_inport;
00036         ReadDataPort<Jointd>  set_velocity_inport;
00037 
00038         WriteDataPort<Jointd>  current_position_outport;
00039         WriteDataPort<Jointd>  current_velocity_outport;
00040 
00041         Method<void(Jointd)> setMaxVelocity;
00042         Method<void(float)> setMaxVelocityFloat;
00043         Method<void(Jointd)> setMaxAcceleration;
00044         Method<void(float)> setMaxAccelerationFloat;
00045 
00046         OrocosRTTArmDriverInterface(std::string name) : TaskContext(name),
00047                         set_position_inport("SetPositionPort"),
00048                         set_velocity_inport("SetVelocityPort"),
00049                         current_position_outport("CurrentPositionPort"),
00050                         current_velocity_outport("CurrentVelocityPort"),
00051                         setMaxVelocity("setMaxVelocity",
00052                                 &OrocosRTTArmDriverInterface::setMaxVelocityF,
00053                                 this),
00054                         setMaxVelocityFloat("setMaxVelocityFloat",
00055                                         &OrocosRTTArmDriverInterface::setMaxVelocityFloatF,
00056                                 this),
00057                         setMaxAcceleration("setMaxAcceleration",
00058                                          &OrocosRTTArmDriverInterface::setMaxAccelerationF,
00059                                          this),
00060                         setMaxAccelerationFloat("setMaxAccelerationFloat",
00061                                          &OrocosRTTArmDriverInterface::setMaxAccelerationFloatF,
00062                                  this)
00063         {
00064                 this->ports()->addEventPort(&set_position_inport);
00065                 this->ports()->addEventPort(&set_velocity_inport);
00066                 this->ports()->addPort(&current_position_outport);
00067                 this->ports()->addPort(&current_velocity_outport);
00068 
00069                 this->methods()->addMethod( &setMaxVelocity,
00070                                 "Setting maximal velocity of joints.", "Jointd", "maximal velocity in rad per second");
00071                 this->methods()->addMethod( &setMaxVelocityFloat,
00072                                     "Setting maximal velocity of joints.", "float", "maximal velocity in rad per second");
00073                 this->methods()->addMethod( &setMaxAcceleration,
00074                                     "Setting maximal acceleration of joints.", "Jointd", "maximal acceleration in rad per second squared");
00075                 this->methods()->addMethod( &setMaxAccelerationFloat,
00076                                     "Setting maximal acceleration of joints.", "float", "maximal acceleration in rad per second squared");
00077 
00078         }
00079         ~OrocosRTTArmDriverInterface() {};
00080 
00081 private:
00082         virtual void setMaxVelocityF(Jointd radpersec) = 0;
00083         virtual void setMaxVelocityFloatF(float radpersec) = 0;
00084         virtual void setMaxAccelerationF(Jointd radpersec) = 0;
00085         virtual void setMaxAccelerationFloatF(float radpersec) = 0;
00086 
00087 
00088 };
00089 
00090 
00091 #endif /* OROCOSRTTARMDRIVERINTERFACE_H_ */


schunk_powercube_chain
Author(s): Florian Weisshardt
autogenerated on Sat Jun 8 2019 20:25:18