State.cpp
Go to the documentation of this file.
00001 /*
00002  * A footstep planner for humanoid robots
00003  *
00004  * Copyright 2010-2011 Johannes Garimort, Armin Hornung, University of Freiburg
00005  * http://www.ros.org/wiki/footstep_planner
00006  *
00007  *
00008  * This program is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation, version 3.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00019  */
00020 
00021 #include <footstep_planner/State.h>
00022 
00023 
00024 namespace footstep_planner
00025 {
00026 State::State()
00027 : ivX(0.0), ivY(0.0), ivTheta(0.0), ivLeg(NOLEG)
00028 {}
00029 
00030 
00031 State::State(double x, double y, double theta, Leg leg)
00032 : ivX(x), ivY(y), ivTheta(theta), ivLeg(leg)
00033 {}
00034 
00035 
00036 State::~State()
00037 {}
00038 
00039 
00040 bool
00041 State::operator ==(const State& s2)
00042 const
00043 {
00044   return (fabs(ivX - s2.getX()) < FLOAT_CMP_THR &&
00045       fabs(ivY - s2.getY()) < FLOAT_CMP_THR &&
00046       fabs(angles::shortest_angular_distance(ivTheta, s2.getTheta()))
00047   < FLOAT_CMP_THR &&
00048   ivLeg == s2.getLeg());
00049 }
00050 
00051 
00052 bool
00053 State::operator !=(const State& s2)
00054 const
00055 {
00056   return not (*this == s2);
00057 }
00058 } // end of namespace


footstep_planner
Author(s): Johannes Garimort, Armin Hornung
autogenerated on Wed Aug 26 2015 11:54:32