Skip to content

Commit 5859606

Browse files
committed
pass in defaults
1 parent 4a44372 commit 5859606

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/PlanarMechanics/joints.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""
2-
Revolute(; name, phi = 0.0, tau = 0.0, use_flange = false)
2+
Revolute(; name, phi = 0.0, tau = 0.0, axisflange = false)
33
A revolute joint
44
55
# parameters
6-
- `use_flange=false`: If `true`, a force flange is enabled, otherwise implicitly grounded"
6+
- `axisflange=false`: If `true`, a force flange is enabled, otherwise implicitly grounded"
77
- `phi`: [rad] Initial angular position for the flange
88
- `tau`: [N.m] Initial Cut torque in the flange
99
@@ -16,22 +16,22 @@ A revolute joint
1616
# Connectors
1717
- `frame_a` [Frame](@ref)
1818
- `frame_b` [Frame](@ref)
19-
- `fixed` [Fixed](@ref) if `use_flange == false`
20-
- `flange_a` [Flange](@ref) if `use_flange == true`
21-
- `support` [Support](@ref) if `use_flange == true`
19+
- `fixed` [Fixed](@ref) if `axisflange == false`
20+
- `flange_a` [Flange](@ref) if `axisflange == true`
21+
- `support` [Support](@ref) if `axisflange == true`
2222
2323
https://github.com/dzimmer/PlanarMechanics/blob/743462f58858a808202be93b708391461cbe2523/PlanarMechanics/Joints/Revolute.mo
2424
"""
2525
@component function Revolute(;
2626
name,
27-
use_flange = false, render = true, radius = 0.1, color = [1.0, 0.0, 0.0, 1.0])
27+
axisflange = false, render = true, radius = 0.1, color = [1.0, 0.0, 0.0, 1.0], phi=0, w=0)
2828
@named partial_frames = PartialTwoFrames()
2929
@unpack frame_a, frame_b = partial_frames
3030
systems = [frame_a, frame_b]
3131

3232
vars = @variables begin
33-
(phi(t) = 0.0), [state_priority=10]
34-
(ω(t) = 0.0), [state_priority=10]
33+
(phi(t) = phi), [state_priority=10]
34+
(w(t) = w), [state_priority=10]
3535
α(t)
3636
tau(t)
3737
end
@@ -43,8 +43,8 @@ https://github.com/dzimmer/PlanarMechanics/blob/743462f58858a808202be93b70839146
4343
end
4444

4545
eqs = [
46-
ω ~ D(phi),
47-
α ~ D(ω),
46+
w ~ D(phi),
47+
α ~ D(w),
4848
# rigidly connect positions
4949
frame_a.x ~ frame_b.x,
5050
frame_a.y ~ frame_b.y,
@@ -57,7 +57,7 @@ https://github.com/dzimmer/PlanarMechanics/blob/743462f58858a808202be93b70839146
5757
frame_a.tau ~ tau
5858
]
5959

60-
if use_flange
60+
if axisflange
6161
@named fixed = Rotational.Fixed()
6262
push!(systems, fixed)
6363
@named flange_a = Rotational.Flange(; phi, tau)

0 commit comments

Comments
 (0)