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