Achieving Stable and Elastic Jumps in MuJoCo Simulations #2347
Unanswered
caba0404
asked this question in
Asking for Help
Replies: 3 comments 7 replies
-
To clarify, you want perfect elasticity? I.e. no energy loss at contact? |
Beta Was this translation helpful? Give feedback.
7 replies
-
Sorry, that's obviously wrong. I meant
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Tried my own recommendation, it's almost right, but not quite. I need to think about it more. xml = """
<mujoco>
<option integrator="RK4" cone="elliptic">
<flag energy="enable"/>
</option>
<worldbody>
<light pos="0 0 2"/>
<geom type="plane" size="5 5 .1"/>
<body pos="0 0 1">
<geom size=".2" mass="1" priority="1" solref="-1000 0" solimp="0.99 0.99 0.01"/>
<freejoint/>
</body>
</worldbody>
</mujoco>
"""
model = mujoco.MjModel.from_xml_string(xml)
data = mujoco.MjData(model)
TIME = []
POTENTIAL = []
KINETIC = []
while data.time < 2.25:
mujoco.mj_step(model, data)
TIME.append(data.time)
p = data.energy[0]
# elastic energy in contact
p += 0.5 * np.sum(data.efc_KBIP[:, 0] * data.efc_pos ** 2)
POTENTIAL.append(p)
KINETIC.append(data.energy[1])
POTENTIAL = np.asarray(POTENTIAL)
KINETIC = np.asarray(KINETIC)
ENERGY = np.vstack((POTENTIAL, KINETIC, POTENTIAL+KINETIC)).T
plt.plot(np.asarray(TIME), ENERGY)
plt.legend(['potential', 'kinetic', 'total']) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Intro
Hi!
I am a graduate student, I use MuJoCo for my research on Tensegrity robots.
My setup
I am utilizing Python to generate XML files and execute MuJoCo simulations seamlessly.
My question
Hi everyone,
I’m a graduate student conducting research on Tensegrity robots, and I’ve been using MuJoCo extensively for my simulations. Recently, I observed some unexpected behavior in my simulations and wanted to seek advice from the community.
When my Tensegrity robot structure interacts with the ground (specifically during jumps), I noticed that the solref parameters in the floor geom have a significant impact on the behavior of the structure. While I understand that this makes sense given the dynamics of the system, I’ve encountered an issue that’s puzzling me.
When plotting the total energy of the system over time, I see that it first decreases and then it increases at certain moments. This energy behavior sometimes leads to numerical instabilities in the simulation, forcing me to opt for non-elastic jumps to stabilize the system. However, my goal is to simulate jumps that are as elastic as possible without causing these instabilities.
Here are the steps I’ve tried so far:
I have also noted that when I change the size of the body that interact with the ground issue in the jumps tend to be mitigated
Despite these efforts, the energy behavior remains inconsistent, and I’m unsure how to proceed to achieve stable, elastic jumps.
I’d greatly appreciate it if anyone could provide insights or recommendations on how to fine-tune the simulation to address this issue. Specifically:
Thank you in advance for your help!
Here are some example figures to illustrate my point. After contact with the floor, the energy decreases and then increases. This phenomenon is observed in a case where I used a
solref
value of[4e-2, 1]
to make the effect more noticeable.In the second figure, the displacements are shown in millimeters.
Beta Was this translation helpful? Give feedback.
All reactions