Simulation of 2 D.O.F platform

Typically: "How do I... ", "How can I... " questions
Dragunner
Posts: 11
Joined: 30 Mar 2017, 12:12

Re: Simulation of 2 D.O.F platform

Postby Dragunner » 07 Apr 2017, 10:08

Your script is producing errors. This needs to be fixed first, otherwise it is difficult to say what is going on normally.

I don't see any errors in the terminal.. ?

Some adjacent elements are colliding with each other. This will produce instabilities and shaking motions. Make sure to adjust those shape's local respondable masks, so that their do not respond to collision with adjacent shapes. You can also simply disable the respondable flag for some of the shapes.

I played with it and yeah it seems to solve the problem.

Finally, you are using random meshes as respondable shapes. Those are really not recommended since they are very slow and very unstable. Much better is to use convex shapes (or a compound of convex shapes), or pure shapes. Make sure to carefully read this page.

I'll redo my shapes so that it can be better and compute faster.

Thanks

coppelia
Site Admin
Posts: 5614
Joined: 14 Dec 2012, 00:25

Re: Simulation of 2 D.O.F platform

Postby coppelia » 10 Apr 2017, 08:09

The errors are related to a missing csv file.

But do not ignore the pop-up messages that display in your case, for instance:

This simulation will run with custom simulation parameters. Be aware that you might experience slowdowns or accuracy problems, and some scenes or models will not perform as expected. Whenever possible, it is recommended to keep default simulation parameters (e.g. simulation time step or dynamics settings).


and

It appears that the dynamic content includes non-pure non-convex shapes. This is never recommended since this will drastically slow down the simulation, and in addition to that, non-pure non-convex shapes are not as stable as pure shapes or convex shapes. To find the incriminating shape(s), make sure to inspect the dynamic scene content by using the dedicated toolbar button.


Cheers

Dragunner
Posts: 11
Joined: 30 Mar 2017, 12:12

Re: Simulation of 2 D.O.F platform

Postby Dragunner » 10 Apr 2017, 10:01

Thanks for all the support It helped me a lot !

I have one more question I've tried to use this code :

Code: Select all

res_file = io.open("result.csv", "w")         --write csv file
    result=simGetObjectOrientation(Handle_support,-1,3) -- get the orientation I want

    Time=simGetSimulationTime()
    res_file:write(Time)
    res_file:write(",")
    res_file:write(result[1])
    res_file:write(",")
    res_file:write(result[2])
    res_file:write(",")
    res_file:write(result[3])   
    res_file:write("\n")

res_file:close()


Which should write all the orientations of my support during the simulation in a CSV file, my problem is that when I put this code in the actuation loop it's just working but not saving the file just writted.

I think I might have put this code in the wrong place ?

I've tried to put the open file in the intialization part but then I don't know where to put the "res_file:close()" , I tried in the "sim_childscriptcall_cleanup" loop but it doesn't save either..

Any idea ?

Best regards,
Kévin

coppelia
Site Admin
Posts: 5614
Joined: 14 Dec 2012, 00:25

Re: Simulation of 2 D.O.F platform

Postby coppelia » 12 Apr 2017, 08:09

You should only open the file once (i.e. in the initialization phase) and only close it once (e.g. in the clean-up phase).

If there are no error messages, then the file is probably written (maybe not at the location you think).

Cheers

Dragunner
Posts: 11
Joined: 30 Mar 2017, 12:12

Re: Simulation of 2 D.O.F platform

Postby Dragunner » 13 Apr 2017, 10:25

Hi,
You were right it was writting it in another location ! thanks to you I suceeded ! I'll come back to the forum for other simulations problems (if there are some) !

Thanks,
Kévin

Dragunner
Posts: 11
Joined: 30 Mar 2017, 12:12

Re: Simulation of 2 D.O.F platform

Postby Dragunner » 14 Apr 2017, 15:19

Hi,
One little question ,I would like to modelize the acceleration that my platform takes. Is there a way to do it ?

I suppose that one way is to simply put a force, but is there another way to do it ? (parameters or stuff like that to be more accurate)

Have a nice week-end !

coppelia
Site Admin
Posts: 5614
Joined: 14 Dec 2012, 00:25

Re: Simulation of 2 D.O.F platform

Postby coppelia » 18 Apr 2017, 08:19

You cannot put a force on a non-dynamic mechanism (you mechanism is kinematic).
So if you want to reach a specific platform acceleration, then you will have to appropriately actuate the platform target position/orientation (since your platform is controlled in IK).
Or are you taking about measuring an acceleration?

Cheers

Dragunner
Posts: 11
Joined: 30 Mar 2017, 12:12

Re: Simulation of 2 D.O.F platform

Postby Dragunner » 20 Apr 2017, 14:39

Hey !
No I was talking about what you answered thanks for the answer :) !


Return to “General questions”

Who is online

Users browsing this forum: No registered users and 19 guests