Helios++
Helios software for LiDAR simulations
PyPlatformWrapper.h
1 #pragma once
2 
3 #ifdef PYTHON_BINDING
4 
5 #include <PyNoiseSourceWrapper.h>
6 
13 public:
14  // *** ATTRIBUTES *** //
15  // ******************** //
16  Platform &platform;
17 
18  // *** CONSTRUCTION / DESTRUCTION *** //
19  // ************************************ //
20  PyPlatformWrapper(Platform &platform) : platform(platform) {}
21 
22  virtual ~PyPlatformWrapper() = default;
23 
24  // *** GETTERS and SETTERS *** //
25  // ***************************** //
26  double getLastCheckZ() { return platform.lastCheckZ; }
27 
28  void setLastCheckZ(double checkZ) { platform.lastCheckZ = checkZ; }
29 
30  double getDmax() { return platform.dmax; }
31 
32  void setDmax(double dmax) { platform.dmax = dmax; }
33 
34  double getMovePerSec() { return platform.cfg_settings_movePerSec_m; }
35 
36  void setMovePerSec(double movePerSec) { platform.cfg_settings_movePerSec_m = movePerSec; }
37 
38  bool isOnGround() { return platform.onGround; }
39 
40  void setOnGround(bool onGround) { platform.onGround = onGround; }
41 
42  bool isStopAndTurn() { return platform.stopAndTurn; }
43 
44  void setStopAndTurn(bool stopAndTurn) { platform.stopAndTurn = stopAndTurn; }
45 
46  bool isSlowdownEnabled() { return platform.slowdownEnabled; }
47 
48  void setSlowdownEnabled(bool slowdownEnabled) { platform.slowdownEnabled = slowdownEnabled; }
49 
50  //double getYawAtDeparture() { return platform.yawAtDeparture; }
51 
52  //void setYawAtDeparture(double yawAtDeparture) { platform.yawAtDeparture = yawAtDeparture; }
53 
54  bool isSmoothTurn() { return platform.smoothTurn; }
55 
56  void setSmoothTurn(bool smoothTurn) { platform.smoothTurn = smoothTurn; }
57 
58  bool isOrientationOnLegInit() { return platform.mSetOrientationOnLegInit; }
59 
60  void setOrientationOnLegInit(bool setOrientationOnLegInit) { platform.mSetOrientationOnLegInit = setOrientationOnLegInit; }
61 
62  PyNoiseSourceWrapper *getPositionXNoiseSource() {
63  if (platform.positionXNoiseSource == nullptr) return nullptr;
64  return new PyNoiseSourceWrapper(*platform.positionXNoiseSource);
65  }
66 
67  PyNoiseSourceWrapper *getPositionYNoiseSource() {
68  if (platform.positionYNoiseSource == nullptr) return nullptr;
69  return new PyNoiseSourceWrapper(*platform.positionYNoiseSource);
70  }
71 
72  PyNoiseSourceWrapper *getPositionZNoiseSource() {
73  if (platform.positionZNoiseSource == nullptr) return nullptr;
74  return new PyNoiseSourceWrapper(*platform.positionZNoiseSource);
75  }
76 
77  PyNoiseSourceWrapper *getAttitudeXNoiseSource(){
78  if(platform.attitudeXNoiseSource == nullptr) return nullptr;
79  return new PyNoiseSourceWrapper(*platform.attitudeXNoiseSource);
80  }
81 
82  PyNoiseSourceWrapper *getAttitudeYNoiseSource(){
83  if(platform.attitudeYNoiseSource == nullptr) return nullptr;
84  return new PyNoiseSourceWrapper(*platform.attitudeYNoiseSource);
85  }
86 
87  PyNoiseSourceWrapper *getAttitudeZNoiseSource(){
88  if(platform.attitudeZNoiseSource == nullptr) return nullptr;
89  return new PyNoiseSourceWrapper(*platform.attitudeZNoiseSource);
90  }
91 
92  PythonDVec3 * getRelativePosition()
93  {return new PythonDVec3(&platform.cfg_device_relativeMountPosition);}
94  Rotation & getRelativeAttitude()
95  {return platform.cfg_device_relativeMountAttitude;}
96  PythonDVec3 * getLastGroundCheck()
97  {return new PythonDVec3(&platform.lastGroundCheck);}
98  PythonDVec3 * getNextWaypointPosition()
99  {return new PythonDVec3(&platform.targetWaypoint);}
100  PythonDVec3 * getPositionPython()
101  {return new PythonDVec3(&platform.position);}
102  Rotation & getAttitudePython()
103  {return platform.attitude;}
104  PythonDVec3 * getCachedAbsolutePosition()
105  {return new PythonDVec3(&platform.cached_absoluteMountPosition);}
106  Rotation & getCachedAbsoluteAttitude()
107  {return platform.cached_absoluteMountAttitude;}
108  PythonDVec3 * getCachedCurrentDir()
109  {return new PythonDVec3(&platform.cached_dir_current);}
110  PythonDVec3 * getCachedCurrentDirXY()
111  {return new PythonDVec3(&platform.cached_dir_current_xy);}
112  PythonDVec3 * getCachedVectorToTarget()
113  {return new PythonDVec3(&platform.cached_vectorToTarget);}
114  PythonDVec3 * getCachedVectorToTargetXY()
115  {return new PythonDVec3(&platform.cached_vectorToTarget_xy);}
116 };
117 
118 #endif
std::shared_ptr< NoiseSource< double > > positionZNoiseSource
Noise source for z component of platform position.
Definition: Platform.h:61
glm::dvec3 targetWaypoint
Target waypoint (destination)
Definition: Platform.h:98
bool smoothTurn
Flag to specify if platform must work in smooth turn mode (true) or not (false). Not all platforms su...
Definition: Platform.h:121
Class representing a platform asset.
Definition: Platform.h:21
glm::dvec3 cached_vectorToTarget_xy
Distance vector from current position to target over XY plane (z is always 0)
Definition: Platform.h:178
Definition: Rotation.h:80
glm::dvec3 position
Platform 3D position.
Definition: Platform.h:133
std::shared_ptr< NoiseSource< double > > attitudeXNoiseSource
Noise source for x component of platform attitude.
Definition: Platform.h:65
glm::dvec3 cached_dir_current
Current director vector over XY plane.
Definition: Platform.h:164
double lastCheckZ
Not used at the moment. Might be removed in the future.
Definition: Platform.h:39
std::shared_ptr< NoiseSource< double > > positionXNoiseSource
Noise source for x component of platform position.
Definition: Platform.h:53
double dmax
Not used at the moment. Might be removed in the future.
Definition: Platform.h:79
bool stopAndTurn
Flag to specify if platform must work in stop and turn mode (true) or not (false). Not all platforms support this mode, so it will only be used when possible.
Definition: Platform.h:115
Rotation cached_absoluteMountAttitude
Cached absolute mount attitude.
Definition: Platform.h:159
std::shared_ptr< NoiseSource< double > > positionYNoiseSource
Noise source for y component of platform position.
Definition: Platform.h:57
bool mSetOrientationOnLegInit
Not used at the moment. Might be removed in the future.
Definition: Platform.h:142
Wrapper for NoiseSource abstract class.
Definition: PyNoiseSourceWrapper.h:14
glm::dvec3 cfg_device_relativeMountPosition
Device mount position relative to the platform.
Definition: Platform.h:29
glm::dvec3 cached_vectorToTarget
Distance vector from current position to target.
Definition: Platform.h:173
Rotation cfg_device_relativeMountAttitude
Device mount attitude relative to the platform.
Definition: Platform.h:33
glm::dvec3 lastGroundCheck
Not used at the moment. Might be removed in the future.
Definition: Platform.h:43
bool onGround
Flag to specify if the platform must be placed on ground (true) or not (false)
Definition: Platform.h:109
Rotation attitude
Platform 3D attitude.
Definition: Platform.h:137
bool slowdownEnabled
Flag to specify if slowdown stage must be enabled (true) or not (false). Not all platforms have a slo...
Definition: Platform.h:127
glm::dvec3 cached_dir_current_xy
Current director vector over XY plane (z is always 0)
Definition: Platform.h:168
double cfg_settings_movePerSec_m
How meters per seconds the platform moves. NOTICE this behavior must be overridden by platforms imple...
Definition: Platform.h:90
std::shared_ptr< NoiseSource< double > > attitudeYNoiseSource
Noise source for y component of platform attitude.
Definition: Platform.h:69
glm::dvec3 cached_absoluteMountPosition
Cached absolute mount position.
Definition: Platform.h:155
Wrapper to communicate glm::dvec3 with python.
Definition: PythonDVec3.h:14
std::shared_ptr< NoiseSource< double > > attitudeZNoiseSource
Noise source for z component of platform attitude.
Definition: Platform.h:73
Wrapper for Platform class.
Definition: PyPlatformWrapper.h:12