alrobotmodel  2.4.3.28-r2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
alrobotmodel.h
Go to the documentation of this file.
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;
54 
56 
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 
337 {
338 
339  public:
340 
344  JointSymmetry();
345 
347  ~JointSymmetry();
348 
351  {
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 
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 
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 
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 
463  const std::string& frictionMaterial1,
464  const std::string& frictionMaterial2,
465  float& frictionCoeff);
466 
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 
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 
522 {
523  public:
526  enum LinkType
527  {
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 
566 {
567  public:
569  enum Type
570  {
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 
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 
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 
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 
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 
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 
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 
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 
818 {
819  public:
821  WheelVelocityActuator(class WheelVelocityActuatorImpl* impl);
828  virtual int bufferSize() const;
831  float maxVelocity() const;
833  const Joint* controlledJoint() const;
834 };
835 
839 {
840  public:
842  enum Color
843  {
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 
871 {
872  public:
874  enum Type
875  {
887  DEPTH_INFRARED, // deprecated
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 
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 
952 {
953  public:
957  AngleSensor();
959  ~AngleSensor();
962  virtual int bufferSize() const;
963 };
964 
968 {
969  public:
973  CoupledSensor();
975  ~CoupledSensor();
978  virtual int bufferSize() const;
979 };
980 
985 {
986  public:
990  TorqueSensor();
992  ~TorqueSensor();
995  virtual int bufferSize() const;
996 };
997 
1003 {
1004  public:
1008  AngleSpeedSensor();
1010  ~AngleSpeedSensor();
1013  virtual int bufferSize() const;
1014 };
1015 
1021 {
1022  public:
1031  virtual int bufferSize() const;
1032 };
1033 
1037 {
1038  public:
1042  BaseCamera();
1044  ~BaseCamera();
1047  virtual int bufferSize() const = 0;
1048 };
1049 
1053 {
1054  public:
1058  CameraSensor();
1060  ~CameraSensor();
1063  virtual int bufferSize() const;
1065  int width() const;
1067  int height() const;
1068 };
1069 
1073 {
1074  public:
1080  ~CameraDepthSensor();
1083  virtual int bufferSize() const;
1085  int width() const;
1087  int height() const;
1088 };
1089 
1093 {
1094  public:
1098  FSRSensor();
1100  ~FSRSensor();
1103  virtual int bufferSize() const;
1104 };
1105 
1109 {
1110  public:
1114  InertialSensor();
1116  ~InertialSensor();
1119  virtual int bufferSize() const;
1120 };
1121 
1125 {
1126  public:
1130  SonarSensor();
1132  ~SonarSensor();
1135  virtual int bufferSize() const;
1136 };
1137 
1141 {
1142  public:
1146  BumperSensor();
1148  ~BumperSensor();
1151  virtual int bufferSize() const;
1152 };
1153 
1157 {
1158  public:
1162  TactileSensor();
1164  ~TactileSensor();
1167  virtual int bufferSize() const;
1168 };
1169 
1174 {
1175  public:
1181  ~SingleDepthSensor();
1184  virtual int bufferSize() const;
1185 };
1186 
1191 {
1192  public:
1196  ArrayDepthSensor();
1198  ~ArrayDepthSensor();
1201  virtual int bufferSize() const;
1203  int width() const;
1205  int height() const;
1206 };
1207 
1211 {
1212  public:
1216  MicrophoneSensor();
1218  ~MicrophoneSensor();
1221  virtual int bufferSize() const;
1222 };
1223 
1224 }
1225 
1226 #endif // ALROBOTMODEL_H
Model is responsible of giving information of a physical robot.
Definition: alrobotmodel.h:59
Type
gives the type of the Sensor.
Definition: alrobotmodel.h:874
ActuatorSymmetry is a predefined and named ordered group of actuators that allows simpler calls of AL...
Definition: alrobotmodel.h:603
InertialSensor is a class defining a inertial unit sensor.
BumperSensor is a class defining a bumper sensor.
class VisualDataImpl * a_impl
Private implementation.
Definition: alrobotmodel.h:516
VisualData embeds information about the visualization of a physical object.
Definition: alrobotmodel.h:496
MassData embeds information about the inertial mass of a physical object.
Definition: alrobotmodel.h:470
WheelVelocityActuator is a class defining an actuator that drives a wheel.
Definition: alrobotmodel.h:817
SonarSensor is a class defining a sonar sensor.
DCMSensor defines a generic sensor which values are communicated through the DCM. ...
Definition: alrobotmodel.h:920
Actuator is a generic class defining a robot owned object that have an influence on it and/or its env...
Definition: alrobotmodel.h:565
AngleSpeedActuator is a class defining a speed-controlled motor. It is attached to one joint and can ...
Definition: alrobotmodel.h:763
SymmetryType
the symmetry can be direct or reversed
Definition: alrobotmodel.h:350
class SensorImpl * a_impl
private implementation.
Definition: alrobotmodel.h:914
#define ALROBOTMODEL_API
Definition: alrobotmodel.h:19
class JointImpl * a_impl
Private implementation.
Definition: alrobotmodel.h:456
class ModelImpl * a_impl
private implementation.
Definition: alrobotmodel.h:331
CameraSensor is a class defining a camera.
JointGroup is a predefined and named ordered group of joints that allow simpler calls of ALMotion API...
Definition: alrobotmodel.h:373
JointSymmetry defines a symmetry between two joints.
Definition: alrobotmodel.h:336
DCMActuator defines a generic actuator which commands are communicated through the DCM...
Definition: alrobotmodel.h:633
BaseCamera is the base class of Camera classes.
SingleDepthSensor is a class defining a sensor that provides a single depth measurement.
class ActuatorGroupImpl * a_impl
private implementation.
Definition: alrobotmodel.h:626
ALROBOTMODEL_API bool frictionCoeff(const std::string &frictionMaterial1, const std::string &frictionMaterial2, float &frictionCoeff)
This function returns if a friction coefficient (nil or positive) between frictionMaterial1 and frict...
AngleSpeedSensor is a class defining an angle speed sensor. It is attached to an angle speed motor (i...
Frame defines a position in space and has a name.
Definition: alrobotmodel.h:398
TorqueSensor is a class defining an torque sensor. It is attached to a torque motor (it has the same ...
Definition: alrobotmodel.h:984
Type
gives the type of the Actuator.
Definition: alrobotmodel.h:569
Color
color of the LED
Definition: alrobotmodel.h:842
CoupledSensor is a class defining a coupled sensor.
Definition: alrobotmodel.h:967
Sensor is a generic class defining a robot owned object that measure a quantity about it or its envir...
Definition: alrobotmodel.h:870
WheelTorqueActuator is a class defining an actuator that drives a wheel.
Definition: alrobotmodel.h:797
TactileSensor is a class defining a tactile sensor.
LEDActuator is a class defining a LED actuator.
Definition: alrobotmodel.h:838
WheelVelocitySensor is a class defining a wheel velocity sensor. It is to a wheel velocity motor (it ...
class JointGroupImpl * a_impl
private implementation.
Definition: alrobotmodel.h:393
ActuatorImpl * a_impl
private implementation
Definition: alrobotmodel.h:597
class JointSymmetryImpl * a_impl
brief private implementation.
Definition: alrobotmodel.h:366
CoupledActuator is a class defining a coupled motor. It is attached to several joints and can actuate...
Definition: alrobotmodel.h:689
SingleDepthSensor DepthInfraredSensor
Definition: alrobotmodel.h:53
AngleSensor is a class defining an angular sensor. It is attached to an angular motor (it has the sam...
Definition: alrobotmodel.h:951
ArrayDepthSensor is a class defining a sensor made of an array of depth sensors.
TorqueActuator is a class defining a torque-controlled motor. It is attached to one joint and can act...
Definition: alrobotmodel.h:729
Joint defines an articulation of the robot.
Definition: alrobotmodel.h:431
FSRSensor is a class defining a Force Sensitive Resistor sensor.
MicrophoneSensor is a class defining a microphone sensor.
AngleActuator is a class defining an angular motor. It is attached to the joint that it can actuate...
Definition: alrobotmodel.h:653
class MassDataImpl * a_impl
Private implementation.
Definition: alrobotmodel.h:490
CameraDepthSensor is a class defining a depth sensing camera.
class FrameImpl * a_impl
private implementation.
Definition: alrobotmodel.h:426
Not implemented yet.
Definition: alrobotmodel.h:578