-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathujl.h
146 lines (125 loc) · 2.81 KB
/
ujl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#pragma once
#include <Core/CoreAll.h>
#include <Fusion/FusionAll.h>
#include <CAM/CAMAll.h>
#include "inc/tinyxml.h"
#include "inc/easylogging/easylogging++.h"
#include <filesystem>
const double PI = 3.14159265359;
using namespace adsk::core;
using namespace adsk::fusion;
using namespace adsk::cam;
namespace fs = std::filesystem;
class OrVec
{
public:
std::string xyz = "0 0 0";
std::string rpy = "0 0 0";
double x = 0, y = 0, z = 0, r = 0, p = 0, yaw = 0;
bool isset = false;
/*OrVec() {
isset = false;
xyz = "0 0 0";
rpy = "0 0 0";
};*/
void setxyz(double xx, double yy, double zz);
void setrpy(double rr, double pp, double yy);
};
class Visual
{
public:
OrVec origin;
std::string geometryfilename = "";
std::string materialfilename = "";
std::string color = "0.792156862745098 0.819607843137255 0.933333333333333 1"; // the colour that was being used in our other files.i am used to it, so i will keep it
};
class Collision
{
public:
OrVec origin;
std::string geometryfilename = "";
};
class Inertia
{
public:
std::string ixx, ixy, ixz, iyy, iyz, izz;
void set(double, double, double, double, double, double);
};
class Inertial
{
public:
OrVec origin;
std::string mass = "0";
Inertia inertia;
void setall(double, double, double, double, double, double, double);
};
class Limit
{
public:
std::string lower = "-1";
std::string upper = "1";
std::string effort = "0";
std::string velocity = "0";
};
class UElement {
public:
int row;
std::string name;
virtual std::string getitems() { return "not implemented"; };
virtual void makexml(TiXmlElement*, std::string)
{
LOG(DEBUG) << "UELement virtual makexml function was called!";
};
UElement() {};
//UElement(UElement&) = default;
~UElement() {};
//std::string name;
};
class UJoint:public UElement
{
public:
//properties
std::string generatingjointname;
OrVec origin; //SixDegree origin;
OrVec realorigin;
std::string parentlink;
std::string childlink;
std::string axis;
Limit limit;
std::string type;
bool isset;
Ptr<Joint> entity;
//methods
UJoint() {
name = "";
generatingjointname = "";
axis = "0 0 0";
isset = false;
};
~UJoint() {};
void setjoint(Ptr<Joint> joint);
void setrealorigin(OrVec);
std::string getitems();
void makexml(TiXmlElement*, std::string);
// when sixdegree is working!
void setjoint(Ptr<Joint> joint, Ptr<CommandInput> cmdInput, Ptr<CommandInputs> inputs);
};
class ULink:public UElement
{
public:
//properties
Inertial inertial;
Visual visual;
Collision collision;
OrVec coordinatesystem;
bool isVirtual = true;
bool isBase = false;
std::vector<Ptr<Occurrence>> group;
Ptr<Joint> fatherjoint;
std::string parent;
//methods
std::string getitems();
void genfatherjoint(UJoint joint);
void makexml(TiXmlElement*, std::string);
bool genlink(fs::path, fs::path, Ptr<Design>, Ptr<Application>);
};