00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #ifndef OROCOSRTTARMDRIVERINTERFACE_H_
00055 #define OROCOSRTTARMDRIVERINTERFACE_H_
00056 #include "Joint.h"
00057 #include <rtt/TaskContext.hpp>
00058 #include <rtt/Command.hpp>
00059 #include <rtt/Ports.hpp>
00060 #include <rtt/Method.hpp>
00061
00062 using namespace RTT;
00063
00064 class OrocosRTTArmDriverInterface : public TaskContext
00065 {
00066
00067 public:
00068
00069
00070
00071 ReadDataPort<Jointd> set_position_inport;
00072 ReadDataPort<Jointd> set_velocity_inport;
00073
00074 WriteDataPort<Jointd> current_position_outport;
00075 WriteDataPort<Jointd> current_velocity_outport;
00076
00077 Method<void(Jointd)> setMaxVelocity;
00078 Method<void(float)> setMaxVelocityFloat;
00079 Method<void(Jointd)> setMaxAcceleration;
00080 Method<void(float)> setMaxAccelerationFloat;
00081
00082 OrocosRTTArmDriverInterface(std::string name) : TaskContext(name),
00083 set_position_inport("SetPositionPort"),
00084 set_velocity_inport("SetVelocityPort"),
00085 current_position_outport("CurrentPositionPort"),
00086 current_velocity_outport("CurrentVelocityPort"),
00087 setMaxVelocity("setMaxVelocity",
00088 &OrocosRTTArmDriverInterface::setMaxVelocityF,
00089 this),
00090 setMaxVelocityFloat("setMaxVelocityFloat",
00091 &OrocosRTTArmDriverInterface::setMaxVelocityFloatF,
00092 this),
00093 setMaxAcceleration("setMaxAcceleration",
00094 &OrocosRTTArmDriverInterface::setMaxAccelerationF,
00095 this),
00096 setMaxAccelerationFloat("setMaxAccelerationFloat",
00097 &OrocosRTTArmDriverInterface::setMaxAccelerationFloatF,
00098 this)
00099 {
00100 this->ports()->addEventPort(&set_position_inport);
00101 this->ports()->addEventPort(&set_velocity_inport);
00102 this->ports()->addPort(¤t_position_outport);
00103 this->ports()->addPort(¤t_velocity_outport);
00104
00105 this->methods()->addMethod( &setMaxVelocity,
00106 "Setting maximal velocity of joints.", "Jointd", "maximal velocity in rad per second");
00107 this->methods()->addMethod( &setMaxVelocityFloat,
00108 "Setting maximal velocity of joints.", "float", "maximal velocity in rad per second");
00109 this->methods()->addMethod( &setMaxAcceleration,
00110 "Setting maximal acceleration of joints.", "Jointd", "maximal acceleration in rad per second squared");
00111 this->methods()->addMethod( &setMaxAccelerationFloat,
00112 "Setting maximal acceleration of joints.", "float", "maximal acceleration in rad per second squared");
00113
00114 }
00115 ~OrocosRTTArmDriverInterface() {};
00116
00117 private:
00118 virtual void setMaxVelocityF(Jointd radpersec) = 0;
00119 virtual void setMaxVelocityFloatF(float radpersec) = 0;
00120 virtual void setMaxAccelerationF(Jointd radpersec) = 0;
00121 virtual void setMaxAccelerationFloatF(float radpersec) = 0;
00122
00123
00124 };
00125
00126
00127 #endif