Klamp't  0.9.0
JointSensors.h
1 #ifndef CONTROL_JOINT_SENSORS_H
2 #define CONTROL_JOINT_SENSORS_H
3 
4 #include "Sensor.h"
5 
6 namespace Klampt {
7  using namespace Math;
8 
18 {
19  public:
21  virtual ~JointPositionSensor() {}
22  virtual const char* Type() const override { return "JointPositionSensor"; }
23  virtual void Simulate(SimRobotController* robot,Simulator* sim) override;
24  virtual void SimulateKinematic(RobotModel& robot,WorldModel& world) override;
25  virtual void Reset() override;
26  virtual void MeasurementNames(vector<string>& names) const override;
27  virtual void GetMeasurements(vector<double>& values) const override;
28  virtual void SetMeasurements(const vector<double>& values) override;
29  virtual map<string,string> Settings() const override;
30  virtual bool GetSetting(const string& name,string& str) const override;
31  virtual bool SetSetting(const string& name,const string& str) override;
32 
33  vector<int> indices;
34  Vector qvariance;
35  Vector qresolution;
36  Vector q;
37 };
38 
48 {
49  public:
51  virtual ~JointVelocitySensor() {}
52  virtual const char* Type() const override { return "JointVelocitySensor"; }
53  virtual void Simulate(SimRobotController* robot,Simulator* sim) override;
54  virtual void SimulateKinematic(RobotModel& robot,WorldModel& world) override;
55  virtual void Reset() override;
56  virtual void MeasurementNames(vector<string>& names) const override;
57  virtual void GetMeasurements(vector<double>& values) const override;
58  virtual void SetMeasurements(const vector<double>& values) override;
59  virtual map<string,string> Settings() const override;
60  virtual bool GetSetting(const string& name,string& str) const override;
61  virtual bool SetSetting(const string& name,const string& str) override;
62 
63  vector<int> indices;
64  Vector dqvariance;
65  Vector dqresolution;
66  Vector dq;
67 };
68 
81 {
82  public:
84  virtual ~DriverTorqueSensor() {}
85  virtual const char* Type() const override { return "DriverTorqueSensor"; }
86  virtual void Simulate(SimRobotController* robot,Simulator* sim) override;
87  virtual void SimulateKinematic(RobotModel& robot,WorldModel& world) override;
88  virtual void Reset() override;
89  virtual void MeasurementNames(vector<string>& names) const override;
90  virtual void GetMeasurements(vector<double>& values) const override;
91  virtual void SetMeasurements(const vector<double>& values) override;
92  virtual map<string,string> Settings() const override;
93  virtual bool GetSetting(const string& name,string& str) const override;
94  virtual bool SetSetting(const string& name,const string& str) override;
95 
96  vector<int> indices;
97  Vector tvariance;
98  Vector tresolution;
99  Vector t;
100 };
101 
102 } //namespace Klampt
103 
104 #endif
vector< int > indices
The indices on which the position sensors are located.
Definition: JointSensors.h:33
Vector dqvariance
Estimated variance of the encoder values.
Definition: JointSensors.h:64
Simulates a torque sensor.
Definition: JointSensors.h:80
Vector q
Measurement: joint angles.
Definition: JointSensors.h:36
Vector dq
Measurement: joint velocities.
Definition: JointSensors.h:66
A physical simulator for a WorldModel.
Definition: Simulator.h:69
Vector qvariance
Estimated variance of the encoder values.
Definition: JointSensors.h:34
Vector qresolution
Estimate on the encoder resolution.
Definition: JointSensors.h:35
A class containing information about an ODE-simulated and controlled robot.
Definition: SimRobotController.h:19
A sensor base class. A SensorBase should allow a Controller to both connect to a simulation as well a...
Definition: Sensor.h:55
Vector t
Measurement: joint torques.
Definition: JointSensors.h:99
vector< int > indices
The indices on which the velocity sensors are located.
Definition: JointSensors.h:63
The main robot type used in RobotSim.
Definition: Robot.h:83
Simulates a velocity sensor. (Does not perform differencing)
Definition: JointSensors.h:47
Vector tresolution
Estimate on the torque resolution.
Definition: JointSensors.h:98
Simulates a joint encoder.
Definition: JointSensors.h:17
Definition: ContactDistance.h:6
Vector tvariance
Estimated variance of the torque values.
Definition: JointSensors.h:97
The main world class containing multiple robots, objects, and static geometries (terrains). Lights and other viewport information may also be stored here.
Definition: World.h:24
vector< int > indices
The indices on which the torque sensors are located.
Definition: JointSensors.h:96
Vector dqresolution
Estimate on the encoder resolution.
Definition: JointSensors.h:65