-
Notifications
You must be signed in to change notification settings - Fork 67
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
Soft bodies collisions #39
Comments
Thanks for creating this issue. Based on our discussion in the email I hope things are moving in a better direction. I shall paste the major points here for reference and then hopefully, very soon, I can create a new section in the WIKI detailing the scope and limitations of softbody simulations.
./ambf_simulation -l 22 -t 1 -p 60 These flags are defined as -l (L not I) as the index of the body to load. The 22 index is a primitive ''box'' shape acting as the ground rather than the default ''plane'' primitive shape. I find that the box primitive shape has better SB collision as it reduces ''tunneling'' for bodies that are freely moving in the simulation. The -t flag is to disable dynamic stepping and the -p flag is the frequency of the physics loop. The -t and -p flags are not necessary, but unless you want to do a real-time interaction with the soft-body, I would suggest that you use them, as they give much better solution convergence by not forcing the soft-body solver to terminate to match real-time stepping. Now you can simply run your softbody example as: You can also use the -h flag to list all the command-line options. I am attaching some examples of softbody examples as well.
soft bodies: [BODY Cheese]
joints: []
high resolution path: ./high_res/
low resolution path: ./low_res/
ignore inter-collision: false
namespace: /ambf/env/cheese/
BODY Cheese:
name: Cheese
mesh: Cheese.STL
mass: 10.0
collision margin: 0.001
scale: 1.0
location:
orientation: {p: -0.0, r: 0.0, y: 0.0}
position: {x: -1.3, y: 0.0, z: -1.0}
color components:
ambient: {level: 1.0}
diffuse: {b: 0.0, g: 0.4941, r: 0.8}
specular: {b: 1.0, g: 1.0, r: 1.0}
transparency: 1.0
config: {
kDP: 0.001, # damping
kDF: 10.0, #
kMT: 0.001,
clusters: 0,
flags: 18,
} The fields
Finally, thanks for your patience. I am finally going to be working on improving the soft-body support and feature set as part of my new job so stay tuned :). |
Good afternoon,
I am trying to import a soft body in AMBF and make it interact with a PSM. AMBF is used on Ubuntu 18.04 with ROS melodic. I have been facing however some problems with the interaction between soft bodies and the PSM, and in general between soft bodies/rigid bodies and between soft bodies/soft bodies.
To get started with soft bodies I imported the cloth example in the folder ambf/ambf_models/descriptions/multi-bodies/sb into the framework. To make things easier, I constrained the cloth in 4 points at the corners so that it was fixed horizontally.
Then, I wrote a simple python client code for the PSM to make it collide with the cloth (just moving down the main insertion link). What happens is that:
Changing the value of different parameters in the yaml file of both the cloth and the PSM (like collision margin for example), in some cases collision does not occur at all and the PSM penetrates into the cloth, sometimes collision occur for a certain part of the robotic arm but not for others.
Simulation in any case slows down too much when the collision occurs and the Phx frequency dramatically decreases using a variable time-step.
If the PSM and the cloth are in the same scene and using a variable time-step, and I try to run the python client code for the PSM so that they collide, the PSM does not work properly but has a completely unpredictable behaviour with random movements and thus it is impossible to control.
About points 2 and 3, I noticed that using a fixed physics time-step (with the –t true option) things improve but are anyway not optimal and the Sim time is slower. The Phx frequency increases a little and if I run the python client, the PSM seems to do its job, even if random oscillations are still present and the simulation is not stable.
I also tried to change the position of the cloth for example by constraining it into 2 points only and making then the PSM interact with it. The PSM penetrates sometimes the tissue with certain parts and the simulation is, again, not stable at all.
Both the previous images represent a simulation done with fixed time-step for physics, otherwise, as said previously, it would have been impossible to move the PSM with the python client.
I found similar issues in collisions even with other bodies, for instance with a rigid box and a soft sphere (they completely penetrate), or the same with a soft sphere and a soft torus. It is a problem that could be related to the Bullet physics engine behind the framework.
It would be really helpful for me to have some more examples of soft bodies to understand better how these objects work in this simulation environment.
I hope you can help me to solve these issues.
The text was updated successfully, but these errors were encountered: