Custom material

Typically: "How do I... ", "How can I... " questions
Post Reply
kleinash
Posts: 112
Joined: 28 Sep 2014, 09:58

Custom material

Post by kleinash » 16 Jan 2017, 22:22

Hi,

I have created a unique surface for my object which I am importing into vrep. This is so that I can modify the dynamic properties and see the effects.

I do this by selecting defaultMaterial and duplicating it, giving it a unique name, and saving the scene.

However, every time I re-open my scene I have to reselect the chosen material for my object (which I don't mind doing) but I find that there are a number of surface that have spawned and saved in the scene, the list just keeps growing and growing each time I run the simulation so it takes longer for me to scroll down and find the material that I originally created.

Is this a known issue? Is there a way to stop it?

Thx

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

Re: Custom material

Post by coppelia » 17 Jan 2017, 09:52

Hello,

yes, this is a known issue and has been corrected for next release. In next release actually, materials won't be shared among shapes anymore, i.e. each shape will have its one material, that if modified, will only affect that single shape.

Cheers

kleinash
Posts: 112
Joined: 28 Sep 2014, 09:58

Re: Custom material

Post by kleinash » 17 Jan 2017, 15:53

Ok, thank you. Is there any reason why this causes changes in how the simulation works? I ask because of the issue I am getting.

I have a child script that runs during the simulation "TheAlmighty"
I import an object and set its material id line 49. (it started out as 'usr_ode_mat' and I change it here each time so keep with what's been generated)

I want to see the effect of the variables within ODE. So I run the simulation and record some values that I got from a real robot. Then I plot the correlation - the first thing I tried was friction - I got a great value for correlation, but when I ran the simulation again it came out with a different value for correlation - even though I had changed nothing.

I have tried so solve the issue by setting "TheAlmighty" itself to have a material value (line 123) - but that does not seem to help.

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

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

Re: Custom material

Post by coppelia » 18 Jan 2017, 14:05

If you are running with ODE, then indeed, there will be different results from one simulation run to the next. So if you restart V-REP every time before running a simulation, you should get the exact same results. Is that correct?

This happens with the ODE plugin, version 8 and before. See this post for details.

Cheers

kleinash
Posts: 112
Joined: 28 Sep 2014, 09:58

Re: Custom material

Post by kleinash » 18 Jan 2017, 17:02

Yes, that is correct. Thank you.

EDIT: I followed the attached suggestion and found that the object disappears as said when quickStep is deactivated. (Ubuntu 16.04; V-REP 3.3.2r3 64 bit)
I then added this line to "TheAlmighty"

Code: Select all

    seed=0 
    simSetEngineInt32Parameter(sim_ode_global_randomseed,-1,seed)
But am still getting non-deterministic - do I have it down correctly?

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

Re: Custom material

Post by coppelia » 20 Jan 2017, 09:12

This has not yet made it into V-REP 3.3.2. It will be in next release

Cheers

kleinash
Posts: 112
Joined: 28 Sep 2014, 09:58

Re: Custom material

Post by kleinash » 20 Jan 2017, 14:25

coppelia wrote:This has not yet made it into V-REP 3.3.2. It will be in next release

Cheers
Ok - thank you.

Is there a way to either:

1) Save all aspects of the simulation so that when it is re-run it will do exactly the same thing as it did previously. To be able to optimise the constraints of ODE.
2) Set the seed so that it does #1 in the source code - I have looked for the boolean setting for #define RANDOMLY_REORDER_CONSTRAINTS 1 but cannot find it in the VREP folder.

We settled on using ODE, but perhaps looking at one of the other engines now is the answer. before this made things unstable though.

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

Re: Custom material

Post by coppelia » 23 Jan 2017, 11:37

I would recommend to wait for the next release, since:
  • You will be able to set the seed programmatically (for the ODE engine)
  • Normally the Vortex engine should be freely available.
Cheers

kleinash
Posts: 112
Joined: 28 Sep 2014, 09:58

Re: Custom material

Post by kleinash » 23 Jan 2017, 20:58

Thank you!

Just as interest - when will that be?

I have tried using the Newton and Vortex engines - but both are proving to be unstable, I think it has to do with my objects being imported rather than built from within VREP. Vortex does not seem to have a user manual that can help with stability within VREP and Newton straight up won't work with the imported objects. The hand breaks apart and the object acts as though its swimming then sinking.

ODE is the most stable out of all three, but the non-determinism is an issue. I will have to set the seed, run the simulation to see what the result is - if the correlation (with the real world) is high enough keep the seed, but if not then unset seed and run again till I get a higher correlation.

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

Re: Custom material

Post by coppelia » 25 Jan 2017, 08:32

We are actually waiting for the Vortex essentials release. Which should be in February. Hopefully.

From our experience, it always depends on the parameters the user has chosen. You can make a simulation look good by tweaking parameters, but this still doesn't mean that the simulation will be realistic. Vortex offers the most realistic behaviour for realistic parameters (such as mass, inertia, etc.).
Regarding collision response calculation, the situation is not that clear.

Cheers

Post Reply