Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages | Examples

ArActionDesired.cpp

00001 /*
00002 MobileRobots Advanced Robotics Interface for Applications (ARIA)
00003 Copyright (C) 2004, 2005 ActivMedia Robotics LLC
00004 Copyright (C) 2006, 2007 MobileRobots Inc.
00005 
00006      This program is free software; you can redistribute it and/or modify
00007      it under the terms of the GNU General Public License as published by
00008      the Free Software Foundation; either version 2 of the License, or
00009      (at your option) any later version.
00010 
00011      This program is distributed in the hope that it will be useful,
00012      but WITHOUT ANY WARRANTY; without even the implied warranty of
00013      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014      GNU General Public License for more details.
00015 
00016      You should have received a copy of the GNU General Public License
00017      along with this program; if not, write to the Free Software
00018      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 If you wish to redistribute ARIA under different terms, contact 
00021 MobileRobots for information about a commercial version of ARIA at 
00022 robots@mobilerobots.com or 
00023 MobileRobots Inc, 19 Columbia Drive, Amherst, NH 03031; 800-639-9481
00024 */
00025 
00026 #include "ArExport.h"
00027 #include "ariaOSDef.h"
00028 #include "ArActionDesired.h"
00029 
00030 const double ArActionDesired::NO_STRENGTH = 0.0;
00031 const double ArActionDesired::MIN_STRENGTH = .000001;
00032 const double ArActionDesired::MAX_STRENGTH = 1.0;
00033 
00034 const double ArActionDesiredChannel::NO_STRENGTH =
00035                                                  ArActionDesired::NO_STRENGTH;
00036 const double ArActionDesiredChannel::MIN_STRENGTH = 
00037                                                 ArActionDesired::MIN_STRENGTH;
00038 const double ArActionDesiredChannel::MAX_STRENGTH = 
00039                                                 ArActionDesired::MAX_STRENGTH;
00040 
00041 
00042 AREXPORT void ArActionDesired::log(void) const
00043 {
00044   // all those maxes and movement parameters
00045   if (getMaxVelStrength() >= ArActionDesired::MIN_STRENGTH)
00046     ArLog::log(ArLog::Normal, "\tMaxTransVel %.0f", getMaxVel());
00047   if (getMaxNegVelStrength() >= ArActionDesired::MIN_STRENGTH)
00048     ArLog::log(ArLog::Normal, "\tMaxTransNegVel %.0f", 
00049            getMaxNegVel());
00050   if (getTransAccelStrength() >= ArActionDesired::MIN_STRENGTH)
00051     ArLog::log(ArLog::Normal, "\tTransAccel %.0f", getTransAccel());
00052   if (getTransDecelStrength() >= ArActionDesired::MIN_STRENGTH)
00053     ArLog::log(ArLog::Normal, "\tTransDecel %.0f", getTransDecel());
00054   if (getMaxRotVelStrength() >= ArActionDesired::MIN_STRENGTH)
00055     ArLog::log(ArLog::Normal, "%25s\tMaxRotVel %.0f", "",
00056            getMaxRotVel());
00057   if (getRotAccelStrength() >= ArActionDesired::MIN_STRENGTH)
00058     ArLog::log(ArLog::Normal, "%25s\tRotAccel %.0f", "",
00059            getRotAccel());
00060   if (getRotDecelStrength() >= ArActionDesired::MIN_STRENGTH)
00061     ArLog::log(ArLog::Normal, "%25s\tRotDecel %.0f", "",
00062            getRotDecel());
00063   
00064   // the actual movement part
00065   if (getVelStrength() >= ArActionDesired::MIN_STRENGTH)
00066     ArLog::log(ArLog::Normal, "\tVel %.0f", getVel());
00067   if (getHeadingStrength() >= ArActionDesired::MIN_STRENGTH)
00068     ArLog::log(ArLog::Normal, "%25s\tHeading %.0f", "", 
00069            getHeading());
00070   if (getDeltaHeadingStrength() >= ArActionDesired::MIN_STRENGTH)
00071     ArLog::log(ArLog::Normal, "%25s\tDeltaHeading %.0f", "", 
00072            getDeltaHeading());
00073   if (getRotVelStrength() >= ArActionDesired::MIN_STRENGTH)
00074     ArLog::log(ArLog::Normal, "%25s\tRotVel %.0f", "", 
00075            getRotVel());
00076 }
00077 
00078 
00079 AREXPORT bool ArActionDesired::isAnythingDesired(void) const
00080 {
00081   if (getMaxVelStrength() >= ArActionDesired::MIN_STRENGTH ||
00082       getMaxNegVelStrength() >= ArActionDesired::MIN_STRENGTH || 
00083       getTransAccelStrength() >= ArActionDesired::MIN_STRENGTH || 
00084       getTransDecelStrength() >= ArActionDesired::MIN_STRENGTH ||
00085       getMaxRotVelStrength() >= ArActionDesired::MIN_STRENGTH ||
00086       getRotAccelStrength() >= ArActionDesired::MIN_STRENGTH ||
00087       getRotDecelStrength() >= ArActionDesired::MIN_STRENGTH ||
00088       getVelStrength() >= ArActionDesired::MIN_STRENGTH ||
00089       getHeadingStrength() >= ArActionDesired::MIN_STRENGTH ||
00090       getDeltaHeadingStrength() >= ArActionDesired::MIN_STRENGTH ||
00091       getRotVelStrength() >= ArActionDesired::MIN_STRENGTH)
00092     return true;
00093   else
00094     return false;
00095 }

Generated on Tue Feb 20 10:51:38 2007 for Aria by  doxygen 1.4.0