simulator-sdk  1.14
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
alnaosim.h
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 
21 namespace Sim
22 {
23 
24  class AngleActuator;
25  class AngleSensor;
26  class AngleSpeedActuator;
27  class AngleSpeedSensor;
28  class BumperSensor;
29  class TactileSensor;
30  class CameraSensor;
31  class CoupledActuator;
32  class CoupledSensor;
33  class DepthInfraredSensor;
34  class FSRSensor;
35  class InertialSensor;
36  class SonarSensor;
37  class Model;
38  class TorqueActuator;
39  class TorqueSensor;
40  class WheelTorqueActuator;
41  class WheelVelocityActuator;
42  class WheelVelocitySensor;
43  class LEDActuator;
44 
54 class ALNAOSIM_API HALInterface
55 {
56  public:
58  HALInterface(const Model* model, int NAOqiId = 9559);
60  ~HALInterface();
61 
67  float fetchAngleActuatorValue(const AngleActuator* angleActuator);
73  float fetchCoupledActuatorValue(const CoupledActuator* coupledActuator);
79  float fetchTorqueActuatorValue(const TorqueActuator* torqueActuator);
85  float fetchAngleSpeedActuatorValue(
86  const AngleSpeedActuator* angleSpeedActuator);
92  float fetchWheelTorqueActuatorValue(
93  const WheelTorqueActuator* wheelTorqueActuator);
99  float fetchWheelVelocityActuatorValue(
100  const WheelVelocityActuator* wheelVelocityActuator);
105  float fetchLEDActuatorValue(const LEDActuator* ledActuator);
106 
112  float fetchAngleActuatorStiffness(const AngleActuator* angleActuator);
118  float fetchCoupledActuatorStiffness(const CoupledActuator* coupledActuator);
124  float fetchTorqueActuatorStiffness(const TorqueActuator* torqueActuator);
130  float fetchAngleSpeedActuatorStiffness(
131  const AngleSpeedActuator* angleSpeedActuator);
137  float fetchWheelTorqueActuatorStiffness(
138  const WheelTorqueActuator* wheelTorqueActuator);
144  float fetchWheelVelocityActuatorStiffness(
145  const WheelVelocityActuator* wheelVelocityActuator);
146 
148  bool sendAngleSensorValue(
149  const AngleSensor* angleSensor, float value);
152  bool sendCoupledSensorValue(
153  const CoupledSensor* coupledSensor, float value);
155  bool sendTorqueSensorValue(
156  const TorqueSensor* torqueSensor, float value);
158  bool sendAngleSpeedSensorValue(
159  const AngleSpeedSensor* angleSpeedSensor, float value);
162  bool sendWheelVelocitySensorValue(
163  const WheelVelocitySensor* wheelVelocitySensor, float value);
164 
168  bool sendCameraSensorValue(
169  const CameraSensor* cameraSensor, const unsigned char* img);
171  bool sendFSRSensorValue(
172  const FSRSensor* fsrSensor, float value);
174  bool sendBumperSensorValue(
175  const BumperSensor* bumperSensor, float value);
178  bool sendTactileSensorValue(
179  const TactileSensor* tactileSensor, float value);
182  bool sendDepthInfraredSensorValue(
183  const DepthInfraredSensor* depthInfraredSensor, float value);
184 
185 
188  bool sendInertialSensorValues(
189  const InertialSensor* inertialSensor, std::vector<const float*> values);
192  bool sendSonarSensorValues(
193  const SonarSensor* sonarSensor, std::vector<const float*> values);
201  bool sendInertialSensorValues(
202  const InertialSensor* inertialSensor, std::vector<float> values);
214  bool sendSonarSensorValues(
215  const SonarSensor* sonarSensor, std::vector<float> values);
219  bool sendSonarSensorValue(const SonarSensor* sonarSensor, float value);
220 
223  std::string activeCamera();
229  int cameraBufferSize();
233  void cameraBufferSize(
234  const CameraSensor* camera,
235  int* cameraBufferSize,
236  int* width,
237  int* height);
242  int cameraBufferSize(const CameraSensor* camera);
244  class HALInterfaceImpl* a_impl;
245 };
246 
247 }
248 #endif // ALNAOSIM_H