Follows trajectories (see the module documentation).
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | current | = | 0 |
index (in trajs) of the trajectory last followed |
|
| integer, | private | :: | data_ | = | FOLLOW_POSITION+FOLLOW_ATTITUDE |
what is followed (FOLLOW_* combined with ior) |
|
| logical, | private | :: | default_data | = | .true. |
(true: sources_ are the trajectories' positions) |
|
| logical, | private | :: | follow_time | = | .true. |
(true: simulation time + time_value; false: time_value) |
|
| real(kind=wp), | private | :: | last_time_ | = | 0.0_wp |
time (after looping) at the last update (s) |
|
| integer, | private | :: | mode_ | = | FOLLOW_LOOP |
FOLLOW_LOOP or FOLLOW_LIMIT |
|
| integer, | private | :: | n | = | 0 |
number of followed trajectories |
|
| type(DataSource), | private | :: | sources_(3) |
where the followed position's x, y, z come from |
|||
| integer, | private | :: | stamp_ | = | 0 |
motion stamp of the last change of settings (next_motion_stamp) |
|
| real(kind=wp), | private | :: | time_value | = | 0.0_wp |
time offset or fixed time (s) |
|
| type(TrajectoryPointer), | private, | allocatable | :: | trajs(:) |
(capacity): the followed trajectories |
Also follow traj (no effect if it is already followed).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(inout) | :: | self | |||
| type(Trajectory), | intent(in), | pointer | :: | traj |
the trajectory to add (not owned; null: none) |
The sum of the followed trajectories' revisions and generations: it grows with any change to their data (the set of trajectories itself changes the motion_stamp).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(in) | :: | self |
Where the followed position's x, y and z come from.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(in) | :: | self |
True if every followed trajectory has the data the position sources use.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(in) | :: | self |
What is followed: FOLLOW_POSITION and/or FOLLOW_ATTITUDE (combined with ior).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(in) | :: | self |
How time outside the trajectories is handled: FOLLOW_LOOP or FOLLOW_LIMIT.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(in) | :: | self |
True if following the simulation time plus an offset, false for a fixed time.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(in) | :: | self |
The time (after looping) at the last update.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(in) | :: | self |
The trajectory followed at the last update (null if none).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(in) | :: | self |
The stamp of the last change of the follower's settings (the trajectories followed, what and how, the time); 0 if never changed.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(in) | :: | self |
Number of trajectories followed.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(in) | :: | self |
Stop following all trajectories.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(inout) | :: | self |
Stop following traj.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(inout) | :: | self | |||
| type(Trajectory), | intent(in), | pointer | :: | traj |
the trajectory to stop following |
Use the trajectories' positions (per the first trajectory's DOF).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(inout) | :: | self |
What to follow (FOLLOW_POSITION and/or FOLLOW_ATTITUDE, combined with ior) and how (FOLLOW_LOOP or FOLLOW_LIMIT).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | data |
FOLLOW_POSITION and/or FOLLOW_ATTITUDE (ior) |
||
| integer, | intent(in) | :: | mode |
FOLLOW_LOOP or FOLLOW_LIMIT |
Follow at the simulation time plus offset (the default, offset 0).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | offset |
added to the simulation time (s) |
Follow at a fixed time (independent of the simulation time).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | t |
the time (s) |
Follow only traj (none if it is not associated).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(inout) | :: | self | |||
| type(Trajectory), | intent(in), | pointer | :: | traj |
the trajectory to follow (not owned; null: none) |
Where the x, y and z of the followed position come from (default: the trajectories' positions). Returns whether all followed trajectories have those data.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(inout) | :: | self | |||
| type(DataSource), | intent(in) | :: | src |
where the x comes from |
Where the y of the followed position comes from (see set_x_data).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(inout) | :: | self | |||
| type(DataSource), | intent(in) | :: | src |
where the y comes from |
Where the z of the followed position comes from (see set_x_data).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(inout) | :: | self | |||
| type(DataSource), | intent(in) | :: | src |
where the z comes from |
The position and attitude followed at simulation time sim_time, as
update (the same time mapping, choice of trajectory and
interpolation) but without changing the follower: for any time, e.g.
a frame's pose at a trajectory point's own time.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(in) | :: | 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; unchanged if none) |
||
| real(kind=wp), | intent(inout) | :: | attitude(4) |
the followed attitude (quaternion [x, y, z, w]; unchanged if none) |
||
| logical, | intent(out) | :: | has_position |
(true: position / attitude set) |
||
| logical, | intent(out) | :: | has_attitude |
(true: position / attitude set) |
||
| real(kind=wp), | intent(out), | optional | :: | time |
the trajectories' time used (after the offset and looping) |
|
| integer, | intent(out), | optional | :: | chosen |
the trajectory used (index in the followed ones) |
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) |
True if the followed position is the trajectories' positions (set_default_data).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(in) | :: | self |
type, public :: TrajectoryFollower private type(TrajectoryPointer), allocatable :: trajs(:) !! (capacity): the followed trajectories integer :: n = 0 !! number of followed trajectories integer :: current = 0 !! index (in trajs) of the trajectory last followed integer :: mode_ = FOLLOW_LOOP !! FOLLOW_LOOP or FOLLOW_LIMIT integer :: data_ = FOLLOW_POSITION + FOLLOW_ATTITUDE !! what is followed (FOLLOW_* combined with ior) type(DataSource) :: sources_(3) !! where the followed position's x, y, z come from logical :: default_data = .true. !! (true: sources_ are the trajectories' positions) logical :: follow_time = .true. !! (true: simulation time + time_value; false: time_value) real(wp) :: time_value = 0.0_wp !! time offset or fixed time (s) real(wp) :: last_time_ = 0.0_wp !! time (after looping) at the last update (s) integer :: stamp_ = 0 !! motion stamp of the last change of settings (next_motion_stamp) contains procedure :: set_trajectory, add_trajectory, remove_trajectory, remove_all procedure :: num_trajectories procedure :: set_follow_type, follow_mode, follow_data procedure :: set_x_data, set_y_data, set_z_data, data_sources procedure :: set_default_data, using_default_data, data_valid procedure :: set_time, set_offset_time, is_following_time procedure :: last_time, last_trajectory procedure :: update, state_at procedure :: motion_stamp, data_revision end type TrajectoryFollower