Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobleft committed Apr 6, 2024
2 parents 75f62a1 + f51411b commit 6dcebe6
Show file tree
Hide file tree
Showing 95 changed files with 5,692 additions and 1,892 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: '1.9'
version: '1.10'
- name: Install dependencies
run: julia -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
julia-version: ['1.9']
julia-version: ['1.10']
julia-arch: [x64]
group:
- ALL
Expand Down
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
Lux = "b2108857-7c20-44ae-9111-449ecde12c47"
LuxurySparse = "d05aeea4-b7d4-55ac-b691-9e7fabb07ba2"
MakieCore = "20f20a25-4f0e-4fdf-b5d1-57303727442b"
Meshes = "eacbb407-ea5a-433e-ab97-5258b1ca43fa"
Expand Down Expand Up @@ -57,6 +58,7 @@ Tullio = "bc48ee85-29a4-5162-ae0b-a64e1601d4bc"
TypeSortedCollections = "94a5cd58-49a0-5741-bd07-fa4f4be8babf"
TypedTables = "9d95f2ec-7b3d-5a63-8d20-e2491e220bb9"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[compat]
julia = "1.9"
Expand Down
4 changes: 2 additions & 2 deletions examples/bodies/build_2d_tri.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ state = RB.RigidBodyState(prop,ro,α,ṙo,ω)
coords = RB.NonminimalCoordinates(nmcs,ci,cstr_idx)
trimesh = begin
if id == 1
load(RB.assetpath("零件1 - 副本.STL")) |> make_patch(;scale=1/1000,color=:mediumpurple4)
load(RB.assetpath("零件1 - 副本.STL")) |> RB.make_patch(;scale=1/1000,color=:mediumpurple4)
else
load(RB.assetpath("零件1.STL")) |> make_patch(;scale=1/1000,color=:slategray4)
load(RB.assetpath("零件1.STL")) |> RB.make_patch(;scale=1/1000,color=:slategray4)
end
end
body = RB.RigidBody(prop,state,coords,trimesh)
Expand Down
2 changes: 1 addition & 1 deletion examples/bodies/make_3d_bar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ elseif loadmesh2
color=:palegreen3,
)
else
barmesh = endpoints2mesh(r̄p1,r̄p2;radius,)
barmesh = RB.endpoints2mesh(r̄p1,r̄p2;radius,)
end
body = RB.RigidBody(prop,state,coords,barmesh)
end
4 changes: 2 additions & 2 deletions examples/bodies/make_3d_plate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ function make_3d_plate(
visible = ci != Int[]
mat = filter(
row -> row.name == "Teak",
material_properties
RB.material_properties
)[1]
density = mat.density |> ustrip
if meshvisible
if loadmesh
platemesh = load("柚木板3.STL") |> make_patch(;rot=RotZ/4))
else
platemesh = endpoints2mesh(
platemesh = RB.endpoints2mesh(
SVector(0.0,0.0,-height/2),
SVector(0.0,0.0,height/2);
radius,n1=m,n2=2)
Expand Down
6 changes: 3 additions & 3 deletions examples/bodies/make_3d_tri.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,22 @@ pretty_table(
if loadmesh
trimesh = load(
RB.assetpath("球铰/零件1.stl")
) |> make_patch(;
) |> RB.make_patch(;
scale = 1/200,
color = :tomato1,
trans = [0,0,-0.39]
)
else
trimesh = GB.merge(
[
endpoints2mesh(loci_positions[i],loci_positions[j];
RB.endpoints2mesh(loci_positions[i],loci_positions[j];
radius,color)
for (i,j) in [
[1,2],[1,3],[1,4],
[2,3],[3,4],[4,2]
]
]
) |> make_patch(;color = :darkslategrey)
) |> RB.make_patch(;color = :darkslategrey)
# platemesh = endpoints2mesh(
# SVector(0.0,0.0,-height/2),
# SVector(0.0,0.0, height/2);
Expand Down
34 changes: 22 additions & 12 deletions examples/robots/Tbars.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,6 @@ function Tbars(;θ = 0, coordsType = RB.NCF.NC)
rbs = [base,slider1,slider2,bar]
rigdibodies = TypeSortedCollection(rbs)

j1 = RB.PrismaticJoint(1,RB.Hen2Egg(RB.ID(base,5,1),RB.ID(slider1,1,1)))
j2 = RB.PrismaticJoint(2,RB.Hen2Egg(RB.ID(base,5,2),RB.ID(slider2,1,1)))

j3 = RB.PinJoint(3,RB.Hen2Egg(RB.ID(bar,1,1),RB.ID(slider1,2,1)))
j4 = RB.PinJoint(4,RB.Hen2Egg(RB.ID(bar,2,1),RB.ID(slider2,2,1)))

js = [j1,j2,j3,j4]

ncables = 4
original_restlens = zeros(ncables)
original_restlens = zeros(ncables)
Expand All @@ -148,7 +140,7 @@ function Tbars(;θ = 0, coordsType = RB.NCF.NC)
cs = zeros(ncables)
spring_dampers = [RB.DistanceSpringDamper3D(original_restlens[i],ks[i],cs[i];slack=false) for i = 1:ncables]

cm = [
connecting_matrix = [
1 -1 0 0;
2 -1 0 0;
# 3 0 -1 0;
Expand All @@ -157,10 +149,19 @@ function Tbars(;θ = 0, coordsType = RB.NCF.NC)
7 -1 0 0;
]

cables = RB.connect(rigdibodies, spring_dampers, cm, 4)
cables = RB.connect(rigdibodies, spring_dampers; connecting_matrix,)


j1 = RB.PrismaticJoint(ncables+1,RB.Hen2Egg(RB.Signifier(base,5,1),RB.Signifier(slider1,1,1)))
j2 = RB.PrismaticJoint(ncables+2,RB.Hen2Egg(RB.Signifier(base,5,2),RB.Signifier(slider2,1,1)))

j3 = RB.PinJoint(ncables+3,RB.Hen2Egg(RB.Signifier(bar,1,1),RB.Signifier(slider1,2,1)))
j4 = RB.PinJoint(ncables+4,RB.Hen2Egg(RB.Signifier(bar,2,1),RB.Signifier(slider2,2,1)))

js = [j1,j2,j3,j4]

apparatuses = TypeSortedCollection(
vcat(js,cables)
vcat(cables,js)
)

# sm = [
Expand All @@ -173,5 +174,14 @@ function Tbars(;θ = 0, coordsType = RB.NCF.NC)
# ]
# indexed = RB.index(rigdibodies,sm)
st = RB.Structure(rigdibodies,apparatuses,)
RB.Robot(st,)
gauges = Int[]
actuators = Int[]
hub = RB.ControlHub(
st,
gauges,
actuators,
RB.Coalition(st,gauges,actuators)
)

RB.Robot(st,hub)
end
12 changes: 6 additions & 6 deletions examples/robots/birdneck.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ indexed = RB.index(rbs,sharing)
# ks = vcat(fill(k,naux),fill(k,ness))
# cs = fill(c,ncables)
# cables = [RB.DistanceSpringDamper2D(restlens[i],ks[i],cs[i];slack) for i = 1:ncables]
# acs = [RB.ManualActuator(1,collect(1:ncables),restlens[1:ncables])]
# acs = [RB.RegisterActuator(1,collect(1:ncables),restlens[1:ncables])]
# apparatuses = (cables = cables,)
# hub = (actuators = acs,)
cnt_matrix = [
Expand All @@ -133,10 +133,10 @@ cnt_matrix = [
connected = RB.connect(rbs,cnt_matrix)
# #

# cst1 = RB.PinJoint(RB.Hen2Egg(RB.ID(rb2,2),RB.ID(rb3,2)))
# cst2 = RB.PinJoint(RB.Hen2Egg(RB.ID(rb3,3),RB.ID(rb4,1)))
# cst3 = RB.PinJoint(RB.Hen2Egg(RB.ID(rb4,2),RB.ID(rb5,3)))
# cst4 = RB.PinJoint(RB.Hen2Egg(RB.ID(rb5,3),RB.ID(rb6,1)))
# cst1 = RB.PinJoint(RB.Hen2Egg(RB.Signifier(rb2,2),RB.Signifier(rb3,2)))
# cst2 = RB.PinJoint(RB.Hen2Egg(RB.Signifier(rb3,3),RB.Signifier(rb4,1)))
# cst3 = RB.PinJoint(RB.Hen2Egg(RB.Signifier(rb4,2),RB.Signifier(rb5,3)))
# cst4 = RB.PinJoint(RB.Hen2Egg(RB.Signifier(rb5,3),RB.Signifier(rb6,1)))
# jointedmembers = RB.join((cst1,cst2,cst3,cst4),indexed)
# # jointedmembers = RB.join((cst1,cst2,cst3),indexed)

Expand All @@ -148,7 +148,7 @@ else
cables = [RB.DistanceSpringDamper2D(0.0,k[i],0.0;slack=false) for i = 1:ncables]
end
acs = [
RB.ManualActuator(i,[i],zeros(1))
RB.RegisterActuator(i,[i],zeros(1))
for i = 1:hncables
]
hub = (actuators = acs,)
Expand Down
8 changes: 4 additions & 4 deletions examples/robots/bridge3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ else
cables = [RB.DistanceSpringDamper3D(0.0,k[i],0.0;slack=false) for i = 1:ncables]
end
acs = [
RB.ManualActuator(i,[i,i+hncables],zeros(2))
RB.RegisterActuator(i,[i,i+hncables],zeros(2))
for i = 1:hncables
]
apparatuses = (cables = cables,)
Expand Down Expand Up @@ -232,9 +232,9 @@ connected = RB.connect(rbs,cnt_matrix)
# connected = RB.connect(rbs,zeros(Int,0,0))
# #
#
# cst1 = RB.PinJoint(RB.Hen2Egg(RB.ID(rb1_to_3[1],2),RB.ID(rb4,1)))
# cst2 = RB.PinJoint(RB.Hen2Egg(RB.ID(rb1_to_3[2],2),RB.ID(rb4,2)))
# cst3 = RB.PinJoint(RB.Hen2Egg(RB.ID(rb1_to_3[3],2),RB.ID(rb4,3)))
# cst1 = RB.PinJoint(RB.Hen2Egg(RB.Signifier(rb1_to_3[1],2),RB.Signifier(rb4,1)))
# cst2 = RB.PinJoint(RB.Hen2Egg(RB.Signifier(rb1_to_3[2],2),RB.Signifier(rb4,2)))
# cst3 = RB.PinJoint(RB.Hen2Egg(RB.Signifier(rb1_to_3[3],2),RB.Signifier(rb4,3)))
# jointedmembers = RB.join((cst1,cst2,cst3),indexed)
#
cnt = RB.Connectivity(numbered,indexed,@eponymtuple(connected,))
Expand Down
Loading

0 comments on commit 6dcebe6

Please sign in to comment.