forked from equinor/flotilla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRobotPoseTimeseries.cs
45 lines (36 loc) · 1.21 KB
/
RobotPoseTimeseries.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
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
namespace Api.Database.Models
{
// Cannot use Pose as owned entity in keyless entity
// https://learn.microsoft.com/en-us/ef/core/modeling/keyless-entity-types?tabs=data-annotations
[Keyless]
public class RobotPoseTimeseries : TimeseriesBase
{
[Required]
public float PositionX { get; set; }
[Required]
public float PositionY { get; set; }
[Required]
public float PositionZ { get; set; }
[Required]
public float OrientationX { get; set; }
[Required]
public float OrientationY { get; set; }
[Required]
public float OrientationZ { get; set; }
[Required]
public float OrientationW { get; set; }
public RobotPoseTimeseries(Pose pose)
{
PositionX = pose.Position.X;
PositionY = pose.Position.Y;
PositionZ = pose.Position.Z;
OrientationX = pose.Orientation.X;
OrientationY = pose.Orientation.Y;
OrientationZ = pose.Orientation.Z;
OrientationW = pose.Orientation.W;
}
public RobotPoseTimeseries() { }
}
}