You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get the orientation of `sys` as a `RotationMatrix` object. See also [`get_rot`](@ref). `ori(frame).R` is the rotation matrix that rotates a vector from the world coordinate system to the local frame.
15
17
16
-
For frames, the orientation is stored in the metadata field of the system as `sys.metadata[:orientation]`.
18
+
For frames, the orientation is stored in the metadata field of the system as `get_metadata(sys)[:orientation]`.
17
19
18
20
If `varw = true`, the angular velocity variables `w` of the frame is also included in the `RotationMatrix` object, otherwise `w` is derived as the time derivative of `R`. `varw = true` is primarily used when selecting a component as root.
19
21
"""
20
22
functionori(sys, varw =false)
21
-
if sys.metadata isa Dict && (O =get(sys.metadata, :orientation, nothing)) !==nothing
23
+
md =get_metadata(sys)
24
+
if md isa Dict && (O =get(md, :orientation, nothing)) !==nothing
22
25
R =collect(O.R)
23
26
# Since we are using this function instead of sys.ori, we need to handle namespacing properly as well
@testget_rot(sol, body.frame_a, pi/2)*[0,1,0] ≈ [0,0,1] atol=1e-3# Same test as above, but in one other way for sanity. They y-axis basis vector is rotated around x axis which aligns it with the z-axis basis vector. get_rot is used for this, which is the transpose of get_R
0 commit comments