Robotsystem of the Robot Group Leipzig: schlangeforce.h Source File

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages
- Examples

- Search for |

- File List
- File Members

# schlangeforce.h

Go to the documentation of this file.

    00001 /************************************************************************/
    00002 /*schlangeforce.h                                                       */
    00003 /*Snake with torque added to joints                                     */
    00004 /*                                                                      */
    00005 /************************************************************************/
    00006 /***************************************************************************
    00007  *   Copyright (C) 2005 by Robot Group Leipzig                             *
    00008  *    martius@informatik.uni-leipzig.de                                    *
    00009  *    fhesse@informatik.uni-leipzig.de                                     *
    00010  *    der@informatik.uni-leipzig.de                                        *
    00011  *                                                                         *
    00012  *   This program is free software; you can redistribute it and/or modify  *
    00013  *   it under the terms of the GNU General Public License as published by  *
    00014  *   the Free Software Foundation; either version 2 of the License, or     *
    00015  *   (at your option) any later version.                                   *
    00016  *                                                                         *
    00017  *   This program is distributed in the hope that it will be useful,       *
    00018  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
    00019  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
    00020  *   GNU General Public License for more details.                          *
    00021  *                                                                         *
    00022  *   You should have received a copy of the GNU General Public License     *
    00023  *   along with this program; if not, write to the                         *
    00024  *   Free Software Foundation, Inc.,                                       *
    00025  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
    00026  *                                                                         *
    00027  *   $Log: schlangeforce.h,v $
    00028  *   Revision 1.16  2006/09/20 12:56:17  martius
    00029  *   Snakes have CreateSegment
    00030  *
    00031  *   Revision 1.15  2006/07/20 17:19:44  martius
    00032  *   removed using namespace std from matrix.h
    00033  *
    00034  *   Revision 1.14  2006/07/14 12:23:41  martius
    00035  *   selforg becomes HEAD
    00036  *
    00037  *   Revision 1.13.4.6  2006/06/25 16:57:15  martius
    00038  *   abstractrobot is configureable
    00039  *   name and revision
    00040  *
    00041  *   Revision 1.13.4.5  2006/03/30 12:34:56  martius
    00042  *   documentation updated
    00043  *
    00044  *   Revision 1.13.4.4  2006/02/01 18:33:40  martius
    00045  *   use Axis type for Joint axis. very important, since otherwise Vec3 * pose is not the right direction vector anymore
    00046  *
    00047  *   Revision 1.13.4.3  2006/01/04 17:04:41  fhesse
    00048  *   comments originating from old file removed
    00049  *
    00050  *   Revision 1.13.4.2  2006/01/04 14:46:00  fhesse
    00051  *   inherits from Schlange; moved to osg
    00052  *
    00053  *   Revision 1.13.4.1  2005/11/14 17:37:18  martius
    00054  *   moved to selforg
    00055  *
    00056  *   Revision 1.13  2005/11/14 12:48:43  martius
    00057  *   *** empty log message ***
    00058  *
    00059  *   Revision 1.12  2005/11/09 13:24:42  martius
    00060  *   added GPL
    00061  *
    00062  *                                                                 *
    00063  ***************************************************************************/
    00064 #ifndef __SCHLANGEFORCE_H
    00065 #define __SCHLANGEFORCE_H
    00066
    00067 #include "schlange.h"
    00068
    00069 namespace lpzrobots {
    00070
    00071   /**
    00072    * This is a class, which models a snake like robot.
    00073    * It consists of a number of equal elements, each linked
    00074    * by a joint powered by torques added to joints
    00075    **/
    00076   class SchlangeForce: public Schlange
    00077     {
    00078     public:
    00079       SchlangeForce ( const OdeHandle& odeHandle, const OsgHandle& osgHandle,
    00080                       const SchlangeConf& conf,
    00081                       const std::string& name, const std::string& revision);
    00082
    00083
    00084       virtual ~SchlangeForce();
    00085
    00086       /**
    00087        *Reads the actual motor commands from an array,
    00088        *an sets all motors of the snake to this values.
    00089        *It is an linear allocation.
    00090        *@param motors pointer to the array, motor values are scaled to [-1,1]
    00091        *@param motornumber length of the motor array
    00092        **/
    00093       virtual void setMotors ( const motor* motors, int motornumber );
    00094
    00095       /**
    00096        *Writes the sensor values to an array in the memory.
    00097        *@param sensors pointer to the array
    00098        *@param sensornumber length of the sensor array
    00099        *@return number of actually written sensors
    00100        **/
    00101       virtual int getSensors ( sensor* sensors, int sensornumber );
    00102
    00103       /** returns number of sensors
    00104        */
    00105       virtual int getSensorNumber() { assert(created); return joints.size() * 2; }
    00106
    00107       /** returns number of motors
    00108        */
    00109       virtual int getMotorNumber(){ assert(created); return joints.size() * 2; }
    00110
    00111     private:
    00112       virtual void create(const osg::Matrix& pose);
    00113       virtual void destroy();
    00114     };
    00115
    00116 }
    00117
    00118 #endif