Wheel.h
Go to the documentation of this file.
1 /*+-------------------------------------------------------------------------+
2  | MultiVehicle simulator (libmvsim) |
3  | |
4  | Copyright (C) 2014-2020 Jose Luis Blanco Claraco |
5  | Copyright (C) 2017 Borys Tymchenko (Odessa Polytechnic University) |
6  | Distributed under 3-clause BSD License |
7  | See COPYING |
8  +-------------------------------------------------------------------------+ */
9 
10 #pragma once
11 
12 #include <mrpt/img/TColor.h>
13 #include <mrpt/math/TPoint2D.h>
14 #include <mrpt/math/TPolygon2D.h>
15 #include <mrpt/math/TPose3D.h>
16 #include <mrpt/poses/CPose2D.h>
18 #include <mvsim/basic_types.h>
19 
20 namespace mvsim
21 {
22 class DefaultFriction;
23 class VehicleBase;
24 class DynamicsDifferential;
25 
29 class Wheel
30 {
31  public:
32  Wheel();
33 
36  double x = 0, y = -0.5, yaw = 0;
37 
39  double diameter = .4, width = .2;
40  double mass = 2.0;
41 
44  double Iyy = 1.0;
45 
47  mrpt::img::TColor color{0xff323232};
48 
50  {"mass", {"%lf", &mass}},
51  {"width", {"%lf", &width}},
52  {"diameter", {"%lf", &diameter}},
53  {"color", {"%color", &color}},
54  {"inertia", {"%lf", &Iyy}}};
55 
56  // methods ----
57 
59  void loadFromXML(const rapidxml::xml_node<char>* xml_node);
60 
61  double getPhi() const
62  {
63  return phi;
64  }
65  void setPhi(double val)
66  {
67  phi = val;
68  }
69  double getW() const { return w; }
70  void setW(double val) { w = val; }
71  void recalcInertia();
72  protected:
75  double phi = 0, w = 0;
76 };
77 } // namespace mvsim
GLint GLint GLint GLint GLint GLint y
void setW(double val)
Spinning velocity (rad/s) wrt shaft.
Definition: Wheel.h:70
std::map< std::string, TParamEntry > TParameterDefinitions
void recalcInertia()
Recompute Iyy from mass, diameter and height.
Definition: Wheel.cpp:79
GLubyte GLubyte GLubyte GLubyte w
double w
Definition: Wheel.h:75
void loadFromXML(const rapidxml::xml_node< char > *xml_node)
Definition: Wheel.cpp:48
void getAs3DObject(mrpt::opengl::CSetOfObjects &obj)
Definition: Wheel.cpp:25
const TParameterDefinitions m_params
Definition: Wheel.h:49
double phi
Definition: Wheel.h:75
void setPhi(double val)
Orientation (rad) wrt vehicle local frame.
Definition: Wheel.h:65
double getW() const
Spinning velocity (rad/s) wrt shaft.
Definition: Wheel.h:69
GLint GLint GLint GLint GLint x
GLhandleARB obj
double diameter
Definition: Wheel.h:39
GLuint color
double yaw
Definition: Wheel.h:36
double getPhi() const
Orientation (rad) wrt vehicle local frame.
Definition: Wheel.h:61
double Iyy
Definition: Wheel.h:44
double mass
[kg]
Definition: Wheel.h:40
GLuint GLfloat * val
GLint GLint GLint GLint GLint GLint GLsizei width


mvsim
Author(s):
autogenerated on Fri May 7 2021 03:05:51