59 steer() = steering, revol() = revolute;
95 int main(
int argc,
char **argv)
97 std::cout <<
"iws utils test" << std::endl;
99 tuw_i2ws_wheel_state->resize(2);
100 tuw_i2ws_wheel_state->wheel(0).steer() = 10;
101 tuw_i2ws_wheel_state->wheel(0).revol() = 11;
102 tuw_i2ws_wheel_state->wheel(1).steer() = 12;
103 tuw_i2ws_wheel_state->wheel(1).revol() = 13;
105 std::cout <<
"tuw : " << *tuw_i2ws_wheel_state << std::endl;
108 std::vector<double> values;
109 tuw_i2ws_wheel_state->toSTLVec(values);
112 std::cout <<
"tuw : [" << *tuw_i2ws_wheel_state->state(0) <<
", " << *tuw_i2ws_wheel_state->state(1) <<
"]" 116 std::cout <<
"tuw tuw_i2ws_wheel_state->stateScoped ( 1 )->value<StateWheel::Steer>() = " 117 << tuw_i2ws_wheel_state->stateScoped(1)->value<
StateWheel::Steer>() << std::endl;
120 std::cout <<
"tuw ( *tuw_i2ws_wheel_state ) [1].steer() = " << (*tuw_i2ws_wheel_state)[1].steer()
123 std::cout <<
"tuw tuw_i2ws_wheel_state->wheel ( 1 ).steer() = " << tuw_i2ws_wheel_state->wheel(1).steer()
141 std::cout << std::endl;
142 std::cout << xx.block(2, 0, 2, 1) << std::endl
145 Eigen::VectorXd yy(3);
151 auto _blockRef = xx.block(2, 0, 2, 1);
156 std::cout << _blockRef << std::endl
158 std::cout << xx << std::endl
161 typedef Eigen::Map<Eigen::VectorXd> MapType;
163 MapType xMap0(&xx(0), xx.rows());
164 MapType xMap2(&xx(2), xx.rows() - 3);
165 MapType xMap4(&xx(4), xx.rows() - 4);
167 std::cout <<
"xx=" << std::endl
170 std::cout <<
"xMap0=" << std::endl
171 << xMap0 << std::endl
173 std::cout <<
"xMap2=" << std::endl
174 << xMap2 << std::endl
176 std::cout <<
"xMap4=" << std::endl
177 << xMap4 << std::endl
180 xx.conservativeResize(8);
183 new (&xMap2) MapType(&xx(2), xMap2.outerStride() + 3);
184 new (&xMap4) MapType(&xMap2(2), xMap4.outerStride());
190 std::cout <<
"xx=" << std::endl
193 std::cout <<
"xMap0=" << std::endl
194 << xMap0 << std::endl
196 std::cout <<
"xMap2=" << std::endl
197 << xMap2 << std::endl
199 std::cout <<
"xMap4=" << std::endl
200 << xMap4 << std::endl
OneWheelType & wheel(size_t i)
const double & revol() const
const OneWheelType & wheel(size_t i) const
std::shared_ptr< StateWhInpType > StateWhInpPtrType
OneWheelType(double steering, double revolute)
Extension of StateArray providing value access based on a scoped enumeration (compile-time).
StateWheel
Enum defining the semantics of the Iws wheel state.
const double & steer() const
int main(int argc, char **argv)
OneWheelType with access via varialbe and enums.