YouBotJointParameterReadOnly.hpp
Go to the documentation of this file.
00001 #ifndef YOUBOT_YOUBOTJOINTPARAMETERREADONLY_H
00002 #define YOUBOT_YOUBOTJOINTPARAMETERREADONLY_H
00003 
00004 /****************************************************************
00005  *
00006  * Copyright (c) 2011
00007  * All rights reserved.
00008  *
00009  * Hochschule Bonn-Rhein-Sieg
00010  * University of Applied Sciences
00011  * Computer Science Department
00012  *
00013  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00014  *
00015  * Author:
00016  * Jan Paulus, Nico Hochgeschwender, Michael Reckhaus, Azamat Shakhimardanov
00017  * Supervised by:
00018  * Gerhard K. Kraetzschmar
00019  *
00020  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00021  *
00022  * This sofware is published under a dual-license: GNU Lesser General Public 
00023  * License LGPL 2.1 and BSD license. The dual-license implies that users of this
00024  * code may choose which terms they prefer.
00025  *
00026  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00027  *
00028  * Redistribution and use in source and binary forms, with or without
00029  * modification, are permitted provided that the following conditions are met:
00030  *
00031  *     * Redistributions of source code must retain the above copyright
00032  *       notice, this list of conditions and the following disclaimer.
00033  *     * Redistributions in binary form must reproduce the above copyright
00034  *       notice, this list of conditions and the following disclaimer in the
00035  *       documentation and/or other materials provided with the distribution.
00036  *     * Neither the name of the Hochschule Bonn-Rhein-Sieg nor the names of its
00037  *       contributors may be used to endorse or promote products derived from
00038  *       this software without specific prior written permission.
00039  *
00040  * This program is free software: you can redistribute it and/or modify
00041  * it under the terms of the GNU Lesser General Public License LGPL as
00042  * published by the Free Software Foundation, either version 2.1 of the
00043  * License, or (at your option) any later version or the BSD license.
00044  *
00045  * This program is distributed in the hope that it will be useful,
00046  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00047  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00048  * GNU Lesser General Public License LGPL and the BSD license for more details.
00049  *
00050  * You should have received a copy of the GNU Lesser General Public
00051  * License LGPL and BSD license along with this program.
00052  *
00053  ****************************************************************/
00054 #include <vector>
00055 #include <sstream>
00056 #include <youbot_driver/generic/Logger.hpp>
00057 #include <youbot_driver/generic/Units.hpp>
00058 #include <youbot_driver/generic/Time.hpp>
00059 #include <youbot_driver/generic/Exceptions.hpp>
00060 #include <youbot_driver/generic-joint/JointParameter.hpp>
00061 #include <youbot_driver/youbot/ProtocolDefinitions.hpp>
00062 #include <youbot_driver/youbot/YouBotSlaveMsg.hpp>
00063 #include <youbot_driver/youbot/YouBotSlaveMailboxMsg.hpp>
00064 #include <youbot_driver/youbot/YouBotJointStorage.hpp>
00065 namespace youbot
00066 {
00067 
00071 class YouBotJointParameterReadOnly : public JointParameter
00072 {
00073   friend class YouBotJoint;
00074 protected:
00075   YouBotJointParameterReadOnly();
00076 
00077 public:
00078   virtual ~YouBotJointParameterReadOnly();
00079 
00080   virtual void toString(std::string& value) = 0;
00081 
00082 protected:
00083   virtual void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType,
00084                                    const YouBotJointStorage& storage) const = 0;
00085 
00086   virtual void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage) = 0;
00087 
00088   virtual std::string getName() const = 0;
00089 
00090   virtual ParameterType getType() const = 0;
00091 
00092   std::string name;
00093 
00094   ParameterType parameterType;
00095 
00096 };
00100 class ActualMotorVoltage : public YouBotJointParameterReadOnly
00101 {
00102   friend class YouBotJoint;
00103 public:
00104   ActualMotorVoltage();
00105 
00106   virtual ~ActualMotorVoltage();
00107 
00108   void getParameter(quantity<electric_potential>& parameter) const;
00109 
00110   void toString(std::string& value);
00111 
00112 private:
00113   void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType,
00114                            const YouBotJointStorage& storage) const;
00115 
00116   void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00117 
00118   std::string getName() const
00119   {
00120     return this->name;
00121   }
00122   ;
00123 
00125   ParameterType getType() const
00126   {
00127     return this->parameterType;
00128   }
00129   ;
00130 
00131   quantity<electric_potential> value;
00132 
00133   std::string name;
00134 
00135   ParameterType parameterType;
00136 
00137 };
00153 class ErrorAndStatus : public YouBotJointParameterReadOnly
00154 {
00155   friend class YouBotJoint;
00156 public:
00157   ErrorAndStatus();
00158 
00159   virtual ~ErrorAndStatus();
00160 
00161   void getParameter(unsigned int& parameter) const;
00162 
00163   void toString(std::string& value);
00164 
00165 private:
00166   void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType,
00167                            const YouBotJointStorage& storage) const;
00168 
00169   void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00170 
00171   std::string getName() const
00172   {
00173     return this->name;
00174   }
00175   ;
00176 
00177   ParameterType getType() const
00178   {
00179     return this->parameterType;
00180   }
00181   ;
00182 
00183   void parseYouBotErrorFlags() const;
00184 
00185   unsigned int value;
00186 
00187   std::string name;
00188 
00189   ParameterType parameterType;
00190 
00191 };
00195 class PositionError : public YouBotJointParameterReadOnly
00196 {
00197   friend class YouBotJoint;
00198 public:
00199   PositionError();
00200 
00201   virtual ~PositionError();
00202 
00203   void getParameter(quantity<plane_angle>& parameter) const;
00204 
00205   void toString(std::string& value);
00206 
00207 private:
00208   void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType,
00209                            const YouBotJointStorage& storage) const;
00210 
00211   void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00212 
00213   std::string getName() const
00214   {
00215     return this->name;
00216   }
00217   ;
00218 
00219   ParameterType getType() const
00220   {
00221     return this->parameterType;
00222   }
00223   ;
00224 
00225   quantity<plane_angle> value;
00226 
00227   std::string name;
00228 
00229   ParameterType parameterType;
00230 
00231 };
00235 class PositionErrorSum : public YouBotJointParameterReadOnly
00236 {
00237   friend class YouBotJoint;
00238 public:
00239   PositionErrorSum();
00240 
00241   virtual ~PositionErrorSum();
00242 
00243   void getParameter(quantity<plane_angle>& parameter) const;
00244 
00245   void toString(std::string& value);
00246 
00247 private:
00248   void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType,
00249                            const YouBotJointStorage& storage) const;
00250 
00251   void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00252 
00253   std::string getName() const
00254   {
00255     return this->name;
00256   }
00257   ;
00258 
00259   ParameterType getType() const
00260   {
00261     return this->parameterType;
00262   }
00263   ;
00264 
00265   quantity<plane_angle> value;
00266 
00267   std::string name;
00268 
00269   ParameterType parameterType;
00270 
00271 };
00275 class VelocityError : public YouBotJointParameterReadOnly
00276 {
00277   friend class YouBotJoint;
00278 public:
00279   VelocityError();
00280 
00281   virtual ~VelocityError();
00282 
00283   void getParameter(quantity<si::angular_velocity>& parameter) const;
00284 
00285   void toString(std::string& value);
00286 
00287 private:
00288   void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType,
00289                            const YouBotJointStorage& storage) const;
00290 
00291   void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00292 
00293   std::string getName() const
00294   {
00295     return this->name;
00296   }
00297   ;
00298 
00299   ParameterType getType() const
00300   {
00301     return this->parameterType;
00302   }
00303   ;
00304 
00305   quantity<si::angular_velocity> value;
00306 
00307   std::string name;
00308 
00309   ParameterType parameterType;
00310 
00311 };
00315 class VelocityErrorSum : public YouBotJointParameterReadOnly
00316 {
00317   friend class YouBotJoint;
00318 public:
00319   VelocityErrorSum();
00320 
00321   virtual ~VelocityErrorSum();
00322 
00323   void getParameter(quantity<si::angular_velocity>& parameter) const;
00324 
00325   void toString(std::string& value);
00326 
00327 private:
00328   void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType,
00329                            const YouBotJointStorage& storage) const;
00330 
00331   void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00332 
00333   std::string getName() const
00334   {
00335     return this->name;
00336   }
00337   ;
00338 
00339   ParameterType getType() const
00340   {
00341     return this->parameterType;
00342   }
00343   ;
00344 
00345   quantity<si::angular_velocity> value;
00346 
00347   std::string name;
00348 
00349   ParameterType parameterType;
00350 
00351 };
00355 class CurrentError : public YouBotJointParameterReadOnly
00356 {
00357   friend class YouBotJoint;
00358 public:
00359   CurrentError();
00360 
00361   virtual ~CurrentError();
00362 
00363   void getParameter(quantity<si::current>& parameter) const;
00364 
00365   void toString(std::string& value);
00366 
00367 private:
00368   void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType,
00369                            const YouBotJointStorage& storage) const;
00370 
00371   void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00372 
00373   std::string getName() const
00374   {
00375     return this->name;
00376   }
00377   ;
00378 
00379   ParameterType getType() const
00380   {
00381     return this->parameterType;
00382   }
00383   ;
00384 
00385   quantity<si::current> value;
00386 
00387   std::string name;
00388 
00389   ParameterType parameterType;
00390 
00391 };
00395 class CurrentErrorSum : public YouBotJointParameterReadOnly
00396 {
00397   friend class YouBotJoint;
00398 public:
00399   CurrentErrorSum();
00400 
00401   virtual ~CurrentErrorSum();
00402 
00403   void getParameter(quantity<si::current>& parameter) const;
00404 
00405   void toString(std::string& value);
00406 
00407 private:
00408   void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType,
00409                            const YouBotJointStorage& storage) const;
00410 
00411   void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00412 
00413   std::string getName() const
00414   {
00415     return this->name;
00416   }
00417   ;
00418 
00419   ParameterType getType() const
00420   {
00421     return this->parameterType;
00422   }
00423   ;
00424 
00425   quantity<si::current> value;
00426 
00427   std::string name;
00428 
00429   ParameterType parameterType;
00430 
00431 };
00435 class RampGeneratorSpeed : public YouBotJointParameterReadOnly
00436 {
00437   friend class YouBotJoint;
00438 public:
00439   RampGeneratorSpeed();
00440 
00441   virtual ~RampGeneratorSpeed();
00442 
00443   void getParameter(quantity<si::angular_velocity>& parameter) const;
00444 
00445   void toString(std::string& value);
00446 
00447 private:
00448   void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType,
00449                            const YouBotJointStorage& storage) const;
00450 
00451   void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00452 
00453   std::string getName() const
00454   {
00455     return this->name;
00456   }
00457   ;
00458 
00459   ParameterType getType() const
00460   {
00461     return this->parameterType;
00462   }
00463   ;
00464 
00465   quantity<si::angular_velocity> value;
00466 
00467   std::string name;
00468 
00469   ParameterType parameterType;
00470 
00471 };
00475 class I2tSum : public YouBotJointParameterReadOnly
00476 {
00477   friend class YouBotJoint;
00478 public:
00479   I2tSum();
00480 
00481   virtual ~I2tSum();
00482 
00483   void getParameter(unsigned int& parameter) const;
00484 
00485   void setParameter(const unsigned int parameter);
00486 
00487   void toString(std::string& value);
00488 
00489 private:
00490   void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType,
00491                            const YouBotJointStorage& storage) const;
00492 
00493   void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00494 
00495   std::string getName() const
00496   {
00497     return this->name;
00498   }
00499   ;
00500 
00501   ParameterType getType() const
00502   {
00503     return this->parameterType;
00504   }
00505   ;
00506 
00507   unsigned int upperLimit;
00508 
00509   unsigned int lowerLimit;
00510 
00511   unsigned int value;
00512 
00513   std::string name;
00514 
00515   ParameterType parameterType;
00516 
00517 };
00521 class ActualMotorDriverTemperature : public YouBotJointParameterReadOnly
00522 {
00523   friend class YouBotJoint;
00524 public:
00525   ActualMotorDriverTemperature();
00526 
00527   virtual ~ActualMotorDriverTemperature();
00528 
00529   void getParameter(quantity<celsius::temperature>& parameter) const;
00530 
00531   void toString(std::string& value);
00532 
00533 private:
00534   void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType,
00535                            const YouBotJointStorage& storage) const;
00536 
00537   void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00538 
00539   std::string getName() const
00540   {
00541     return this->name;
00542   }
00543   ;
00544 
00545   ParameterType getType() const
00546   {
00547     return this->parameterType;
00548   }
00549   ;
00550 
00551   quantity<celsius::temperature> value;
00552 
00553   std::string name;
00554 
00555   ParameterType parameterType;
00556 
00557 };
00561 class ActualModuleSupplyCurrent : public YouBotJointParameterReadOnly
00562 {
00563   friend class YouBotJoint;
00564 public:
00565   ActualModuleSupplyCurrent();
00566 
00567   virtual ~ActualModuleSupplyCurrent();
00568 
00569   void getParameter(quantity<si::current>& parameter) const;
00570 
00571   void toString(std::string& value);
00572 
00573 private:
00574   void getYouBotMailboxMsg(YouBotSlaveMailboxMsg& message, TMCLCommandNumber msgType,
00575                            const YouBotJointStorage& storage) const;
00576 
00577   void setYouBotMailboxMsg(const YouBotSlaveMailboxMsg& message, const YouBotJointStorage& storage);
00578 
00579   std::string getName() const
00580   {
00581     return this->name;
00582   }
00583   ;
00584 
00585   ParameterType getType() const
00586   {
00587     return this->parameterType;
00588   }
00589   ;
00590 
00591   quantity<si::current> value;
00592 
00593   std::string name;
00594 
00595   ParameterType parameterType;
00596 
00597 };
00598 
00599 } // namespace youbot
00600 #endif


youbot_driver
Author(s): Jan Paulus
autogenerated on Mon Oct 6 2014 09:08:02