Choreonoid  1.8
BasicSensorSimulationHelper.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_BODY_BASIC_SENSOR_SIMULATION_HELPER_H
7 #define CNOID_BODY_BASIC_SENSOR_SIMULATION_HELPER_H
8 
9 #include "DeviceList.h"
10 #include "ForceSensor.h"
11 #include "RateGyroSensor.h"
12 #include "AccelerationSensor.h"
13 #include "exportdecl.h"
14 
15 namespace cnoid {
16 
17 class Body;
18 
19 class CNOID_EXPORT BasicSensorSimulationHelper
20 {
21 public:
24 
25  void setOldAccelSensorCalcMode(bool on);
26 
27  void initialize(Body* body, double timeStep, const Vector3& gravityAcceleration);
28 
29  bool isActive() const { return isActive_; }
30  bool hasGyroOrAccelerationSensors() const { return !rateGyroSensors_.empty() || !accelerationSensors_.empty(); }
31 
32  const DeviceList<ForceSensor>& forceSensors() const { return forceSensors_; }
33  const DeviceList<RateGyroSensor>& rateGyroSensors() const { return rateGyroSensors_; }
34  const DeviceList<AccelerationSensor>& accelerationSensors() const { return accelerationSensors_; }
35 
36  void updateGyroAndAccelerationSensors();
37 
38 private:
39  bool isActive_;
40  DeviceList<ForceSensor> forceSensors_;
41  DeviceList<RateGyroSensor> rateGyroSensors_;
42  DeviceList<AccelerationSensor> accelerationSensors_;
43 
44  class Impl;
45  Impl* impl;
46 };
47 
48 }
49 
50 #endif
cnoid::BasicSensorSimulationHelper::isActive
bool isActive() const
Definition: BasicSensorSimulationHelper.h:29
cnoid::BasicSensorSimulationHelper::hasGyroOrAccelerationSensors
bool hasGyroOrAccelerationSensors() const
Definition: BasicSensorSimulationHelper.h:30
RateGyroSensor.h
cnoid::Vector3
Eigen::Vector3d Vector3
Definition: EigenTypes.h:57
cnoid::BasicSensorSimulationHelper::rateGyroSensors
const DeviceList< RateGyroSensor > & rateGyroSensors() const
Definition: BasicSensorSimulationHelper.h:33
cnoid::BasicSensorSimulationHelper::accelerationSensors
const DeviceList< AccelerationSensor > & accelerationSensors() const
Definition: BasicSensorSimulationHelper.h:34
cnoid::BasicSensorSimulationHelper::forceSensors
const DeviceList< ForceSensor > & forceSensors() const
Definition: BasicSensorSimulationHelper.h:32
cnoid
Definition: AbstractSceneLoader.h:11
DeviceList.h
ForceSensor.h
cnoid::BasicSensorSimulationHelper
Definition: BasicSensorSimulationHelper.h:19
cnoid::Body
Definition: Body.h:28
AccelerationSensor.h
cnoid::DeviceList
Definition: DeviceList.h:16