SMORES Robot Platform Simulation
Modlab at Penn, ASL at Cornell
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends
GaitRecorder.hh
1 
3 #ifndef _GAZEBO_GAIT_RECORDER_HH_
4 #define _GAZEBO_GAIT_RECORDER_HH_
5 
6 #include "WorldServer.hh"
7 #include "gait_recorder_message.pb.h"
8 #include "util.hh"
10 #define INTIALCONFIGURATION "InitialConfiguration"
11 
12 using std::string;
13 using std::vector;
15 typedef const boost::shared_ptr
16  <const gait_recorder_message::msgs::GaitRecMessage> GaitRecMessagePtr;
17 
18 namespace gazebo{
20 
23 {
24  public:
26  PoseRecord();
28 
35  PoseRecord(double joint0, double joint1, double joint2, double joint3,
36  math::Pose pos);
38 
45  void UpdateJoints(double joint0, double joint1, double joint2, double joint3,
46  math::Pose pos);
47  public:
49  double JointAngles[4];
51  math::Pose Position;
52 }; // class PoseRecord
54 
57 class Frame
58 {
59  public:
61 
64  Frame(string frame_name);
66 
69  void AddAPosition(PoseRecord pos_rec);
71 
74  unsigned int GetPositionSize(void) const;
76 
80  PoseRecord GetPosition(unsigned int idx) const;
81  public:
83  string frameName;
84  private:
86  vector<PoseRecord> modulePositions;
87 };
89 class GaitRecorder : public WorldServer
90 {
91  public:
93  GaitRecorder();
95  ~GaitRecorder();
97 
101  void ExtraInitializationInLoad(physics::WorldPtr _parent,
102  sdf::ElementPtr _sdf);
104 
107  void ExtraWorkWhenModelInserted(CommandMessagePtr &msg);
109 
112  void RecordCurrentPose(Frame &current_frame);
114 
117  void SetPose(const Frame *a_frame);
118  private:
120 
123  void GaitRecorderMessageDecoding(GaitRecMessagePtr &msg);
124  private:
126  vector<Frame> frames;
128  transport::SubscriberPtr gaitInfoSub;
129 }; // class GaitRecorder
130 } // PoseRecord
131 
132 #endif
double JointAngles[4]
Joint angles of the module.
Definition: GaitRecorder.hh:49
gazebo name space
Definition: system_gui.cc:41
Frame(string frame_name)
Constructor.
Definition: GaitRecorder.cc:33
string frameName
Section name string.
Definition: GaitRecorder.hh:83
PoseRecord()
Constructor.
Definition: GaitRecorder.cc:8
void RecordCurrentPose(Frame &current_frame)
Record the current position of all modules.
Definition: GaitRecorder.cc:222
Definition: WorldServer.hh:80
The class that will be used to record the position information of a module.
Definition: GaitRecorder.hh:22
void ExtraWorkWhenModelInserted(CommandMessagePtr &msg)
Callback after a model inserted.
Definition: GaitRecorder.cc:67
~GaitRecorder()
Deconstructor.
Definition: GaitRecorder.cc:53
math::Pose Position
Global position of the module.
Definition: GaitRecorder.hh:51
unsigned int GetPositionSize(void) const
Get the size of position records.
Definition: GaitRecorder.cc:41
PoseRecord GetPosition(unsigned int idx) const
Get a position record with a position index.
Definition: GaitRecorder.cc:45
void ExtraInitializationInLoad(physics::WorldPtr _parent, sdf::ElementPtr _sdf)
The function that perform extra initialization.
Definition: GaitRecorder.cc:54
This clase used to store the initial position information of a section.
Definition: GaitRecorder.hh:57
Gait recorder python GUI application.
Definition: GaitRecorder.py:1
void AddAPosition(PoseRecord pos_rec)
Add a position record of a module.
Definition: GaitRecorder.cc:37
void SetPose(const Frame *a_frame)
Set the position to the initial state of a section.
Definition: GaitRecorder.cc:238
void UpdateJoints(double joint0, double joint1, double joint2, double joint3, math::Pose pos)
Update the current record.
Definition: GaitRecorder.cc:23
GaitRecorder()
Constructor.
Definition: GaitRecorder.cc:50