Project.h
Go to the documentation of this file.
1 #ifndef __PROJECT_H__
2 #define __PROJECT_H__
3 
4 #include <string>
5 #include <vector>
6 #include <map>
7 #include <hrpUtil/Eigen3d.h>
8 
10 public:
11  std::string objectName1;
12  std::string objectName2;
13  std::string jointName1;
14  std::string jointName2;
17  double cullingThresh;
18  double restitution;
19  std::string sprintDamperModel;
20 
22  jointName1 = "";
23  jointName2 = "";
24  slidingFriction = 0.5;
25  staticFriction = 0.5;
26  cullingThresh = 0.01;
27  restitution = 0.0;
28  sprintDamperModel = "false";
29  }
30 };
31 
32 class JointItem {
33 public:
34  JointItem() :
35  angle(0), isHighGain(false), NumOfAABB(0),
36  translation(hrp::Vector3::Zero()),
37  rotation(hrp::Matrix33::Identity()),
38  linearVelocity(hrp::Vector3::Zero()),
39  angularVelocity(hrp::Vector3::Zero()){}
40  double angle;
41  bool isHighGain;
42  int NumOfAABB;
45  hrp::Vector3 linearVelocity, angularVelocity;
46  std::string collisionShape;
47 };
48 
50 public:
52  jointAxis(0,0,1),
53  link1LocalPos(0,0,0), link2LocalPos(0,0,0),
54  jointType("xyz"){}
56  hrp::Vector3 link1LocalPos, link2LocalPos;
57  std::string object1Name, object2Name, link1Name, link2Name, jointType;
58 };
59 
60 class ModelItem {
61 public:
62  std::string url;
63  std::map<std::string,JointItem> joint;
64  std::string rtcName;
65  std::vector<std::string > inports;
66  std::vector<std::string > outports;
67 };
68 
69 class RTSItem {
70 public:
71  class rtc{
72  public:
73  rtc() : period(0.0){}
74  std::string name;
75  std::string path;
76  double period;
77  std::vector<std::pair<std::string, std::string> > configuration;
78  };
79  std::map<std::string, rtc> components;
80  std::vector<std::pair<std::string, std::string> > connections;
81 };
82 
84 {
85 public:
87  hostname("localhost"), RobotHardwareName("RobotHardware0"),
88  StateHolderName("StateHolder0"), port(2809), interval(100){}
89  std::string hostname, RobotHardwareName, StateHolderName;
90  int port, interval;
91 };
92 
94 {
95 public:
96  ThreeDView();
97  bool showScale, showCoM, showCoMonFloor, showCollision;
98  double T[16];
99 };
100 
101 class Project{
102 public:
103  Project();
104  bool parse(const std::string &filename);
105  double timeStep() { return m_timeStep; }
106  double totalTime() { return m_totalTime; }
107  void totalTime(double time) { m_totalTime = time; }
108  double logTimeStep() { return m_logTimeStep; }
109  double gravity() { return m_gravity; }
110  bool isEuler() { return m_isEuler; }
111  bool kinematicsOnly() { return m_kinematicsOnly; }
112  bool realTime() { return m_realTime; }
113  void realTime(bool flag) { m_realTime = flag; }
114  std::map<std::string, ModelItem>& models(){ return m_models; }
115  std::vector<CollisionPairItem>& collisionPairs() { return m_collisionPairs; }
116  std::vector<ExtraJointItem>& extraJoints() { return m_extraJoints; }
117  RTSItem &RTS() { return m_rts; }
119  ThreeDView &view() { return m_3dview; }
120 private:
121  double m_timeStep, m_logTimeStep;
122  double m_totalTime;
123  double m_gravity;
124  bool m_isEuler;
127  std::map<std::string, ModelItem> m_models;
128  std::vector<CollisionPairItem> m_collisionPairs;
129  std::vector<ExtraJointItem> m_extraJoints;
133 };
134 #endif
std::map< std::string, rtc > components
Definition: Project.h:79
bool showScale
Definition: Project.h:97
hrp::Vector3 linearVelocity
Definition: Project.h:45
std::vector< ExtraJointItem > & extraJoints()
Definition: Project.h:116
ExtraJointItem()
Definition: Project.h:51
double m_totalTime
Definition: Project.h:122
char * filename
JointItem()
Definition: Project.h:34
std::string collisionShape
Definition: Project.h:46
double slidingFriction
Definition: Project.h:15
std::vector< CollisionPairItem > m_collisionPairs
Definition: Project.h:128
bool m_kinematicsOnly
Definition: Project.h:125
RobotHardwareClientView & RobotHardwareClient()
Definition: Project.h:118
std::string objectName1
Definition: Project.h:11
OpenHRP::matrix33 Matrix33
std::vector< std::string > outports
Definition: Project.h:66
std::string jointName2
Definition: Project.h:14
ThreeDView m_3dview
Definition: Project.h:132
Eigen::Vector3d Vector3
Eigen::Matrix3d Matrix33
void totalTime(double time)
Definition: Project.h:107
OpenHRP::vector3 Vector3
std::string url
Definition: Project.h:62
RTSItem m_rts
Definition: Project.h:130
hrp::Matrix33 rotation
Definition: Project.h:44
std::string rtcName
Definition: Project.h:64
double totalTime()
Definition: Project.h:106
std::string name
Definition: Project.h:74
double restitution
Definition: Project.h:18
bool realTime()
Definition: Project.h:112
double staticFriction
Definition: Project.h:16
std::map< std::string, ModelItem > m_models
Definition: Project.h:127
ThreeDView & view()
Definition: Project.h:119
std::map< std::string, ModelItem > & models()
Definition: Project.h:114
std::string sprintDamperModel
Definition: Project.h:19
RobotHardwareClientView m_rhview
Definition: Project.h:131
RTSItem & RTS()
Definition: Project.h:117
double gravity()
Definition: Project.h:109
std::string jointName1
Definition: Project.h:13
double period
Definition: Project.h:76
bool kinematicsOnly()
Definition: Project.h:111
hrp::Vector3 link2LocalPos
Definition: Project.h:56
std::vector< ExtraJointItem > m_extraJoints
Definition: Project.h:129
std::vector< std::string > inports
Definition: Project.h:65
std::vector< std::pair< std::string, std::string > > configuration
Definition: Project.h:77
double angle
Definition: Project.h:40
std::string objectName2
Definition: Project.h:12
double m_gravity
Definition: Project.h:123
int NumOfAABB
Definition: Project.h:42
bool isEuler()
Definition: Project.h:110
bool isHighGain
Definition: Project.h:41
std::vector< std::pair< std::string, std::string > > connections
Definition: Project.h:80
std::map< std::string, JointItem > joint
Definition: Project.h:63
double logTimeStep()
Definition: Project.h:108
double cullingThresh
Definition: Project.h:17
hrp::Vector3 translation
Definition: Project.h:43
std::string object2Name
Definition: Project.h:57
std::string path
Definition: Project.h:75
hrp::Vector3 jointAxis
Definition: Project.h:55
bool m_realTime
Definition: Project.h:126
double timeStep()
Definition: Project.h:105
double m_timeStep
Definition: Project.h:121
std::string StateHolderName
Definition: Project.h:89
std::vector< CollisionPairItem > & collisionPairs()
Definition: Project.h:115
bool m_isEuler
Definition: Project.h:124
void realTime(bool flag)
Definition: Project.h:113


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Sat Dec 17 2022 03:52:20