-
Notifications
You must be signed in to change notification settings - Fork 823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cable Composite Object Using Wrong Area Moment of Inertia #2208
Comments
Hi this is unlikely as we have a test for the correctness of the bending stiffness of the capsule https://github.com/google-deepmind/mujoco/blob/main/test/plugin/elasticity/elasticity_test.cc#L255 Are you sure about your formula for I_meas? |
Hello, I am not sure how the built-in correctness test works but I am certain my I_meas is correct. The code I included above performs a cantilever, end-loaded beam bending analysis and the I_meas is calculated using max displacement, beam length, elastic modulus, and applied force all of which are prescribed beforehand or measured during the simulation. The equation I used is a re-organized version of a common statics beam bending equation found here https://mechanicalc.com/reference/beam-deflection-tables, where I multiplied both sides by I and divided both sides by disp, ie. swapped the I and disp variables. I made sure to run the simulation long enough that the beam stopped moving to achieve max displacement. The output I get when I run the code is as follows: Calculated Area Moment of Inertia for Circular C/S: 6.277325295188244e-11 Given that the measured value is off by just 2% for the rectangular I and a significant 49% for the circular I, it's clear to me that the rectangular is being used in the simulation. If I made a mistake while constructing the model I am happy to fix it but as you can see in the included xml (.txt file) I have the geom type set to capsule. The only other place I could see being an issue is the |
2% seems a bit off to draw a conclusion.. Could you debug it by putting a printf directly here https://github.com/google-deepmind/mujoco/blob/main/plugin/elasticity/cable.cc#L200 ? |
Intro
Hello,
I am a grad student using Mujoco to simulate a soft bodied robot made with the cable composite elements. Despite having the proper dimensions and Twist/Bend properties for the material I noticed my deflections were not matching the physical robot we used as our comparison point so I did a few tests and dove into the base code.
My setup
Mujoco, Python
What's happening? What did you expect?
In the plugin file cable.cc (https://github.com/google-deepmind/mujoco/blob/main/plugin/elasticity/cable.cc#L134) lines 180-201 show the area moment of inertia calculation for the cable elements. I have selected capsule in the xml code which should mean Iy, Iz, and J for the circular cross section are used (lines 184-185). However, when I run a simple beam bending test, maintaining small deflection to conserve the small angle approximation, it produces stiffness that lines up almost perfectly with the rectangular cross section equations of the box elements (lines 193-195). Is it possible that the if statement in line 180/181 is not being executed properly and is instead always doing the box geom calculations for some reason?
Steps for reproduction
Minimal model for reproduction
cable_xml.txt
Code required for reproduction
Confirmations
The text was updated successfully, but these errors were encountered: