-
Notifications
You must be signed in to change notification settings - Fork 1
/
uwv_dynamic_model.orogen
128 lines (93 loc) · 3.7 KB
/
uwv_dynamic_model.orogen
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
name "uwv_dynamic_model"
using_library "uwv_dynamic_model"
using_library "numeric" # Imports SavitzkyGolayFilter's library
import_types_from "base"
import_types_from "uwv_dynamic_model/DataTypes.hpp"
import_types_from "uwv_dynamic_modelTypes.hpp"
typekit.export_types 'uwv_dynamic_model/DynamicStates'
task_context "Task" do
needs_configuration
#*************************
#*** PROPERTIES ***
#*************************
# Parameters of the motion model
property("model_parameters", "uwv_dynamic_model/UWVParameters")
# Simulations per cycle.
property("sim_per_cycle", "int", 10)
# Name of the source frame
property("source_frame", "std/string", "body")
# Name of the target frame
property("target_frame", "std/string", "world")
# Velocity uncertainty values. This values are integrated in order to obtain the pose uncertainty
property("velocity_uncertainty", "base/Vector6d")
#*************************
#*** I/O PORTS ***
#*************************
# Thrusters' commands
input_port("cmd_in", "/base/LinearAngular6DCommand")
# The new states after the thrusters' commands are applied
output_port("pose_samples", "/base/samples/RigidBodyState")
# Effort and acceleration values
output_port("secondary_states", "uwv_dynamic_model/SecondaryStates")
#*************************
#*** OTHERS ***
#*************************
operation("resetStates")
operation("setStates").
argument("pose_state", "/base/samples/RigidBodyState")
runtime_states :SIMULATING
exception_states :INPUT_TIMESTAMP_NOT_SET, :COMMAND_WITH_REPEATED_TIMESTAMP
periodic 0.01
end
# The aim of VelocityEstimator is to be a simple Model Based Velocity Estimator.
#
# It integrates sensors data direct to the model's states,
# without using any filter, like Kalman-Filter.
#
# It is based on the assumption that orientation, angular velocity
# and depth are provided by sensors at a high rate and precision.
#
# For acoustic sensor, i.e. dvl, whose latency time is significant,
# the component replays the model with storaged states and commands,
# correcting model's uncertainty with measured data.
#
# For the particular case of vertical velocity, depth sample is
# derived (using a Savitzky Golay filter), replacing data from dvl
# for this degree of freedom.
#
task_context "VelocityEstimator" do
subclasses "Task"
#*************************
#*** PROPERTIES ***
#*************************
# Savitzky Golay filter properties
# Used in deriving depth data for getting vertical velocity
#
# Order of polynomial
property("polynomial_order", "int", 3)
# Half_witdh. (half_width*2 +1) number of samples used.
property("half_width", "int", 16)
# Least_square point used. Choose between [-half_witdh, half_witdh]
property("least_square_point", "int", 16)
#*************************
#*** I/O PORTS ***
#*************************
# DVL's linear velocities samples
input_port("dvl_samples", "/base/samples/RigidBodyState")
# Orientation samples
input_port("orientation_samples", "/base/samples/RigidBodyState")
# IMU's angular velocities samples
input_port("imu_samples","/base/samples/IMUSensors")
# Pressure sensor's depth samples. Derivated for vertical velocity estimation.
input_port("depth_samples", "/base/samples/RigidBodyState")
#*************************
#*** TRANSFORMATIONS ***
#*************************
transformer do
transform "imu", "body"
transform "pressure_sensor", "body"
transform "dvl", "body"
max_latency 0.05
end
runtime_states :MISSING_TRANSFORMATION
end