The position and attitude at simulation time sim_time. has_position
and has_attitude say whether each could be computed (and is being
followed); otherwise position / attitude are left unchanged.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | sim_time |
simulation time (s) |
||
| real(kind=wp), | intent(inout) | :: | position(3) |
the followed position (in the trajectories' frame) |
||
| real(kind=wp), | intent(inout) | :: | attitude(4) |
the followed attitude (quaternion [x, y, z, w]) |
||
| logical, | intent(out) | :: | has_position |
(true: position / attitude set) |
||
| logical, | intent(out) | :: | has_attitude |
(true: position / attitude set) |
subroutine update(self, sim_time, position, attitude, has_position, has_attitude) class(TrajectoryFollower), intent(inout) :: self real(wp), intent(in) :: sim_time !! simulation time (s) real(wp), intent(inout) :: position(3) !! the followed position (in the trajectories' frame) real(wp), intent(inout) :: attitude(4) !! the followed attitude (quaternion [x, y, z, w]) logical, intent(out) :: has_position, has_attitude !! (true: position / attitude set) integer :: k real(wp) :: t call self%state_at(sim_time, position, attitude, has_position, has_attitude, t, k) if (self%n == 0) return self%last_time_ = t self%current = k end subroutine update