SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
State.hpp
Go to the documentation of this file.
1 /*
2  * Stanford Whole-Body Control Framework http://stanford-scl.sourceforge.net/
3  *
4  * Copyright (c) 2010 Stanford University. All rights reserved.
5  *
6  * This program is free software: you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public License
8  * as published by the Free Software Foundation, either version 3 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this program. If not, see
18  * <http://www.gnu.org/licenses/>
19  */
20 
26 #ifndef JSPACE_STATE_HPP
27 #define JSPACE_STATE_HPP
28 
30 
31 namespace jspace {
32 
33  class State
34  {
35  public:
36  typedef enum {
37  COMPARE_ACQUISITION_TIME = 0x1,
38  COMPARE_POSITION = 0x2,
39  COMPARE_VELOCITY = 0x4,
40  COMPARE_FORCE = 0x8,
41  COMPARE_ALL = 0xf
42  } compare_flags_t;
43 
44  State();
45  State(State const & orig);
46  State(size_t npos, size_t nvel, size_t nforce);
47 
52  void init(size_t npos, size_t nvel, size_t nforce);
53 
65  void resizeAndPadWithZeros(size_t npos, size_t nvel, size_t nforce);
66 
67  bool equal(State const & rhs,
68  int flags = COMPARE_POSITION | COMPARE_VELOCITY,
69  double precision = 1e-3) const;
70 
71  State & operator = (State const & rhs);
72 
73  size_t time_sec_;
74  size_t time_usec_;
75  Eigen::VectorXd position_;
76  Eigen::VectorXd velocity_;
77  Eigen::VectorXd force_;
78  };
79 
80 }
81 
82 #endif // JSPACE_STATE_HPP
Definition: State.hpp:33
void resizeAndPadWithZeros(size_t npos, size_t nvel, size_t nforce)
Definition: State.cpp:95
void init(size_t npos, size_t nvel, size_t nforce)
Definition: State.cpp:56