dojo-sim / Dojo.jl

A differentiable physics engine for robotics
MIT License
294 stars 25 forks source link

Bouncing Ball #93

Closed zhonghai1995 closed 3 months ago

zhonghai1995 commented 8 months ago

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)

janbruedigam commented 3 months ago

Duplicate, see https://github.com/dojo-sim/Dojo.jl/issues/56