alrobotmodel  2.5.7.1
 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 CameraStereoSensor;
35  class CameraDepthSensor;
36  class CoupledActuator;
37  class CoupledSensor;
38  class FSRSensor;
39  class InertialSensor;
40  class SonarSensor;
41  class TactileSensor;
42  class LEDActuator;
43  class MicrophoneSensor;
44  class Joint;
45  class JointGroup;
46  class JointSymmetry;
47  class Link;
48  class Sensor;
49  class SingleDepthSensor;
50  class TorqueActuator;
51  class TorqueSensor;
52  class WheelTorqueActuator;
55 
57 
61 {
62  public:
63 
68  Model(const std::string& pathToModel);
70  ~Model();
71 
74  const std::string& name() const;
75 
80  std::string prettyName(int verbosity = 0) const;
81 
84  const std::string& configFile() const;
85 
88  std::vector<const Joint*> joints() const;
91  const Joint* joint(const std::string& jointName) const;
92 
95  std::vector<const JointSymmetry*> jointSymmetries() const;
98  const JointSymmetry* jointSymmetry(const std::string& jointName) const;
99 
102  std::vector<const JointGroup*> jointGroups() const;
105  const JointGroup* jointGroup(const std::string& jointGroupName) const;
110  std::vector<const JointGroup*>
111  jointGroupsOfJoint(const std::string& jointName) const;
112 
115  std::vector<const Link*> links() const;
118  const Link* link(const std::string& linkName) const;
122  const Link* rootLink() const;
123 
126  std::vector<const Actuator*> actuators() const;
129  const Actuator* actuator(const std::string& actuatorName) const;
130 
133  std::vector<const ActuatorGroup*> actuatorGroups() const;
136  const ActuatorGroup* actuatorGroup(
137  const std::string& actuatorGroupName) const;
143  std::vector<const ActuatorGroup*>
144  actuatorGroupsOfJoint(const std::string& jointName) const;
145 
148  std::vector<const AngleActuator*> angleActuators() const;
151  const AngleActuator* angleActuator(const std::string& actuatorName) const;
152 
155  std::vector<const CoupledActuator*> coupledActuators() const;
158  const CoupledActuator* coupledActuator(
159  const std::string& actuatorName) const;
160 
163  std::vector<const TorqueActuator*> torqueActuators() const;
166  const TorqueActuator* torqueActuator(
167  const std::string& actuatorName) const;
168 
171  std::vector<const AngleSpeedActuator*> angleSpeedActuators() const;
174  const AngleSpeedActuator* angleSpeedActuator(
175  const std::string& actuatorName) const;
176 
179  std::vector<const WheelTorqueActuator*> wheelTorqueActuators() const;
182  const WheelTorqueActuator* wheelTorqueActuator(
183  const std::string& actuatorName) const;
184 
187  std::vector<const WheelVelocityActuator*> wheelVelocityActuators() const;
190  const WheelVelocityActuator* wheelVelocityActuator(
191  const std::string& actuatorName) const;
192 
197  std::vector<const LEDActuator*> ledActuators(
198  const std::string& groupName = std::string()) const;
201  const LEDActuator* ledActuator(const std::string& actuatorName) const;
202 
205  std::vector<const Sensor*> sensors() const;
208  const Sensor* sensor(const std::string& sensorName) const;
209 
212  std::vector<const AngleSensor*> angleSensors() const;
215  const AngleSensor* angleSensor(const std::string& sensorName) const;
216 
219  std::vector<const CoupledSensor*> coupledSensors() const;
222  const CoupledSensor* coupledSensor(const std::string& sensorName) const;
223 
226  std::vector<const TorqueSensor*> torqueSensors() const;
229  const TorqueSensor* torqueSensor(const std::string& sensorName) const;
230 
233  std::vector<const AngleSpeedSensor*> angleSpeedSensors() const;
236  const AngleSpeedSensor* angleSpeedSensor(
237  const std::string& sensorName) const;
238 
241  std::vector<const WheelVelocitySensor*> wheelVelocitySensors() const;
244  const WheelVelocitySensor* wheelVelocitySensor(
245  const std::string& sensorName) const;
246 
249  std::vector<const CameraSensor*> cameraSensors() const;
252  const CameraSensor* cameraSensor(const std::string& sensorName) const;
253 
256  std::vector<const CameraStereoSensor*> cameraStereoSensors() const;
259  const CameraStereoSensor* cameraStereoSensor(
260  const std::string& sensorName) const;
261 
264  std::vector<const CameraDepthSensor*> cameraDepthSensors() const;
267  const CameraDepthSensor* cameraDepthSensor(
268  const std::string& sensorName) const;
269 
272  std::vector<const FSRSensor*> fsrSensors() const;
275  const FSRSensor* fsrSensor(const std::string& sensorName) const;
276 
279  std::vector<const InertialSensor*> inertialSensors() const;
282  const InertialSensor* inertialSensor(const std::string& sensorName) const;
283 
286  std::vector<const SonarSensor*> sonarSensors() const;
289  const SonarSensor* sonarSensor(const std::string& sensorName) const;
290 
293  std::vector<const BumperSensor*> bumperSensors() const;
296  const BumperSensor* bumperSensor(const std::string& sensorName) const;
297 
300  std::vector<const TactileSensor*> tactileSensors() const;
303  const TactileSensor* tactileSensor(const std::string& sensorName) const;
304 
307  std::vector<const SingleDepthSensor*> singleDepthSensors() const;
310  const SingleDepthSensor* singleDepthSensor(
311  const std::string& sensorName) const;
312 
315  std::vector<const ArrayDepthSensor*> arrayDepthSensors() const;
318  const ArrayDepthSensor* arrayDepthSensor(
319  const std::string& sensorName) const;
320 
324  std::vector<const DepthInfraredSensor*> depthInfraredSensors() const;
328  const DepthInfraredSensor* depthInfraredSensor(
329  const std::string& sensorName) const;
330 
333  std::vector<const MicrophoneSensor*> microphoneSensors() const;
336  const MicrophoneSensor* microphoneSensor(
337  const std::string& sensorName) const;
338 
340  class ModelImpl* a_impl;
341 };
342 
346 {
347 
348  public:
349 
353  JointSymmetry();
354 
356  ~JointSymmetry();
357 
360  {
363  };
364 
366  std::pair<const Joint*, const Joint*> symmetricJoints() const;
367 
369  const Joint* symmetricJoint(const Joint* joint) const;
370 
372  SymmetryType symmetryType() const;
373 
375  class JointSymmetryImpl* a_impl;
376 
377 };
378 
383 {
384 
385  public:
386 
390  JointGroup();
391 
393  ~JointGroup();
394 
396  const std::string& name() const;
397 
399  std::vector<const Joint*> joints() const;
400 
402  class JointGroupImpl* a_impl;
403 };
404 
408 {
409  public:
412  Frame();
414  ~Frame();
416  const std::string& name() const;
421  const AL::Math::Transform& position() const;
423  const Frame* parentFrame() const;
427  const AL::Math::Transform& localPosition() const;
432  static AL::Math::Transform globalPosition(
433  const Frame* frame);
435  class FrameImpl* a_impl;
436 };
437 
441 {
442  public:
445  Joint();
447  ~Joint();
451  const Frame* frame() const;
453  const std::string& name() const;
458  const Link* parentLink() const;
463  const Link* childLink() const;
465  class JointImpl* a_impl;
466 };
467 
472  const std::string& frictionMaterial1,
473  const std::string& frictionMaterial2,
474  float& frictionCoeff);
475 
480 {
481  public:
485  MassData();
487  virtual ~MassData();
489  float mass() const;
494  const AL::Math::Position3D& CoM() const;
497  const std::vector<float>& inertiaMatrix() const;
499  class MassDataImpl* a_impl;
500 };
501 
506 {
507  public:
511  VisualData();
513  virtual ~VisualData();
520  const std::string& meshPath() const;
523  const AL::Math::Transform& meshTransform() const;
525  class VisualDataImpl* a_impl;
526 };
527 
531 {
532  public:
535  enum LinkType
536  {
539  };
542  Link();
544  virtual ~Link();
550  const Frame* frame() const;
552  const std::string& name() const;
555  const Joint* parentJoint() const;
558  const std::vector<const Joint*> childrenJoints() const;
560  const MassData* mass() const;
562  const std::string& frictionMaterial() const;
564  const VisualData* visual() const;
566  LinkType type() const;
568  class LinkImpl* a_impl;
569 };
570 
575 {
576  public:
578  enum Type
579  {
588 
589  };
591  Actuator(class ActuatorImpl* impl);
593  Actuator(const Actuator& other);
595  ~Actuator();
597  const Frame* frame() const;
599  const virtual std::string& name() const;
601  Type type() const;
604  virtual int bufferSize() const = 0;
606  ActuatorImpl* a_impl;
607 };
608 
613 {
614 
615  public:
616 
620  ActuatorGroup();
621 
623  ~ActuatorGroup();
624 
626  const std::string& name() const;
627 
629  const ActuatorGroup * parent() const;
630 
632  std::vector<const Actuator*> actuators() const;
633 
635  class ActuatorGroupImpl* a_impl;
636 
637 };
638 
643 {
644  public:
646  DCMActuator(class DCMActuatorImpl* impl);
648  DCMActuator(const DCMActuator& other);
650  ~DCMActuator();
653  const std::vector<std::string>& dcmKeys() const;
656  virtual int bufferSize() const = 0;
657 };
658 
663 {
664  public:
666  AngleActuator(class AngleActuatorImpl* impl);
668  AngleActuator(const AngleActuator& other);
670  ~AngleActuator();
673  const AngleActuator* reflectedSymmetric() const;
676  bool reflectedSymmetricReversed() const;
678  bool reflectionForced() const;
681  virtual int bufferSize() const;
683  float startValue() const;
685  float minValue() const;
687  float maxValue() const;
690  float maxSpeed() const;
692  const Joint* controlledJoint() const;
693 };
694 
699 {
700  public:
702  CoupledActuator(class CoupledActuatorImpl* impl);
704  CoupledActuator(const CoupledActuator& other);
706  ~CoupledActuator();
709  const CoupledActuator* reflectedSymmetric() const;
712  bool reflectedSymmetricReversed() const;
714  bool reflectionForced() const;
717  virtual int bufferSize() const;
720  float startValue() const;
723  float minValue() const;
726  float maxValue() const;
728  float maxSpeed() const;
731  std::vector<std::pair<const Joint*, float> >
732  controlledJointAndRatios() const;
733 };
734 
739 {
740  public:
742  TorqueActuator(class TorqueActuatorImpl* impl);
744  TorqueActuator(const TorqueActuator& other);
746  ~TorqueActuator();
749  const TorqueActuator* reflectedSymmetric() const;
752  bool reflectedSymmetricReversed() const;
755  virtual int bufferSize() const;
758  float startValue() const;
761  float minValue() const;
764  float maxValue() const;
766  const Joint* controlledJoint() const;
767 };
768 
773 {
774  public:
776  AngleSpeedActuator(class AngleSpeedActuatorImpl* impl);
783  const AngleSpeedActuator* reflectedSymmetric() const;
786  bool reflectedSymmetricReversed() const;
789  virtual int bufferSize() const;
792  float startValue() const;
795  float minValue() const;
798  float maxValue() const;
800  const Joint* controlledJoint() const;
801 };
802 
807 {
808  public:
810  WheelTorqueActuator(class WheelTorqueActuatorImpl* impl);
815  virtual int bufferSize() const;
817  // Newton per meter).
818  float maxTorque() const;
820  const Joint* controlledJoint() const;
821 };
822 
827 {
828  public:
830  WheelVelocityActuator(class WheelVelocityActuatorImpl* impl);
837  virtual int bufferSize() const;
840  float maxVelocity() const;
842  const Joint* controlledJoint() const;
843 };
844 
848 {
849  public:
851  enum Color
852  {
855  BLUE
856  };
857 
858  public:
860  LEDActuator(class LEDActuatorImpl* impl);
862  LEDActuator(const LEDActuator& other);
864  ~LEDActuator();
867  virtual int bufferSize() const;
869  const std::string& shortname() const;
871  const std::vector<std::string>& groups() const;
873  Color color() const;
874 };
875 
880 {
881  public:
883  enum Type
884  {
896  DEPTH_INFRARED, // deprecated
906  };
910  Sensor();
912  ~Sensor();
914  const Frame* frame() const;
916  virtual const std::string& name() const;
918  Type type() const;
921  virtual int bufferSize() const = 0;
923  class SensorImpl* a_impl;
924 };
925 
930 {
931  public:
935  DCMSensor();
937  ~DCMSensor();
940  const std::vector<std::string>& dcmKeys() const;
943  std::vector<std::string> fullDcmKeys() const;
946  const std::vector<std::string>& dcmStateKeys() const;
950  const std::vector<std::string>& dcmCommandKeys() const;
953  virtual int bufferSize() const = 0;
954 };
955 
956 
961 {
962  public:
966  AngleSensor();
968  ~AngleSensor();
971  virtual int bufferSize() const;
972 };
973 
977 {
978  public:
982  CoupledSensor();
984  ~CoupledSensor();
987  virtual int bufferSize() const;
988 };
989 
994 {
995  public:
999  TorqueSensor();
1001  ~TorqueSensor();
1004  virtual int bufferSize() const;
1005 };
1006 
1012 {
1013  public:
1017  AngleSpeedSensor();
1019  ~AngleSpeedSensor();
1022  virtual int bufferSize() const;
1023 };
1024 
1030 {
1031  public:
1040  virtual int bufferSize() const;
1041 };
1042 
1046 {
1047  public:
1051  BaseCamera();
1053  ~BaseCamera();
1056  virtual int bufferSize() const = 0;
1057 };
1058 
1062 {
1063  public:
1067  CameraSensor();
1069  ~CameraSensor();
1072  virtual int bufferSize() const;
1074  int width() const;
1076  int height() const;
1077 };
1078 
1082 {
1083  public:
1089  ~CameraStereoSensor();
1092  virtual int bufferSize() const;
1094  int width() const;
1096  int height() const;
1097 };
1098 
1102 {
1103  public:
1109  ~CameraDepthSensor();
1112  virtual int bufferSize() const;
1114  int width() const;
1116  int height() const;
1117 };
1118 
1122 {
1123  public:
1127  FSRSensor();
1129  ~FSRSensor();
1132  virtual int bufferSize() const;
1133 };
1134 
1138 {
1139  public:
1143  InertialSensor();
1145  ~InertialSensor();
1148  virtual int bufferSize() const;
1149 };
1150 
1154 {
1155  public:
1159  SonarSensor();
1161  ~SonarSensor();
1164  virtual int bufferSize() const;
1165 };
1166 
1170 {
1171  public:
1175  BumperSensor();
1177  ~BumperSensor();
1180  virtual int bufferSize() const;
1181 };
1182 
1186 {
1187  public:
1191  TactileSensor();
1193  ~TactileSensor();
1196  virtual int bufferSize() const;
1197 };
1198 
1203 {
1204  public:
1210  ~SingleDepthSensor();
1213  virtual int bufferSize() const;
1214 };
1215 
1220 {
1221  public:
1225  ArrayDepthSensor();
1227  ~ArrayDepthSensor();
1230  virtual int bufferSize() const;
1232  int width() const;
1234  int height() const;
1235 };
1236 
1240 {
1241  public:
1245  MicrophoneSensor();
1247  ~MicrophoneSensor();
1250  virtual int bufferSize() const;
1251 };
1252 
1253 }
1254 
1255 #endif // ALROBOTMODEL_H
Model is responsible of giving information of a physical robot.
Definition: alrobotmodel.h:60
Type
gives the type of the Sensor.
Definition: alrobotmodel.h:883
ActuatorSymmetry is a predefined and named ordered group of actuators that allows simpler calls of AL...
Definition: alrobotmodel.h:612
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:525
VisualData embeds information about the visualization of a physical object.
Definition: alrobotmodel.h:505
MassData embeds information about the inertial mass of a physical object.
Definition: alrobotmodel.h:479
WheelVelocityActuator is a class defining an actuator that drives a wheel.
Definition: alrobotmodel.h:826
SonarSensor is a class defining a sonar sensor.
DCMSensor defines a generic sensor which values are communicated through the DCM. ...
Definition: alrobotmodel.h:929
Actuator is a generic class defining a robot owned object that have an influence on it and/or its env...
Definition: alrobotmodel.h:574
AngleSpeedActuator is a class defining a speed-controlled motor. It is attached to one joint and can ...
Definition: alrobotmodel.h:772
SymmetryType
the symmetry can be direct or reversed
Definition: alrobotmodel.h:359
class SensorImpl * a_impl
private implementation.
Definition: alrobotmodel.h:923
#define ALROBOTMODEL_API
Definition: alrobotmodel.h:19
class JointImpl * a_impl
Private implementation.
Definition: alrobotmodel.h:465
class ModelImpl * a_impl
private implementation.
Definition: alrobotmodel.h:340
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:382
JointSymmetry defines a symmetry between two joints.
Definition: alrobotmodel.h:345
DCMActuator defines a generic actuator which commands are communicated through the DCM...
Definition: alrobotmodel.h:642
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:635
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:407
TorqueSensor is a class defining an torque sensor. It is attached to a torque motor (it has the same ...
Definition: alrobotmodel.h:993
Type
gives the type of the Actuator.
Definition: alrobotmodel.h:578
Color
color of the LED
Definition: alrobotmodel.h:851
CoupledSensor is a class defining a coupled sensor.
Definition: alrobotmodel.h:976
CameraStereoSensor is a class defining a camera.
Sensor is a generic class defining a robot owned object that measure a quantity about it or its envir...
Definition: alrobotmodel.h:879
WheelTorqueActuator is a class defining an actuator that drives a wheel.
Definition: alrobotmodel.h:806
TactileSensor is a class defining a tactile sensor.
LEDActuator is a class defining a LED actuator.
Definition: alrobotmodel.h:847
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:402
ActuatorImpl * a_impl
private implementation
Definition: alrobotmodel.h:606
class JointSymmetryImpl * a_impl
brief private implementation.
Definition: alrobotmodel.h:375
CoupledActuator is a class defining a coupled motor. It is attached to several joints and can actuate...
Definition: alrobotmodel.h:698
SingleDepthSensor DepthInfraredSensor
Definition: alrobotmodel.h:54
AngleSensor is a class defining an angular sensor. It is attached to an angular motor (it has the sam...
Definition: alrobotmodel.h:960
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:738
Joint defines an articulation of the robot.
Definition: alrobotmodel.h:440
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:662
class MassDataImpl * a_impl
Private implementation.
Definition: alrobotmodel.h:499
CameraDepthSensor is a class defining a depth sensing camera.
class FrameImpl * a_impl
private implementation.
Definition: alrobotmodel.h:435
Not implemented yet.
Definition: alrobotmodel.h:587