simulator-sdk  2.4.3.28-r2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
alnaosim.h
Go to the documentation of this file.
1 
6 #ifndef ALNAOSIM_H
7 #define ALNAOSIM_H
8 #include <qi/macro.hpp>
9 
10 #ifdef alnaosim_EXPORTS
11 # define ALNAOSIM_API QI_EXPORT_API
12 #elif defined(alnaosim_IMPORTS)
13 # define ALNAOSIM_API QI_IMPORT_API
14 #else
15 # define ALNAOSIM_API
16 #endif
17 
18 #include <string>
19 #include <vector>
20 #include "alnaosim_camera_definitions.h"
21 
22 namespace Sim
23 {
24 
25  class AngleActuator;
26  class AngleSensor;
27  class AngleSpeedActuator;
28  class AngleSpeedSensor;
29  class ArrayDepthSensor;
30  class BaseCamera;
31  class BumperSensor;
32  class TactileSensor;
33  class CameraDepthSensor;
34  class CameraSensor;
35  class CameraDepthSensor;
36  class CoupledActuator;
37  class CoupledSensor;
38  class FSRSensor;
39  class InertialSensor;
40  class SonarSensor;
41  class Model;
42  class TorqueActuator;
43  class TorqueSensor;
44  class WheelTorqueActuator;
45  class WheelVelocityActuator;
46  class WheelVelocitySensor;
47  class LEDActuator;
48  class SingleDepthSensor;
49 
50  typedef SingleDepthSensor DepthInfraredSensor;
51 
62 {
63  public:
65  HALInterface(const Model* model, int NAOqiId = 9559);
67  ~HALInterface();
68 
74  float fetchAngleActuatorValue(const AngleActuator* angleActuator);
80  float fetchCoupledActuatorValue(const CoupledActuator* coupledActuator);
86  float fetchTorqueActuatorValue(const TorqueActuator* torqueActuator);
92  float fetchAngleSpeedActuatorValue(
93  const AngleSpeedActuator* angleSpeedActuator);
99  float fetchWheelTorqueActuatorValue(
100  const WheelTorqueActuator* wheelTorqueActuator);
106  float fetchWheelVelocityActuatorValue(
107  const WheelVelocityActuator* wheelVelocityActuator);
112  float fetchLEDActuatorValue(const LEDActuator* ledActuator);
113 
119  float fetchAngleActuatorStiffness(const AngleActuator* angleActuator);
125  float fetchCoupledActuatorStiffness(const CoupledActuator* coupledActuator);
131  float fetchTorqueActuatorStiffness(const TorqueActuator* torqueActuator);
137  float fetchAngleSpeedActuatorStiffness(
138  const AngleSpeedActuator* angleSpeedActuator);
144  float fetchWheelTorqueActuatorStiffness(
145  const WheelTorqueActuator* wheelTorqueActuator);
151  float fetchWheelVelocityActuatorStiffness(
152  const WheelVelocityActuator* wheelVelocityActuator);
153 
155  bool sendAngleSensorValue(
156  const AngleSensor* angleSensor, float value);
159  bool sendCoupledSensorValue(
160  const CoupledSensor* coupledSensor, float value);
162  bool sendTorqueSensorValue(
163  const TorqueSensor* torqueSensor, float value);
165  bool sendAngleSpeedSensorValue(
166  const AngleSpeedSensor* angleSpeedSensor, float value);
169  bool sendWheelVelocitySensorValue(
170  const WheelVelocitySensor* wheelVelocitySensor, float value);
171 
177  bool sendCameraSensorValue(
178  const CameraSensor* cameraSensor, const unsigned char* img);
182  bool sendCameraSensorValue(
183  const CameraSensor* cameraSensor,
184  const unsigned char* img,
185  CameraResolution camResolution,
186  CameraColorSpace camColorSpace);
187 
195  bool sendCameraDepthSensorValue(
196  const CameraDepthSensor* cameraDepthSensor,
197  const float* buffer);
202  bool sendCameraDepthSensorValue(
203  const CameraDepthSensor* cameraDepthSensor,
204  const float* buffer,
205  CameraResolution camResolution,
206  CameraColorSpace camColorSpace);
207 
209  bool sendFSRSensorValue(
210  const FSRSensor* fsrSensor, float value);
212  bool sendBumperSensorValue(
213  const BumperSensor* bumperSensor, float value);
216  bool sendTactileSensorValue(
217  const TactileSensor* tactileSensor, float value);
221  bool sendDepthInfraredSensorValue(
222  const DepthInfraredSensor* depthInfraredSensor, float value);
225  bool sendSingleDepthSensorValue(
226  const SingleDepthSensor* singleDepthSensor, float value);
227 
235  bool sendInertialSensorValues(
236  const InertialSensor* inertialSensor, const std::vector<float>& values);
248  bool sendSonarSensorValues(
249  const SonarSensor* sonarSensor, const std::vector<float>& values);
253  bool sendSonarSensorValue(const SonarSensor* sonarSensor, float value);
254 
256  bool sendArrayDepthSensorValues(
257  const ArrayDepthSensor* arrayDepthSensor,
258  const std::vector<float>& values);
259 
262  void cameraBufferSize(
263  const CameraSensor* camera,
264  int* cameraBufferSize,
265  int* width,
266  int* height);
273  int cameraBufferSize(const CameraSensor* camera);
274 
278  void cameraDepthBufferSize(
279  const CameraDepthSensor* camera,
280  int* cameraBufferSize,
281  int* width,
282  int* height);
283 
285  CameraResolution cameraResolution(const BaseCamera* camera) const;
287  CameraColorSpace cameraColorSpace(const BaseCamera* camera) const;
288 
290  class HALInterfaceImpl* a_impl;
291 };
292 
293 
295 void ALNAOSIM_API cameraResolution(CameraResolution camRes, int* width, int* height);
296 
297 }
298 #endif // ALNAOSIM_H
class HALInterfaceImpl * a_impl
Private implementation.
Definition: alnaosim.h:290
#define ALNAOSIM_API
Definition: alnaosim.h:15
HALInterface is responsible for reading and writing values into the Hardware Abstraction Layer (HAL) ...
Definition: alnaosim.h:61
SingleDepthSensor DepthInfraredSensor