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 #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
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
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 }