Dojo.jl icon indicating copy to clipboard operation
Dojo.jl copied to clipboard

Bouncing Ball

Open zhonghai1995 opened this issue 1 year ago • 0 comments

Hi, I want to simulate a bouncing ball using the sphere mechanism, but I can not get it bouncing. Is this due to the unspport of elastic collision? I have tried all three contact types. Thanks so much!

using Dojo using DojoEnvironments using StaticArrays using Plots

timestep = 0.01

mechanism = get_mechanism(:sphere;contact_type = :nonlinear, timestep=timestep, springs = 20000.0,dampers = 10.0,mass = 10)

initialize!(mechanism, :sphere;position = [0;0;5.0],velocity = [3;2;-5.0],angular_velocity=[1.0;1.0;1.0])

storage = simulate!(mechanism, 5, record=true)

vis = visualize(mechanism, storage) render(vis)

zhonghai1995 avatar Oct 21 '23 13:10 zhonghai1995