simulator-sdk  2.0.6.8
/home/opennao/work/master/simulation/simulator-sdk/alnaosim/alnaosim/alnaosim.h
00001 
00006 #ifndef ALNAOSIM_H
00007 #define ALNAOSIM_H
00008 #include <qi/macro.hpp>
00009 
00010 #ifdef alnaosim_EXPORTS
00011 # define ALNAOSIM_API QI_EXPORT_API
00012 #elif defined(alnaosim_IMPORTS)
00013 # define ALNAOSIM_API QI_IMPORT_API
00014 #else
00015 # define ALNAOSIM_API
00016 #endif
00017 
00018 #include <string>
00019 #include <vector>
00020 #include "alnaosim_camera_definitions.h"
00021 
00022 namespace Sim
00023 {
00024 
00025   class AngleActuator;
00026   class AngleSensor;
00027   class AngleSpeedActuator;
00028   class AngleSpeedSensor;
00029   class ArrayDepthSensor;
00030   class BaseCamera;
00031   class BumperSensor;
00032   class TactileSensor;
00033   class CameraDepthSensor;
00034   class CameraSensor;
00035   class CameraDepthSensor;
00036   class CoupledActuator;
00037   class CoupledSensor;
00038   class FSRSensor;
00039   class InertialSensor;
00040   class SonarSensor;
00041   class Model;
00042   class TorqueActuator;
00043   class TorqueSensor;
00044   class WheelTorqueActuator;
00045   class WheelVelocityActuator;
00046   class WheelVelocitySensor;
00047   class LEDActuator;
00048   class SingleDepthSensor;
00049 
00050   typedef SingleDepthSensor DepthInfraredSensor;
00051 
00061 class ALNAOSIM_API HALInterface
00062 {
00063   public:
00065     HALInterface(const Model* model, int NAOqiId = 9559);
00067     ~HALInterface();
00068 
00074     float fetchAngleActuatorValue(const AngleActuator* angleActuator);
00080     float fetchCoupledActuatorValue(const CoupledActuator* coupledActuator);
00086     float fetchTorqueActuatorValue(const TorqueActuator* torqueActuator);
00092     float fetchAngleSpeedActuatorValue(
00093       const AngleSpeedActuator* angleSpeedActuator);
00099     float fetchWheelTorqueActuatorValue(
00100       const WheelTorqueActuator* wheelTorqueActuator);
00106     float fetchWheelVelocityActuatorValue(
00107       const WheelVelocityActuator* wheelVelocityActuator);
00112     float fetchLEDActuatorValue(const LEDActuator* ledActuator);
00113 
00119     float fetchAngleActuatorStiffness(const AngleActuator* angleActuator);
00125     float fetchCoupledActuatorStiffness(const CoupledActuator* coupledActuator);
00131     float fetchTorqueActuatorStiffness(const TorqueActuator* torqueActuator);
00137     float fetchAngleSpeedActuatorStiffness(
00138       const AngleSpeedActuator* angleSpeedActuator);
00144     float fetchWheelTorqueActuatorStiffness(
00145       const WheelTorqueActuator* wheelTorqueActuator);
00151     float fetchWheelVelocityActuatorStiffness(
00152       const WheelVelocityActuator* wheelVelocityActuator);
00153 
00155     bool sendAngleSensorValue(
00156       const AngleSensor* angleSensor, float value);
00159     bool sendCoupledSensorValue(
00160       const CoupledSensor* coupledSensor, float value);
00162     bool sendTorqueSensorValue(
00163       const TorqueSensor* torqueSensor, float value);
00165     bool sendAngleSpeedSensorValue(
00166       const AngleSpeedSensor* angleSpeedSensor, float value);
00169     bool sendWheelVelocitySensorValue(
00170       const WheelVelocitySensor* wheelVelocitySensor, float value);
00171 
00177     bool sendCameraSensorValue(
00178       const CameraSensor* cameraSensor, const unsigned char* img);
00182     bool sendCameraSensorValue(
00183       const CameraSensor* cameraSensor,
00184       const unsigned char* img,
00185       CameraResolution camResolution,
00186       CameraColorSpace camColorSpace);
00187 
00195     bool sendCameraDepthSensorValue(
00196       const CameraDepthSensor* cameraDepthSensor,
00197       const float* buffer);
00202     bool sendCameraDepthSensorValue(
00203       const CameraDepthSensor* cameraDepthSensor,
00204       const float* buffer,
00205       CameraResolution camResolution,
00206       CameraColorSpace camColorSpace);
00207 
00209     bool sendFSRSensorValue(
00210       const FSRSensor* fsrSensor, float value);
00212     bool sendBumperSensorValue(
00213       const BumperSensor* bumperSensor, float value);
00216     bool sendTactileSensorValue(
00217       const TactileSensor* tactileSensor, float value);
00221     bool sendDepthInfraredSensorValue(
00222       const DepthInfraredSensor* depthInfraredSensor, float value);
00225     bool sendSingleDepthSensorValue(
00226       const SingleDepthSensor* singleDepthSensor, float value);
00227 
00235     bool sendInertialSensorValues(
00236       const InertialSensor* inertialSensor, const std::vector<float>& values);
00248     bool sendSonarSensorValues(
00249       const SonarSensor* sonarSensor, const std::vector<float>& values);
00253     bool sendSonarSensorValue(const SonarSensor* sonarSensor, float value);
00254 
00256     bool sendArrayDepthSensorValues(
00257       const ArrayDepthSensor* arrayDepthSensor,
00258       const std::vector<float>& values);
00259 
00262     void cameraBufferSize(
00263       const CameraSensor* camera,
00264       int* cameraBufferSize,
00265       int* width,
00266       int* height);
00273     int cameraBufferSize(const CameraSensor* camera);
00274 
00278     void cameraDepthBufferSize(
00279       const CameraDepthSensor* camera,
00280       int* cameraBufferSize,
00281       int* width,
00282       int* height);
00283 
00285     CameraResolution cameraResolution(const BaseCamera* camera) const;
00287     CameraColorSpace cameraColorSpace(const BaseCamera* camera) const;
00288 
00290     class HALInterfaceImpl* a_impl;
00291 };
00292 
00293 
00295 void ALNAOSIM_API cameraResolution(CameraResolution camRes, int* width, int* height);
00296 
00297 }
00298 #endif // ALNAOSIM_H
 All Classes Namespaces Functions Variables Enumerations