How to make Khepera 3 robots simpler for faster simulations?

Typically: "How do I... ", "How can I... " questions
lukecam95
Posts: 8
Joined: 27 Feb 2017, 16:55

How to make Khepera 3 robots simpler for faster simulations?

Postby lukecam95 » 18 Apr 2017, 16:58

Hi,

I am currently simulating four Khepera 3 robots using threaded child scripts.

I have read that you can make simulations faster by making the robots simpler. I have tried to reduce the parts of the robots, such as delete the gripper and some sensors and hence in the script I would not get their handle (using simGetObjectHandle() ), however when running the command simExtK3_create() I get an error saying that there is not enough arguments. Hence simExtK3_create() seems to be forcing me to use all the handlers of the objects the K-team designed the robot with.

Is there another way to simplify the robots?
Any other tips on how to make the simulation faster?

Cheers,
Luke

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

Re: How to make Khepera 3 robots simpler for faster simulations?

Postby coppelia » 19 Apr 2017, 08:27

Hello Luke,

the first thing to do would be to identify what is really slowing down the Khepera. Is it the display? the physics engine? The code in the script itself?
The Khepera robot is actually using a plugin for operation, so simplification of the robot model will probably also force you to modify the plugin.
Best would be to share your working scene here, so that we can have a look where the bottleneck might be.

Cheers

lukecam95
Posts: 8
Joined: 27 Feb 2017, 16:55

Re: How to make Khepera 3 robots simpler for faster simulations?

Postby lukecam95 » 19 Apr 2017, 11:01

Hi,

I am not sure how to share scenes through this forum so here is a link to download:

https://www.dropbox.com/s/nfz2f8zefy7zq ... s.ttt?dl=0

I have already disabled vision and proximity sensors.

regards,
Luke

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

Re: How to make Khepera 3 robots simpler for faster simulations?

Postby coppelia » 21 Apr 2017, 07:27

Ok, so the problem is that the khepera is controlled by a plugin that directly accesses some object handles. So you can't directly delete the gripper. But you can make it non-dynamic and non-respondable. For that, select object K3_gripper_baseRespondable, check Object is model base in the object common properties. Then, for the model you just defined, check Model is not dynamic and Model is not respondable in the model dialog. Do the same for the 3 other robots.

Additionally, you can also slightly increase speed by selecting the Very fast physics engine preset and dt=200 ms.

Cheers

lukecam95
Posts: 8
Joined: 27 Feb 2017, 16:55

Re: How to make Khepera 3 robots simpler for faster simulations?

Postby lukecam95 » 22 Apr 2017, 22:11

OK thank you. It seems to have helped.

One last question. What difference do the dynamics engine's make i.e. Bullet 2.78, Bullet 2.83.. etc?

Regards,
Luke

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

Re: How to make Khepera 3 robots simpler for faster simulations?

Postby coppelia » 24 Apr 2017, 07:33

The physics engine is what will allow your robot to fall, roll, grasp, bounce off walls, etc. It will compute all the dynamic aspects of a simulation. This is a pretty complex task and there are several different physics engines that can be used in V-REP: depending on the physics engine, the results can be more or less exact, realistic, stable, etc. In general, Bullet and ODE are considered as game engine: they are pretty fast and stable, but not very realistic. Vortex on the other hand is better in that aspect.
A general rule of thumb is to switch to the other physics engines and see if the simulation runs fine there too.

Cheers


Return to “General questions”

Who is online

Users browsing this forum: No registered users and 17 guests