Skip to content

Coefficient of restitution #2081

Discussion options

You must be logged in to vote

Hi Jack, I couldn't find a way to do it through MuJoCo. So, I approximated the collision as a damped spring between the bodies (when they are in contact) and manually applied the force before calling mujoco.mj_step(). The parameters are calculated as follows (this can be derived using energy conservation):

k = -c.solref[0]    # Set some high k value, I choose k = 2500
b = -2*math.sqrt(k*m_eff)*math.log(min(ce, 1e-15))/np.pi  # 1e-15 to avoid errors when ce = 0 (inelastic collision)

ce is the coefficient of restitution, and m_eff is the harmonic mean of the two masses that are colliding. You need to consider inertia matrices and jacobians for the colliding bodies if there are joints on an…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Aryan-Satpathy
Comment options

@JackSchoneveld
Comment options

@Aryan-Satpathy
Comment options

Answer selected by Aryan-Satpathy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #2080 on September 24, 2024 06:25.