Data container and its handling interfaces

Frames

Frames is the module that handles data container for attitude frame representation. Please visit frames for notation and detailed explanation of the attitude frame representation

FlexibleSpacecraft.Frames.FrameType
struct Frame(x::Vector{Real}, y::Vector{Real}, z::Vector{Real})

Struct of immutable vectors that express the coordinate frame of a certain state

source
Base.:*Method
Base. :*(C::Union{SMatrix{3, 3, <:Real}, Matrix{<:Real}}, refframe::Frame)::Frame

Calculate the transformed frame with transformation matrix C with respect to refframe

source
Base.:-Method
Base.:-(a::Frame, b::Frame)::Frame

Subtraction operator for struct Frame.

source
FlexibleSpacecraft.Frames.ECI2BodyFrameMethod
ECI2BodyFrame

Calculate the transformation matrix from ECI frame to spacecraft body-fixed frame.

Arguments

  • q::SVector{4, Float64}: vector of the quaternion

Return

  • C_ECI2BRF::SMatrix{3, 3, Float64}: transformation matrix
source

DataContainers

DataContainers.jl is the set of function that deals with the handling of all the necessary data container of the simulation.

Dispatch of the `::AbstractVector{<:AbstractVector}`

This submodule also includes the multiple dispatch for the ::AbstractVector{<:AbstractVector} type data container used for simulation. Please be noted that you may need to pay attention to this feature when you manually code your simulation using the ::AbstractVector{<:AbstractVector} type variables.

Base.getindexMethod
Base.getindex(v::AbstractVector{<:AbstractVector}, r::Int, datarow::Int)

get datarow-th element of the r-th vector in the v::AbstractVector{<:AbstractVector}

Example

> angularvelocity # ::AbstractVector{<:AbstractVector}
10-element Vector{Vector{Int64}}:
 [1, 2, 3]
 [1, 2, 3]
 ⋮
 [1, 2, 3]
 [1, 2, 3]

> angularvelocity[1]
3-element Vector{Int64}: # get the first vector
 1
 2
 3

> angularvelocity[3, 2] # get the 2st element of the 3rd vector of the `angularvelocity`
2
source
Base.getindexMethod
Base.getindex(v::AbstractVector{<:AbstractVector}, r::AbstractRange, datarow::Int)

get a 1-D subset of the every datarow-th value of the inner vector v::AbstractVector{<:AbstractVector} within the specified range r::AbstractRange.

Example

> angularvelocity # ::AbstractVector{<:AbstractVector}
10-element Vector{Vector{Int64}}:
 [1, 2, 3]
 [1, 2, 3]
 ⋮
 [1, 2, 3]
 [1, 2, 3]

> angularvelocity[1]
3-element Vector{Int64}: # get the first vector
 1
 2
 3

> angularvelocity[1:5, 1] # get the 1st element of the 1st to 5th vector of the
 5-element Vector{Int64}:
  1
  1
  1
  1
  1
source