Helios++
Helios software for LiDAR simulations
SimplePhysicsPlatform.h
1 #pragma once
2 
3 #include "MovingPlatform.h"
4 
9 protected:
10  // *** ATTRIBUTES *** //
11  // ******************** //
15  glm::dvec3 mEngineForce = glm::dvec3(0, 0, 0);
19  glm::dvec3 mCfg_g_accel = glm::dvec3(0, 0, -9.81);
28  bool engineLimitReached = false;
33  bool userSpeedLimitReached = false;
34 public:
38  double mCfg_drag = 1;
39 
40  // *** CONSTRUCTION / DESTRUCTION *** //
41  // ************************************ //
45  SimplePhysicsPlatform() = default;
46  std::shared_ptr<Platform> clone() override;
47  void _clone(std::shared_ptr<Platform> p) override;
48 
49  // *** M E T H O D S *** //
50  // *********************** //
54  void prepareSimulation(int simFrequency_hz) override;
58  void prepareLeg(int const simFrequency_hz) override;
63  void doPhysicsStep(int simFrequency_hz);
67  void doSimStep(int simFrequency_hz) override;
72  virtual void doControlStep(int simFrequency_hz);
85  void configureStepMagnitude(int const simFrequency_hz);
86 
87  void checkSpeedLimit();
88 
89 };
Class representing a moving platform.
Definition: MovingPlatform.h:8
Class representing a simple phyiscs platform.
Definition: SimplePhysicsPlatform.h:8
double movePerSec_m_stepMagnitude
How many meter does the platform move in each simulation step.
Definition: SimplePhysicsPlatform.h:23
virtual void doControlStep(int simFrequency_hz)
Control step for simple phyisics platform simulation.
Definition: SimplePhysicsPlatform.cpp:87
void configureStepMagnitude(int const simFrequency_hz)
Configure the step magnitude for current moverPerSec and given simulation frequency.
Definition: SimplePhysicsPlatform.cpp:89
glm::dvec3 mCfg_g_accel
Gravity acceleration vector.
Definition: SimplePhysicsPlatform.h:19
void doPhysicsStep(int simFrequency_hz)
Phyisics step for simple phyisics platform simulation.
Definition: SimplePhysicsPlatform.cpp:51
void doSimStep(int simFrequency_hz) override
Definition: SimplePhysicsPlatform.cpp:81
bool engineLimitReached
Flag to store if the engine max thrust was reached in a given leg. The value is reset en each leg.
Definition: SimplePhysicsPlatform.h:28
void prepareSimulation(int simFrequency_hz) override
Definition: SimplePhysicsPlatform.cpp:20
bool userSpeedLimitReached
Flag to store if the user-provided movePerSec_m speed was achieved for a given leg.
Definition: SimplePhysicsPlatform.h:33
glm::dvec3 mEngineForce
Engine force vector.
Definition: SimplePhysicsPlatform.h:15
SimplePhysicsPlatform()=default
Simple physics platform default constructor.
double mCfg_drag
Drag magnitude.
Definition: SimplePhysicsPlatform.h:38
void prepareLeg(int const simFrequency_hz) override
Definition: SimplePhysicsPlatform.cpp:24