Skip to content

kevin-tracy/DiffPills.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DiffPills.jl is a tool for computing proximity between two pill-shaped objects, and providing analytical smooth gradients of this operation.

basic usage

using StaticArrays
import DiffPills as dp

# create the pill objects (with :MRP or :quat for attitude)
pill_1 = dp.create_capsule(:MRP)
pill_2 = dp.create_capsule(:MRP)

# put position, attitude (MRP), radius, and length in
pill_1.r = @SVector randn(3);   pill_2.r = @SVector randn(3)
pill_1.p = @SVector randn(3);   pill_2.p = @SVector randn(3)
pill_1.R = 0.75;                pill_1.R = 1.5
pill_1.L = 3.0;                 pill_1.L = 2.0

# calculate proximity= dp.proximity(pill_1, pill_2)

# calculate proximity gradients
∂ℓ_∂r1, ∂ℓ_∂p1, ∂ℓ_∂r2, ∂ℓ_∂p2 = dp.proximity_jacobians(pill_1, pill_2)

About

Differentiable collision detection between capsules and padded polygons

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages