smurf
Robot.hpp
Go to the documentation of this file.
1 #ifndef SMURF_H
2 #define SMURF_H
3 
6 #include "Joint.hpp"
7 #include "Sensor.hpp"
8 #include "Motor.hpp"
9 #include "ContactParams.hpp"
10 #include "Visual.hpp"
11 #include <configmaps/ConfigData.h>
12 #include <urdf_world/types.h>
13 
14 
15 namespace configmaps
16 {
17  class ConfigMap;
18 };
19 
20 namespace smurf
21 {
22  class Robot
23  {
24  public:
25 
26  Robot();
27 
28  ~Robot();
29 
30  const std::vector<smurf::StaticTransformation *> & getStaticTransforms() const
31  {
32  return staticTransforms;
33  };
34 
35  const std::vector<smurf::DynamicTransformation *> & getDynamicTransforms() const
36  {
37  return dynamicTransforms;
38  };
39 
40  const std::vector<smurf::Joint *> & getJoints() const
41  {
42  return joints;
43  };
44 
45  const std::vector<smurf::Motor *> & getMotors() const
46  {
47  return motors;
48  };
49 
50  const std::vector<smurf::Sensor *> & getSensors() const
51  {
52  return sensors;
53  };
54 
55  const std::vector<smurf::Frame *> & getFrames() const
56  {
57  return availableFrames;
58  };
59 
60  const Frame* getRootFrame() const
61  {
62  return rootFrame;
63  };
64 
65  const ContactParams getContactParams(const std::string& collisionName, const std::string& linkName);
66 
73  void loadCollidables();
74 
78  void loadCollisions();
79 
85  void loadInertials();
86 
95  void loadJoints();
96 
97  void loadMotors();
98 
99  void loadSensors();
100 
101  void loadVisuals();
102 
103  void loadFrames(urdf::ModelInterfaceSharedPtr model);
104 
115  void loadFromSmurf(const std::string &path, std::string prefix = "");
116 
117  protected:
118 
119  Frame *getFrameByName(const std::string &name);
120 
121  configmaps::ConfigMap getAnnotations(const urdf::JointSharedPtr &joint);
122 
123  configmaps::ConfigMap getJointConfigMap(const urdf::JointSharedPtr &joint);
124 
126  urdf::ModelInterfaceSharedPtr model;
127  configmaps::ConfigMap *smurfMap;
128 
129  std::vector<smurf::Frame *> availableFrames;
130  std::vector<smurf::StaticTransformation *> staticTransforms;
131  std::vector<smurf::DynamicTransformation *> dynamicTransforms;
132  std::vector<smurf::Joint *> joints;
133  std::vector<smurf::Sensor *> sensors;
134  std::vector<smurf::Motor *> motors;
135 
136  const bool debug = false;
137 
138  std::string prefix;
139  };
140 };
141 #endif // SMURF_H
const std::vector< smurf::Motor * > & getMotors() const
Definition: Robot.hpp:45
const std::vector< smurf::DynamicTransformation * > & getDynamicTransforms() const
Definition: Robot.hpp:35
const std::vector< smurf::Sensor * > & getSensors() const
Definition: Robot.hpp:50
std::vector< smurf::Motor * > motors
Definition: Robot.hpp:134
Frame * rootFrame
Definition: Robot.hpp:125
std::string prefix
Definition: Robot.hpp:138
std::vector< smurf::DynamicTransformation * > dynamicTransforms
Definition: Robot.hpp:131
const std::vector< smurf::Joint * > & getJoints() const
Definition: Robot.hpp:40
Definition: Robot.hpp:22
Definition: Frame.hpp:11
const std::vector< smurf::StaticTransformation * > & getStaticTransforms() const
Definition: Robot.hpp:30
const std::vector< smurf::Frame * > & getFrames() const
Definition: Robot.hpp:55
Definition: Robot.hpp:15
configmaps::ConfigMap * smurfMap
Definition: Robot.hpp:127
const Frame * getRootFrame() const
Definition: Robot.hpp:60
urdf::ModelInterfaceSharedPtr model
Definition: Robot.hpp:126
std::vector< smurf::Sensor * > sensors
Definition: Robot.hpp:133
std::vector< smurf::StaticTransformation * > staticTransforms
Definition: Robot.hpp:130
Definition: ContactParams.hpp:7
std::vector< smurf::Joint * > joints
Definition: Robot.hpp:132
Definition: Collidable.hpp:11
std::vector< smurf::Frame * > availableFrames
Definition: Robot.hpp:129