Better collision for assembly machine simulation

Hi all,

I created a Pick and Place robotic arm which grab the product and puts it onto a rotary table ( everything is in sync of course ), so collision is critical in this project.
Being the product cylindrical I tried to use the per-poly collision, but unfortunately in UE4 if that kind of collision is used ( Use complex as simple ) the object itself can't be simulated, so I rely on creating the collision mesh directly inside the static mesh editor.

Unfortunately I get non-constant results, meaning that sometimes the grabbind and placing of the object works, but other times ( with same settings ) the mesh goes nuts and fly all around.

Have you tried something specific with Fabric in order to get better collision results ( possibly also optimized)?

Comments

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    Moin,

    I am not a game engine user, so forgive me if I should be 120% off your target. /preface

    From the description of your scene: Why would you need collision detection at all? Your setup sounds very much like "dynamic parenting objects" or switching transform-inheritance on the fly.
    If you need collision detection, keep in mind that bullet (for example) is depending on motion vectors to "drive" collision detection. If your object is resting on another object, its own motion is 0, so bullet will most likely have its dynamic mesh "die".
    If using Fabric engine inside your project is an option (opposed to just leveraging it for scene preparation), you might want to write your own collision detection using some simple bounding box approach or a raycast ...

    Marc


    Marc Albrecht - marc-albrecht.de - does things.

  • _Enter_Reality__Enter_Reality_ Posts: 8

    The idea behind it is to be able to get physic based simulation of a product that goes into an assembly line and get assembled.

    The dynamic parenting idea is already set, so that the various part of the product stick together, but the current status of the physics inside UE4 do not allow for a proper collision detection, which in my case begin when the product is into a rail ( with a "push force applied" so that it goes forward ), gets picked by the pick and place, placed into the rotary placeholder, then the other parts are put onto it.

    The current alternative is to bake everything inside Maya ( or use Alembic ), then import the entire process as a skeletal mesh and treat it as an animation, which I would like to avoid.

    The product on the rail right now, because of the non-perfect collision, as soon as they start to stick together on the rail itself, will overlapp themself, and that is amajor issue...

    The main purpouse is to also have something completely dynamic, since I'm also simulatin pharmaceutical capsules being put into a blister and wrapped, and all of this is supposed to happen dynamically.

    If Fabric Engine has some tricks to develop the situation that I have in mind and have everything dynamic it would be great.

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    I am almost certain that I cannot follow, which is probably due to my ignorance of game engines.

    Maybe these thoughts are of some help (I hope so, otherwise please ignore):

    In general physic simulations separate display geometry from simulation geometry. You are saying that you are getting penetrations - if those are consistent / show a constant overlap, you should be fine by expanding the collision geometry and keep the display geometry at its original size (do some visual adjustments, obviously). This is a typical situation in physics simulations that depend on motion vectors: They recognize collisions only AFTER those occured - and if you don't want to introduce forces to push objects back ("bounce"), which you don't want to do if you want objects to rest on one another, you often have to work with "active penetrations" that get resolved every single frame. Again, I would not use a physics simulation for this scenario - a simple collision "detection" by bounding box / ray casting should suffice.

    While I am sure that you can create a FULL dynamic scene showing what you describe, I am almost as certain that splitting it up into shots (like they do in movies) makes more sense and will spare you a lot of headache. If you NEED to have it all in one shot, the best approach (when using dynamic simulations) is to make sure that the object scale is perfectly suited for the physic simulation you are using. Bullet, for example, has some hardcoded thresholds around 4cm, so anything below that will not get registered correctly anyway. You may have to scale up your collision scene (i.e. not the display geometry) to a suitable size, do the simulation, then read out vertex positions from collision geometry and apply those to the display geometry scaled down.

    Marc


    Marc Albrecht - marc-albrecht.de - does things.

  • _Enter_Reality__Enter_Reality_ Posts: 8

    Hi Marc,

    The main difference between, let's say, Maya and a game engine, is that with UE4 everything ( or almost ) is happening in realtime, so the logic behind it is to trigger the event when needed ( play explosion animation ) and then delete it from the scene, in order to optimize memory consumption and allocate that memory to do something else, and usually in a videogame the tasks to take care of are a lot....and this also influence the framerate of the game itself, so if too many things are happening at once the framerate drops significantly....but then again, lots of things are happening in realtime, depending on player input, but in general what you see is the result of what you setup, so its realtime feedback.
    With a software like Maya, the most important thing is to get everything right and perfect, since you need ( usually ) to render what you did, so you keep improving what you done until you're satisfied with it, and then render it out to a shot.

    Regarding what you said about collision: UE4 collision handling is based on PhysX by nVidia, and the collision mesh can be obtained by creating it inside the editor ( which will be a low poly version of the mesh itself ), or set the mesh itself as the collision boundaries.
    The penetrations between the products are due to the fact that PhysX is not that suited for this kind of simulations, and even if you increase the precision of the collision ( by forcing some parameters inside the UE4 editor itself ), you're still getting mixed results, and that is a major issue, since I'm trying to simulate something which can give me a proper result every time I play the simulation, rather then 4 times out of 10.

    Also I'm developing the entire projects to be shown in VR, meaning that I need to take care of the framerate ( 90 fps steady ), so adelicate balance between how many physic meshes are in the scene and how many I need to delete, is a critical point.

    Unfortunately I'm not familiar with integrating third party plugins/sdk into the engine, so I was hoping that with Fabric something could be done with this kind of simulation, and then integrate/export everything into UE4 ( since the pipeline is well established ).

    Thanks for your advices anyway, I'm just looking for the best solution in order to get good results....worst case scenario will be bake everything into animation or Alembic animation.

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    Hi,

    thanks for the rundown on game engine dev :-)

    What I said about penetration handling still holds up, though. If you don't have control over how Unreal handles this, a physics simulation just doesn't sound like the way to go to me: Using a bounding box or raycast collision "hand tailored" to the situation sounds like the right thing to do.

    I am not sure if Fabric Engine gives you what you want - I know for certain that it can handle the "hand made collision detection", that's not too difficult to do at all. But running as a plugin you will need to redistribute FE along with your game/simulation - and I am not sure if that is what you want to do.
    If that is of no inderance, what I would do is check out if you can wire up your collision objects to a Fabric graph and maybe upload that, in a simplified version, here - so we could have a look together ...

    Marc


    Marc Albrecht - marc-albrecht.de - does things.

  • _Enter_Reality__Enter_Reality_ Posts: 8

    I guess that for something that specific I might need to rely on something else, or come up with something different ( baked ), in order to solve the issue.
    I've seen nVidia Flex in action, and looks like it might be a diffrent and advanced solution, so I'll give it a try ;)

  • HelgeHelge Moderator, Fabric Employee Posts: 314 Fabric Employee

    Fabric by itself doesn't come with sophisticated collision simulation - and I am quite certain that unreal is also not suited for doing collision simulation for industry applications. I would recommend to look at domain specific products for this. There are commercial APIs out there that can do this - and we might be able assist with integrating them into Fabric for use inside of Unreal as part of a commercial deal. Feel free to ping me with PM if you would like to discuss this further.

    Research Engineer @ Fabric Software

Sign In or Register to comment.