Sensor.h
Go to the documentation of this file.
00001 // -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
00002 /*
00003  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
00004  * All rights reserved. This program is made available under the terms of the
00005  * Eclipse Public License v1.0 which accompanies this distribution, and is
00006  * available at http://www.eclipse.org/legal/epl-v10.html
00007  * Contributors:
00008  * The University of Tokyo
00009  * National Institute of Advanced Industrial Science and Technology (AIST)
00010  * General Robotix Inc. 
00011  */
00012 #ifndef OPENHRP_SENSOR_HEADER
00013 #define OPENHRP_SENSOR_HEADER
00014 
00019 #include <string>
00020 #include <iostream>
00021 #include "fMatrix3.h"
00022 #include "chain.h"
00023 
00024         class Sensor
00025         {
00026         public:
00027 
00028                 enum SensorType {
00029                         COMMON = 0,
00030                         FORCE,
00031                         RATE_GYRO,
00032                         ACCELERATION,
00033                         PRESSURE,
00034                         PHOTO_INTERRUPTER,
00035                         VISION,
00036                         TORQUE,
00037                         NUM_SENSOR_TYPES
00038                 };
00039 
00040                 static const int TYPE = COMMON;
00041                 
00042         Sensor(); 
00043         virtual ~Sensor();
00044 
00045         static Sensor* create(int type);
00046                 static void destroy(Sensor* sensor);
00047 
00048                 virtual void operator=(const Sensor& org);
00049 
00050         virtual void clear();
00051                 
00052                 std::string name;
00053                 int type;
00054                 int id;
00055                 Joint* joint;
00056                 fMat33 localR;
00057                 fVec3 localPos;
00058 
00059                 virtual void putInformation(std::ostream& os);
00060 
00061         };
00062 
00063 
00064         class ForceSensor : public Sensor
00065         {
00066         public:
00067                 static const int TYPE = FORCE;
00068                 
00069         ForceSensor();
00070                 fVec3 f;
00071                 fVec3 tau;
00072 
00073         virtual void clear();
00074                 virtual void putInformation(std::ostream& os);
00075         };
00076 
00077 
00078         class RateGyroSensor : public Sensor
00079         {
00080         public:
00081                 static const int TYPE = RATE_GYRO;
00082 
00083         RateGyroSensor();
00084                 fVec3 w;
00085 
00086         virtual void clear();
00087                 virtual void putInformation(std::ostream& os);
00088         };
00089 
00090 
00091         class AccelSensor : public Sensor
00092         {
00093         public:
00094                 static const int TYPE = ACCELERATION;
00095 
00096         AccelSensor();
00097 
00098                 fVec3 dv;
00099 
00100         virtual void clear();
00101                 virtual void putInformation(std::ostream& os);
00102 
00103         };
00104 
00105 #endif


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Apr 11 2019 03:30:19