Skip to content

Commit

Permalink
finishing touches
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen committed Jun 26, 2024
1 parent 969865d commit e5de244
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/components.jl
Original file line number Diff line number Diff line change
Expand Up @@ -306,16 +306,16 @@ Representing a body with 3 translational and 3 rotational degrees-of-freedom.
@variables phid(t)[1:3]=phid0 [state_priority = 10]
@variables phidd(t)[1:3]=zeros(3) [state_priority = 10]
phi, phid, phidd = collect.((phi, phid, phidd))
ar = axes_rotations([1, 2, 3], phi, phid)
ar = axes_rotations([1, 2, 3], phi, -phid) # NOTE: this - sign is mysterious, it was not required before the change to axis_rotation in https://github.com/JuliaComputing/Multibody.jl/pull/93, but the change in the PR was checked by comparing Multibody.RotX(pi/2) and angle = pi/2; [1 0 0; 0 cos(angle) sin(angle); 0 -sin(angle) cos(angle)] which is the modelica implementation of RotX. It appears related to vef_from_R, if the - is removed, vel_from_R can be set to false in swing example.
Equation[
phid .~ D.(phi)
phidd .~ D.(phid)
Ra ~ ar
Ra.w .~ w_a
Ra.w .~ ar.w
if vel_from_R
w_a .~ angular_velocity2(ori(frame_a, false)) # This is required for FreeBody and ThreeSprings tests to pass, but the other one required for harmonic osciallator without joint to pass. FreeBody passes with quat=true so we use that instead
else
w_a .~ ar.w # This one for most systems
w_a .~ angular_velocity2(ar) # This one for most systems
end
]
end
Expand Down
3 changes: 2 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ using LinearAlgebra
# @testset "Rolling wheel" begin
@mtkmodel WheelInWorld begin
@components begin
world = World(render=true)
world = W()
wheel = RollingWheel(radius = 0.3, m = 2, I_axis = 0.06,
I_long = 0.12,
x0 = 0.2,
Expand All @@ -675,6 +675,7 @@ end
@named worldwheel = WheelInWorld()
worldwheel = complete(worldwheel)

# pars = collect(worldwheel.world.n) .=> [0,0,-1];
defs = Dict([
collect(worldwheel.world.n) .=> [0,0,-1];
worldwheel.wheel.body.r_0[1] => 0.2;
Expand Down

0 comments on commit e5de244

Please sign in to comment.