update Subroutine

private recursive subroutine update(self, t)

Update this frame and its descendants for simulation time t (followed trajectories set positions and attitudes).

Type Bound

ReferenceFrame

Arguments

Type IntentOptional Attributes Name
class(ReferenceFrame), intent(inout), target :: self
real(kind=wp), intent(in) :: t

simulation time


Calls

proc~~update~~CallsGraph proc~update ReferenceFrame%update proc~followed_pose followed_pose proc~update->proc~followed_pose proc~update~2 TrajectoryFollower%update proc~update->proc~update~2 proc~quat_from_matrix quat_from_matrix proc~followed_pose->proc~quat_from_matrix proc~quat_multiply quat_multiply proc~followed_pose->proc~quat_multiply proc~quat_normalize quat_normalize proc~followed_pose->proc~quat_normalize proc~rigid_inverse rigid_inverse proc~followed_pose->proc~rigid_inverse proc~state_at TrajectoryFollower%state_at proc~followed_pose->proc~state_at proc~world_matrix_at ReferenceFrame%world_matrix_at proc~followed_pose->proc~world_matrix_at proc~update~2->proc~state_at proc~chosen_trajectory chosen_trajectory proc~state_at->proc~chosen_trajectory proc~data_valid TrajectoryFollower%data_valid proc~state_at->proc~data_valid proc~interpolate_attitude interpolate_attitude proc~state_at->proc~interpolate_attitude proc~interpolate_position interpolate_position proc~state_at->proc~interpolate_position proc~time_index Trajectory%time_index proc~state_at->proc~time_index proc~wrapped_time wrapped_time proc~state_at->proc~wrapped_time proc~world_matrix_at->proc~world_matrix_at proc~local_matrix_at ReferenceFrame%local_matrix_at proc~world_matrix_at->proc~local_matrix_at proc~time_distance Trajectory%time_distance proc~chosen_trajectory->proc~time_distance proc~verify_data Trajectory%verify_data proc~data_valid->proc~verify_data proc~attitude~3 Trajectory%attitude proc~interpolate_attitude->proc~attitude~3 proc~num_attitudes Trajectory%num_attitudes proc~interpolate_attitude->proc~num_attitudes proc~quat_slerp quat_slerp proc~interpolate_attitude->proc~quat_slerp proc~num_points Trajectory%num_points proc~interpolate_position->proc~num_points proc~point_between Trajectory%point_between proc~interpolate_position->proc~point_between proc~point~2 Trajectory%point proc~interpolate_position->proc~point~2 proc~local_matrix_at->proc~followed_pose proc~frame_matrix frame_matrix proc~local_matrix_at->proc~frame_matrix proc~time_index->proc~time_distance proc~time_range~3 Trajectory%time_range proc~wrapped_time->proc~time_range~3 proc~quat_to_matrix quat_to_matrix proc~frame_matrix->proc~quat_to_matrix proc~point_between->proc~num_points proc~point_between->proc~point~2 proc~time_fraction Trajectory%time_fraction proc~point_between->proc~time_fraction

Called by

proc~~update~~CalledByGraph proc~update ReferenceFrame%update proc~drawable_update DrawableTrajectory%drawable_update proc~drawable_update->proc~update proc~fm_update FrameManager%fm_update proc~fm_update->proc~update proc~sphere_update Sphere%sphere_update proc~sphere_update->proc~update proc~terrain_update TerrainBody%terrain_update proc~terrain_update->proc~update

Source Code

    recursive subroutine update(self, t)
        class(ReferenceFrame), intent(inout), target :: self
        real(wp), intent(in) :: t                           !! simulation time
        logical :: has_position, has_attitude
        real(wp) :: pos(3), att(4)
        integer :: k
        if (self%following) then
            if (associated(self%follow_frame_)) then        ! (the data in another frame's coordinates)
                pos = self%position_
                att = self%attitude_
                call self%follower_%update(t, pos, att, has_position, has_attitude)   ! (its time and trajectory)
                call followed_pose(self, t, self%position_, self%attitude_)
            else
                call self%follower_%update(t, self%position_, self%attitude_, has_position, has_attitude)
            end if
        end if
        do k = 1, self%n_children
            call self%children(k)%p%update(t)
        end do
    end subroutine update