jspace/jspace/State.hpp

Go to the documentation of this file.
00001 /*
00002  * Stanford Whole-Body Control Framework http://stanford-wbc.sourceforge.net/
00003  *
00004  * Copyright (C) 2010 The Board of Trustees of The Leland Stanford Junior University. All rights reserved.
00005  *
00006  * This program is free software: you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public License
00008  * as published by the Free Software Foundation, either version 3 of
00009  * the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful, but
00012  * WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this program.  If not, see
00018  * <http://www.gnu.org/licenses/>
00019  */
00020 
00026 #ifndef JSPACE_STATE_HPP
00027 #define JSPACE_STATE_HPP
00028 
00029 #include <jspace/wrap_eigen.hpp>
00030 
00031 namespace jspace {
00032   
00033   class State
00034   {
00035   public:
00036     typedef enum {
00037       COMPARE_ACQUISITION_TIME = 0x1,
00038       COMPARE_POSITION         = 0x2,
00039       COMPARE_VELOCITY         = 0x4,
00040       COMPARE_FORCE            = 0x8,
00041       COMPARE_ALL              = 0xf
00042     } compare_flags_t;
00043     
00044     State();
00045     State(State const & orig);
00046     State(size_t npos, size_t nvel, size_t nforce);
00047     
00052     void init(size_t npos, size_t nvel, size_t nforce);
00053     
00065     void resizeAndPadWithZeros(size_t npos, size_t nvel, size_t nforce);
00066     
00072     bool equal(State const & rhs,
00073          int flags = COMPARE_POSITION | COMPARE_VELOCITY,
00074          double precision = 1e-3) const;
00075     
00076     State & operator = (State const & rhs);
00077     
00078     size_t time_sec_;
00079     size_t time_usec_;
00080     Vector position_;
00081     Vector velocity_;
00082     Vector force_;
00083   };
00084   
00085 }
00086 
00087 #endif // JSPACE_STATE_HPP

Generated on Fri Aug 26 01:31:16 2011 for Stanford Whole-Body Control Framework by  doxygen 1.5.4