forked from equinor/flotilla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPose.cs
89 lines (78 loc) · 1.82 KB
/
Pose.cs
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
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
#nullable disable
namespace Api.Database.Models
{
[Owned]
public class Orientation
{
public float X { get; set; }
public float Y { get; set; }
public float Z { get; set; }
public float W { get; set; }
public Orientation()
{
X = 0;
Y = 0;
Z = 0;
W = 1;
}
public Orientation(float x = 0, float y = 0, float z = 0, float w = 1)
{
X = x;
Y = y;
Z = z;
W = w;
}
}
[Owned]
public class Position
{
public float X { get; set; }
public float Y { get; set; }
public float Z { get; set; }
public Position()
{
X = 0;
Y = 0;
Z = 0;
}
public Position(float x = 0, float y = 0, float z = 0)
{
X = x;
Y = y;
Z = z;
}
}
[Owned]
public class Pose
{
[Required]
public Position Position { get; set; }
[Required]
public Orientation Orientation { get; set; }
[MaxLength(64)]
public string Frame { get; set; }
public Pose()
{
Position = new Position();
Orientation = new Orientation();
Frame = "defaultFrame";
}
public Pose(
float x_pos,
float y_pos,
float z_pos,
float x_ori,
float y_ori,
float z_ori,
float w,
string frame
)
{
Position = new Position(x_pos, y_pos, z_pos);
Orientation = new Orientation(x_ori, y_ori, z_ori, w);
Frame = frame;
}
}
}