alrobotmodel  2.1.4.13
 All Classes Functions Variables Enumerations Enumerator Pages
alrobotmodel.h
1 
5 #ifndef ALROBOTMODEL_H
6 #define ALROBOTMODEL_H
7 
8 #include <almath/types/altransform.h>
9 #include <almath/types/alposition3d.h>
10 #include <string>
11 
12 #include <qi/macro.hpp>
13 
14 #ifdef alrobotmodel_EXPORTS
15 # define ALROBOTMODEL_API QI_EXPORT_API
16 #elif defined(alrobotmodel_IMPORTS)
17 # define ALROBOTMODEL_API QI_IMPORT_API
18 #else
19 # define ALROBOTMODEL_API
20 #endif
21 
22 namespace Sim
23 {
24 
25  class Actuator;
26  class ActuatorGroup;
27  class AngleActuator;
28  class AngleSensor;
29  class AngleSpeedActuator;
30  class AngleSpeedSensor;
31  class ArrayDepthSensor;
32  class BumperSensor;
33  class CameraSensor;
34  class CameraDepthSensor;
35  class CoupledActuator;
36  class CoupledSensor;
37  class FSRSensor;
38  class InertialSensor;
39  class SonarSensor;
40  class TactileSensor;
41  class LEDActuator;
42  class MicrophoneSensor;
43  class Joint;
44  class JointGroup;
45  class JointSymmetry;
46  class Link;
47  class Sensor;
48  class SingleDepthSensor;
49  class TorqueActuator;
50  class TorqueSensor;
51  class WheelTorqueActuator;
52  class WheelVelocityActuator;
53  class WheelVelocitySensor;
54 
55  typedef SingleDepthSensor DepthInfraredSensor;
56 
59 class ALROBOTMODEL_API Model
60 {
61  public:
62 
67  Model(const std::string& pathToModel);
69  ~Model();
70 
73  const std::string& name() const;
74 
79  std::string prettyName(int verbosity = 0) const;
80 
83  const std::string& configFile() const;
84 
87  std::vector<const Joint*> joints() const;
90  const Joint* joint(const std::string& jointName) const;
91 
94  std::vector<const JointSymmetry*> jointSymmetries() const;
97  const JointSymmetry* jointSymmetry(const std::string& jointName) const;
98 
101  std::vector<const JointGroup*> jointGroups() const;
104  const JointGroup* jointGroup(const std::string& jointGroupName) const;
109  std::vector<const JointGroup*>
110  jointGroupsOfJoint(const std::string& jointName) const;
111 
114  std::vector<const Link*> links() const;
117  const Link* link(const std::string& linkName) const;
121  const Link* rootLink() const;
122 
125  std::vector<const Actuator*> actuators() const;
128  const Actuator* actuator(const std::string& actuatorName) const;
129 
132  std::vector<const ActuatorGroup*> actuatorGroups() const;
135  const ActuatorGroup* actuatorGroup(
136  const std::string& actuatorGroupName) const;
142  std::vector<const ActuatorGroup*>
143  actuatorGroupsOfJoint(const std::string& jointName) const;
144 
147  std::vector<const AngleActuator*> angleActuators() const;
150  const AngleActuator* angleActuator(const std::string& actuatorName) const;
151 
154  std::vector<const CoupledActuator*> coupledActuators() const;
157  const CoupledActuator* coupledActuator(
158  const std::string& actuatorName) const;
159 
162  std::vector<const TorqueActuator*> torqueActuators() const;
165  const TorqueActuator* torqueActuator(
166  const std::string& actuatorName) const;
167 
170  std::vector<const AngleSpeedActuator*> angleSpeedActuators() const;
173  const AngleSpeedActuator* angleSpeedActuator(
174  const std::string& actuatorName) const;
175 
178  std::vector<const WheelTorqueActuator*> wheelTorqueActuators() const;
181  const WheelTorqueActuator* wheelTorqueActuator(
182  const std::string& actuatorName) const;
183 
186  std::vector<const WheelVelocityActuator*> wheelVelocityActuators() const;
189  const WheelVelocityActuator* wheelVelocityActuator(
190  const std::string& actuatorName) const;
191 
196  std::vector<const LEDActuator*> ledActuators(
197  const std::string& groupName = std::string()) const;
200  const LEDActuator* ledActuator(const std::string& actuatorName) const;
201 
204  std::vector<const Sensor*> sensors() const;
207  const Sensor* sensor(const std::string& sensorName) const;
208 
211  std::vector<const AngleSensor*> angleSensors() const;
214  const AngleSensor* angleSensor(const std::string& sensorName) const;
215 
218  std::vector<const CoupledSensor*> coupledSensors() const;
221  const CoupledSensor* coupledSensor(const std::string& sensorName) const;
222 
225  std::vector<const TorqueSensor*> torqueSensors() const;
228  const TorqueSensor* torqueSensor(const std::string& sensorName) const;
229 
232  std::vector<const AngleSpeedSensor*> angleSpeedSensors() const;
235  const AngleSpeedSensor* angleSpeedSensor(
236  const std::string& sensorName) const;
237 
240  std::vector<const WheelVelocitySensor*> wheelVelocitySensors() const;
243  const WheelVelocitySensor* wheelVelocitySensor(
244  const std::string& sensorName) const;
245 
248  std::vector<const CameraSensor*> cameraSensors() const;
251  const CameraSensor* cameraSensor(const std::string& sensorName) const;
252 
255  std::vector<const CameraDepthSensor*> cameraDepthSensors() const;
258  const CameraDepthSensor* cameraDepthSensor(
259  const std::string& sensorName) const;
260 
263  std::vector<const FSRSensor*> fsrSensors() const;
266  const FSRSensor* fsrSensor(const std::string& sensorName) const;
267 
270  std::vector<const InertialSensor*> inertialSensors() const;
273  const InertialSensor* inertialSensor(const std::string& sensorName) const;
274 
277  std::vector<const SonarSensor*> sonarSensors() const;
280  const SonarSensor* sonarSensor(const std::string& sensorName) const;
281 
284  std::vector<const BumperSensor*> bumperSensors() const;
287  const BumperSensor* bumperSensor(const std::string& sensorName) const;
288 
291  std::vector<const TactileSensor*> tactileSensors() const;
294  const TactileSensor* tactileSensor(const std::string& sensorName) const;
295 
298  std::vector<const SingleDepthSensor*> singleDepthSensors() const;
301  const SingleDepthSensor* singleDepthSensor(
302  const std::string& sensorName) const;
303 
306  std::vector<const ArrayDepthSensor*> arrayDepthSensors() const;
309  const ArrayDepthSensor* arrayDepthSensor(
310  const std::string& sensorName) const;
311 
315  std::vector<const DepthInfraredSensor*> depthInfraredSensors() const;
319  const DepthInfraredSensor* depthInfraredSensor(
320  const std::string& sensorName) const;
321 
324  std::vector<const MicrophoneSensor*> microphoneSensors() const;
327  const MicrophoneSensor* microphoneSensor(
328  const std::string& sensorName) const;
329 
331  class ModelImpl* a_impl;
332 };
333 
336 class ALROBOTMODEL_API JointSymmetry
337 {
338 
339  public:
340 
344  JointSymmetry();
345 
347  ~JointSymmetry();
348 
351  {
352  MIRROR_SYM,
353  MIRROR_ANTISYM,
354  };
355 
357  std::pair<const Joint*, const Joint*> symmetricJoints() const;
358 
360  const Joint* symmetricJoint(const Joint* joint) const;
361 
363  SymmetryType symmetryType() const;
364 
366  class JointSymmetryImpl* a_impl;
367 
368 };
369 
373 class ALROBOTMODEL_API JointGroup
374 {
375 
376  public:
377 
381  JointGroup();
382 
384  ~JointGroup();
385 
387  const std::string& name() const;
388 
390  std::vector<const Joint*> joints() const;
391 
393  class JointGroupImpl* a_impl;
394 };
395 
398 class ALROBOTMODEL_API Frame
399 {
400  public:
403  Frame();
405  ~Frame();
407  const std::string& name() const;
412  const AL::Math::Transform& position() const;
414  const Frame* parentFrame() const;
418  const AL::Math::Transform& localPosition() const;
423  static AL::Math::Transform globalPosition(
424  const Frame* frame);
426  class FrameImpl* a_impl;
427 };
428 
431 class ALROBOTMODEL_API Joint
432 {
433  public:
436  Joint();
438  ~Joint();
442  const Frame* frame() const;
444  const std::string& name() const;
449  const Link* parentLink() const;
454  const Link* childLink() const;
456  class JointImpl* a_impl;
457 };
458 
462 ALROBOTMODEL_API bool frictionCoeff(
463  const std::string& frictionMaterial1,
464  const std::string& frictionMaterial2,
465  float& frictionCoeff);
466 
470 class ALROBOTMODEL_API MassData
471 {
472  public:
476  MassData();
478  virtual ~MassData();
480  float mass() const;
485  const AL::Math::Position3D& CoM() const;
488  const std::vector<float>& inertiaMatrix() const;
490  class MassDataImpl* a_impl;
491 };
492 
496 class ALROBOTMODEL_API VisualData
497 {
498  public:
502  VisualData();
504  virtual ~VisualData();
511  const std::string& meshPath() const;
514  const AL::Math::Transform& meshTransform() const;
516  class VisualDataImpl* a_impl;
517 };
518 
521 class ALROBOTMODEL_API Link
522 {
523  public:
526  enum LinkType
527  {
528  CLASSIC,
529  WHEEL_OMNI,
530  };
533  Link();
535  virtual ~Link();
541  const Frame* frame() const;
543  const std::string& name() const;
546  const Joint* parentJoint() const;
549  const std::vector<const Joint*> childrenJoints() const;
551  const MassData* mass() const;
553  const std::string& frictionMaterial() const;
555  const VisualData* visual() const;
557  LinkType type() const;
559  class LinkImpl* a_impl;
560 };
561 
565 class ALROBOTMODEL_API Actuator
566 {
567  public:
569  enum Type
570  {
571  ANGLE_MOTOR,
572  COUPLED_MOTOR,
573  TORQUE_MOTOR,
574  ANGLE_SPEED_MOTOR,
575  WHEEL_TORQUE,
576  WHEEL_VELOCITY,
579 
580  };
582  Actuator(class ActuatorImpl* impl);
584  Actuator(const Actuator& other);
586  ~Actuator();
588  const Frame* frame() const;
590  const virtual std::string& name() const;
592  Type type() const;
595  virtual int bufferSize() const = 0;
597  ActuatorImpl* a_impl;
598 };
599 
603 class ALROBOTMODEL_API ActuatorGroup
604 {
605 
606  public:
607 
611  ActuatorGroup();
612 
614  ~ActuatorGroup();
615 
617  const std::string& name() const;
618 
620  const ActuatorGroup * parent() const;
621 
623  std::vector<const Actuator*> actuators() const;
624 
626  class ActuatorGroupImpl* a_impl;
627 
628 };
629 
633 class ALROBOTMODEL_API DCMActuator: public Actuator
634 {
635  public:
637  DCMActuator(class DCMActuatorImpl* impl);
639  DCMActuator(const DCMActuator& other);
641  ~DCMActuator();
644  const std::vector<std::string>& dcmKeys() const;
647  virtual int bufferSize() const = 0;
648 };
649 
653 class ALROBOTMODEL_API AngleActuator: public DCMActuator
654 {
655  public:
657  AngleActuator(class AngleActuatorImpl* impl);
659  AngleActuator(const AngleActuator& other);
661  ~AngleActuator();
664  const AngleActuator* reflectedSymmetric() const;
667  bool reflectedSymmetricReversed() const;
669  bool reflectionForced() const;
672  virtual int bufferSize() const;
674  float startValue() const;
676  float minValue() const;
678  float maxValue() const;
681  float maxSpeed() const;
683  const Joint* controlledJoint() const;
684 };
685 
689 class ALROBOTMODEL_API CoupledActuator: public DCMActuator
690 {
691  public:
693  CoupledActuator(class CoupledActuatorImpl* impl);
695  CoupledActuator(const CoupledActuator& other);
697  ~CoupledActuator();
700  const CoupledActuator* reflectedSymmetric() const;
703  bool reflectedSymmetricReversed() const;
705  bool reflectionForced() const;
708  virtual int bufferSize() const;
711  float startValue() const;
714  float minValue() const;
717  float maxValue() const;
719  float maxSpeed() const;
722  std::vector<std::pair<const Joint*, float> >
723  controlledJointAndRatios() const;
724 };
725 
729 class ALROBOTMODEL_API TorqueActuator: public DCMActuator
730 {
731  public:
733  TorqueActuator(class TorqueActuatorImpl* impl);
735  TorqueActuator(const TorqueActuator& other);
737  ~TorqueActuator();
740  const TorqueActuator* reflectedSymmetric() const;
743  bool reflectedSymmetricReversed() const;
746  virtual int bufferSize() const;
749  float startValue() const;
752  float minValue() const;
755  float maxValue() const;
757  const Joint* controlledJoint() const;
758 };
759 
763 class ALROBOTMODEL_API AngleSpeedActuator: public DCMActuator
764 {
765  public:
767  AngleSpeedActuator(class AngleSpeedActuatorImpl* impl);
774  const AngleSpeedActuator* reflectedSymmetric() const;
777  bool reflectedSymmetricReversed() const;
780  virtual int bufferSize() const;
783  float startValue() const;
786  float minValue() const;
789  float maxValue() const;
791  const Joint* controlledJoint() const;
792 };
793 
797 class ALROBOTMODEL_API WheelTorqueActuator: public DCMActuator
798 {
799  public:
801  WheelTorqueActuator(class WheelTorqueActuatorImpl* impl);
806  virtual int bufferSize() const;
808  // Newton per meter).
809  float maxTorque() const;
811  const Joint* controlledJoint() const;
812 };
813 
817 class ALROBOTMODEL_API WheelVelocityActuator: public DCMActuator
818 {
819  public:
821  WheelVelocityActuator(class WheelVelocityActuatorImpl* impl);
828  virtual int bufferSize() const;
831  float maxVelocity() const;
833  const Joint* controlledJoint() const;
834 };
835 
838 class ALROBOTMODEL_API LEDActuator: public DCMActuator
839 {
840  public:
842  enum Color
843  {
844  RED,
845  GREEN,
846  BLUE
847  };
848 
849  public:
851  LEDActuator(class LEDActuatorImpl* impl);
853  LEDActuator(const LEDActuator& other);
855  ~LEDActuator();
858  virtual int bufferSize() const;
860  const std::string& shortname() const;
862  const std::vector<std::string>& groups() const;
864  Color color() const;
865 };
866 
870 class ALROBOTMODEL_API Sensor
871 {
872  public:
874  enum Type
875  {
876  ANGLE,
877  COUPLED,
878  SONAR,
879  CAMERA,
880  FSR,
881  INERTIAL,
882  BUMPER,
883  TORQUE,
884  ANGLE_SPEED,
885  WHEEL_VELOCITY,
886  TACTILE,
887  DEPTH_INFRARED, // deprecated
888  SINGLE_DEPTH,
889  ARRAY_DEPTH,
890  CAMERA_DEPTH,
891  MICROPHONE,
897  };
901  Sensor();
903  ~Sensor();
905  const Frame* frame() const;
907  virtual const std::string& name() const;
909  Type type() const;
912  virtual int bufferSize() const = 0;
914  class SensorImpl* a_impl;
915 };
916 
920 class ALROBOTMODEL_API DCMSensor: public Sensor
921 {
922  public:
926  DCMSensor();
928  ~DCMSensor();
931  const std::vector<std::string>& dcmKeys() const;
934  std::vector<std::string> fullDcmKeys() const;
937  const std::vector<std::string>& dcmStateKeys() const;
941  const std::vector<std::string>& dcmCommandKeys() const;
944  virtual int bufferSize() const = 0;
945 };
946 
947 
951 class ALROBOTMODEL_API AngleSensor: public DCMSensor
952 {
953  public:
957  AngleSensor();
959  ~AngleSensor();
962  virtual int bufferSize() const;
963 };
964 
967 class ALROBOTMODEL_API CoupledSensor: public DCMSensor
968 {
969  public:
973  CoupledSensor();
975  ~CoupledSensor();
978  virtual int bufferSize() const;
979 };
980 
984 class ALROBOTMODEL_API TorqueSensor: public DCMSensor
985 {
986  public:
990  TorqueSensor();
992  ~TorqueSensor();
995  virtual int bufferSize() const;
996 };
997 
1002 class ALROBOTMODEL_API AngleSpeedSensor: public DCMSensor
1003 {
1004  public:
1008  AngleSpeedSensor();
1010  ~AngleSpeedSensor();
1013  virtual int bufferSize() const;
1014 };
1015 
1020 class ALROBOTMODEL_API WheelVelocitySensor: public DCMSensor
1021 {
1022  public:
1031  virtual int bufferSize() const;
1032 };
1033 
1036 class ALROBOTMODEL_API BaseCamera: public Sensor
1037 {
1038  public:
1042  BaseCamera();
1044  ~BaseCamera();
1047  virtual int bufferSize() const = 0;
1048 };
1049 
1052 class ALROBOTMODEL_API CameraSensor: public BaseCamera
1053 {
1054  public:
1058  CameraSensor();
1060  ~CameraSensor();
1063  virtual int bufferSize() const;
1065  int width() const;
1067  int height() const;
1068 };
1069 
1072 class ALROBOTMODEL_API CameraDepthSensor: public BaseCamera
1073 {
1074  public:
1080  ~CameraDepthSensor();
1083  virtual int bufferSize() const;
1085  int width() const;
1087  int height() const;
1088 };
1089 
1092 class ALROBOTMODEL_API FSRSensor: public DCMSensor
1093 {
1094  public:
1098  FSRSensor();
1100  ~FSRSensor();
1103  virtual int bufferSize() const;
1104 };
1105 
1108 class ALROBOTMODEL_API InertialSensor: public DCMSensor
1109 {
1110  public:
1114  InertialSensor();
1116  ~InertialSensor();
1119  virtual int bufferSize() const;
1120 };
1121 
1124 class ALROBOTMODEL_API SonarSensor: public DCMSensor
1125 {
1126  public:
1130  SonarSensor();
1132  ~SonarSensor();
1135  virtual int bufferSize() const;
1136 };
1137 
1140 class ALROBOTMODEL_API BumperSensor: public DCMSensor
1141 {
1142  public:
1146  BumperSensor();
1148  ~BumperSensor();
1151  virtual int bufferSize() const;
1152 };
1153 
1156 class ALROBOTMODEL_API TactileSensor: public DCMSensor
1157 {
1158  public:
1162  TactileSensor();
1164  ~TactileSensor();
1167  virtual int bufferSize() const;
1168 };
1169 
1173 class ALROBOTMODEL_API SingleDepthSensor: public DCMSensor
1174 {
1175  public:
1181  ~SingleDepthSensor();
1184  virtual int bufferSize() const;
1185 };
1186 
1190 class ALROBOTMODEL_API ArrayDepthSensor: public DCMSensor
1191 {
1192  public:
1196  ArrayDepthSensor();
1198  ~ArrayDepthSensor();
1201  virtual int bufferSize() const;
1203  int width() const;
1205  int height() const;
1206 };
1207 
1210 class ALROBOTMODEL_API MicrophoneSensor: public Sensor
1211 {
1212  public:
1216  MicrophoneSensor();
1218  ~MicrophoneSensor();
1221  virtual int bufferSize() const;
1222 };
1223 
1224 }
1225 
1226 #endif // ALROBOTMODEL_H
MassData embeds information about the inertial mass of a physical object.
Definition: alrobotmodel.h:470
LEDActuator is a class defining a LED actuator.
Definition: alrobotmodel.h:838
class JointImpl * a_impl
Private implementation.
Definition: alrobotmodel.h:456
CameraDepthSensor is a class defining a depth sensing camera.
Sensor is a generic class defining a robot owned object that measure a quantity about it or its envir...
Definition: alrobotmodel.h:870
DCMSensor defines a generic sensor which values are communicated through the DCM. ...
Definition: alrobotmodel.h:920
AngleActuator is a class defining an angular motor. It is attached to the joint that it can actuate...
Definition: alrobotmodel.h:653
TactileSensor is a class defining a tactile sensor.
Actuator is a generic class defining a robot owned object that have an influence on it and/or its env...
Definition: alrobotmodel.h:565
WheelVelocityActuator is a class defining an actuator that drives a wheel.
Definition: alrobotmodel.h:817
class JointGroupImpl * a_impl
private implementation.
Definition: alrobotmodel.h:393
Link defines a solid and mobile part of the robot.
Definition: alrobotmodel.h:521
JointSymmetry defines a symmetry between two joints.
Definition: alrobotmodel.h:336
class FrameImpl * a_impl
private implementation.
Definition: alrobotmodel.h:426
class MassDataImpl * a_impl
Private implementation.
Definition: alrobotmodel.h:490
class ModelImpl * a_impl
private implementation.
Definition: alrobotmodel.h:331
Type
gives the type of the Actuator.
Definition: alrobotmodel.h:569
InertialSensor is a class defining a inertial unit sensor.
AngleSpeedSensor is a class defining an angle speed sensor. It is attached to an angle speed motor (i...
BumperSensor is a class defining a bumper sensor.
Model is responsible of giving information of a physical robot.
Definition: alrobotmodel.h:59
DCMActuator defines a generic actuator which commands are communicated through the DCM...
Definition: alrobotmodel.h:633
class SensorImpl * a_impl
private implementation.
Definition: alrobotmodel.h:914
CoupledActuator is a class defining a coupled motor. It is attached to several joints and can actuate...
Definition: alrobotmodel.h:689
class JointSymmetryImpl * a_impl
brief private implementation.
Definition: alrobotmodel.h:366
SonarSensor is a class defining a sonar sensor.
FSRSensor is a class defining a Force Sensitive Resistor sensor.
SymmetryType
the symmetry can be direct or reversed
Definition: alrobotmodel.h:350
WheelTorqueActuator is a class defining an actuator that drives a wheel.
Definition: alrobotmodel.h:797
AngleSpeedActuator is a class defining a speed-controlled motor. It is attached to one joint and can ...
Definition: alrobotmodel.h:763
TorqueSensor is a class defining an torque sensor. It is attached to a torque motor (it has the same ...
Definition: alrobotmodel.h:984
JointGroup is a predefined and named ordered group of joints that allow simpler calls of ALMotion API...
Definition: alrobotmodel.h:373
LinkType
link can be classic links as in Denavit-Hartenberg representation, or of specific kind ...
Definition: alrobotmodel.h:526
Color
color of the LED
Definition: alrobotmodel.h:842
MicrophoneSensor is a class defining a microphone sensor.
CoupledSensor is a class defining a coupled sensor.
Definition: alrobotmodel.h:967
Type
gives the type of the Sensor.
Definition: alrobotmodel.h:874
CameraSensor is a class defining a camera.
class VisualDataImpl * a_impl
Private implementation.
Definition: alrobotmodel.h:516
ActuatorImpl * a_impl
private implementation
Definition: alrobotmodel.h:597
VisualData embeds information about the visualization of a physical object.
Definition: alrobotmodel.h:496
BaseCamera is the base class of Camera classes.
TorqueActuator is a class defining a torque-controlled motor. It is attached to one joint and can act...
Definition: alrobotmodel.h:729
Not implemented yet.
Definition: alrobotmodel.h:578
SingleDepthSensor is a class defining a sensor that provides a single depth measurement.
Frame defines a position in space and has a name.
Definition: alrobotmodel.h:398
class LinkImpl * a_impl
private implementation.
Definition: alrobotmodel.h:559
AngleSensor is a class defining an angular sensor. It is attached to an angular motor (it has the sam...
Definition: alrobotmodel.h:951
ActuatorSymmetry is a predefined and named ordered group of actuators that allows simpler calls of AL...
Definition: alrobotmodel.h:603
class ActuatorGroupImpl * a_impl
private implementation.
Definition: alrobotmodel.h:626
Joint defines an articulation of the robot.
Definition: alrobotmodel.h:431
WheelVelocitySensor is a class defining a wheel velocity sensor. It is to a wheel velocity motor (it ...
ArrayDepthSensor is a class defining a sensor made of an array of depth sensors.