Wheel.h
Go to the documentation of this file.
1 /*+-------------------------------------------------------------------------+
2  | MultiVehicle simulator (libmvsim) |
3  | |
4  | Copyright (C) 2014 Jose Luis Blanco Claraco (University of Almeria) |
5  | Copyright (C) 2017 Borys Tymchenko (Odessa Polytechnic University) |
6  | Distributed under GNU General Public License version 3 |
7  | See <http://www.gnu.org/licenses/> |
8  +-------------------------------------------------------------------------+ */
9 
10 #pragma once
11 
12 #include <mvsim/basic_types.h>
13 
14 #include <mrpt/poses/CPose2D.h>
15 #include <mrpt/version.h>
16 
17 #if MRPT_VERSION < 0x199
18 #include <mrpt/math/lightweight_geom_data.h>
19 #include <mrpt/utils/TColor.h>
20 using mrpt::utils::TColor;
21 #else
22 #include <mrpt/math/TPoint2D.h>
23 #include <mrpt/math/TPose3D.h>
24 #include <mrpt/math/TPolygon2D.h>
25 #include <mrpt/img/TColor.h>
26 using mrpt::img::TColor;
27 #endif
28 
29 namespace mvsim
30 {
31 class DefaultFriction;
32 class VehicleBase;
33 class DynamicsDifferential;
34 
38 class Wheel
39 {
40  public:
41  double x, y, yaw;
42  double diameter,
44  width;
45  double mass;
46  double Iyy;
47  TColor color;
49 
50  Wheel();
51  void getAs3DObject(mrpt::opengl::CSetOfObjects& obj);
52  void loadFromXML(const rapidxml::xml_node<char>* xml_node);
53 
54  double getPhi() const
55  {
56  return phi;
57  }
58  void setPhi(double val)
59  {
60  phi = val;
61  }
62  double getW() const { return w; }
63  void setW(double val) { w = val; }
64  void recalcInertia();
65  protected:
66  double phi, w;
67 };
69 } // namespace mvsim
void setW(double val)
Spinning velocity (rad/s) wrt shaft.
Definition: Wheel.h:63
double width
Length(diameter) and width of the wheel rectangle [m].
Definition: Wheel.h:43
void recalcInertia()
Recompute Iyy from mass, diameter and height.
Definition: Wheel.cpp:112
double w
Definition: Wheel.h:66
void loadFromXML(const rapidxml::xml_node< char > *xml_node)
Definition: Wheel.cpp:74
TColor color
constructor and at loadFromXML(), but can be overrided.
Definition: Wheel.h:48
void getAs3DObject(mrpt::opengl::CSetOfObjects &obj)
Definition: Wheel.cpp:50
double phi
Definition: Wheel.h:66
double x
Definition: Wheel.h:41
void setPhi(double val)
Orientation (rad) wrt vehicle local frame.
Definition: Wheel.h:58
double getW() const
Spinning velocity (rad/s) wrt shaft.
Definition: Wheel.h:62
double y
Definition: Wheel.h:41
double diameter
[m,rad] (in local coords)
Definition: Wheel.h:43
double yaw
Definition: Wheel.h:41
double getPhi() const
Orientation (rad) wrt vehicle local frame.
Definition: Wheel.h:54
double Iyy
Definition: Wheel.h:46
double mass
[kg]
Definition: Wheel.h:45


mvsim
Author(s):
autogenerated on Thu Jun 6 2019 19:36:40