Building new robot in Vrep

Typically: "How do I... ", "How can I... " questions
Post Reply
neostek
Posts: 21
Joined: 15 Feb 2013, 10:26

Building new robot in Vrep

Post by neostek »

Hello,

I'm trying to build my own robot in Vrep. I read the tutorials and I see that the best way to do that is to create a double-layer system. Each object of the scene is composed by:

1) pure shape (that is respondable and not visible - layer 9)
2) non-pure shape for visual effect (I guess I can substitute this with a mesh)

My problem is when I link them together. To perform a static connection I used the force sensor as suggested here (http://coppeliarobotics.com/helpFiles/e ... pureShapes). The problem is that when the two object collide each other (e.g. a cuboid and a cylinder with the cylinder inside the cuboid) the dynamic effect is really strange: when the simulation is started the whole structure starts to jump over the scene. I guess is due to the violation of the collision constraint combined with the hard link connection (from the force sensor). What I want to ask you is:

1) Is there a way to disable the creation of this force for conflicting objects? I want this only for these two objects, while the collision with other object has to be respected. (maybe layers)
2) Or I have to edit the cuboid with an hole for the cyclinder? Do I have to do this both for pure shape and non-pure shape?
In addition, if I translate the cylinder without colliding with the cuboid, the object shakes a little bit (not so much but if I zoom into it it happens, again very very little bit shaking). Is it normal?

Thank you in advance for your response. Best regards,

Neostek

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

Re: Building new robot in Vrep

Post by coppelia »

Hello,

It always depends what kind of simulation you want to set-up. If dynamics is involved, then you should have a functional model (i.e. a dynamic model, based on pure shapes or convex shapes if possible), and you can attach visual shapes to that functional model. The visual shapes should be static and not respondable (adjust this in this dialog).
And if you attach a static shape to a non-static shape, you don't need a force sensor.

Force sensors are only needed if:
  • you attach a non-static shape to a static shape.
  • you attach a non-static shape to a non-static shape.
In above two cases only, put a force sensor in-between.

Make sure to carefully inspect some of the simple robot models included in the library. Also, try to follow this tutorial from beginning to end.

Cheers

neostek
Posts: 21
Joined: 15 Feb 2013, 10:26

Re: Building new robot in Vrep

Post by neostek »

My idea is to create for each link one pure-shape (really simple shapes) and then another non-pure shape (as child of the pure shape) for the visual effect (static and non respondable). For this reason I attached the force sensor. What about the collision problem? Do you suggest to edit the shape with an hole or how can I disable the crazy jumping effect in a dynamic simulation?

Thank you,

Neostek

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

Re: Building new robot in Vrep

Post by coppelia »

I still don't understand where you want to use force sensors. For a given link, if composed by a non-static respondable and a static non-respondable shape, there is no need for a force sensor.

If you have adjacent respondable shapes, then they will collide and make the whole construction jump around. In that case you have to edit the respondable masks of the adjacent shapes.

Typically you will have for a 2 wheeled robot for instance:

chassis
|-chassis_visible
|-leftJoint
|.|-leftWheel
|...|-leftWheel_visible
|-rightJoint
..|-rightWheel
....|-rightWheel_visible

Have a look at the demo model "dr12" from the model library.

Alternatively, if you can upload your scene to a location where we can download it, that wwould make things easier.

Cheers

neostek
Posts: 21
Joined: 15 Feb 2013, 10:26

Re: Building new robot in Vrep

Post by neostek »

Thank you for your response. I will try your suggestion and check if it works. I do not want to disturb you with downloading my file. By the way, what I did is:

cylinder (respondable - pure shape)
- cylinder (non respondable - non pure shape - static) [This is where I put my mesh in the future]
-- force sensor
--- cuboid (respondable - pure shape)
---- cuboid (non respondable - non pure shape - static)

This is the way for which is the best to build a structure (the # of - indicates father of). Of course, it could be a mistake. In that case, please let me know the correct way. I prefer this instead of single pure shape / non-pure shape for inertial configuration since I can set each inertial matrix for each object.

Thank you,

Neostek

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

Re: Building new robot in Vrep

Post by coppelia »

Ok, it becomes a little bit more clear. Two thoughts:
  • Remember that the more dynamic shapes / force sensors / joints you have in a simulation, the slower the simulation
  • When you group several shapes, then the resulting shape will have its mass and inertia automatically computed from its content. If you then change the mass/inertia of the grouped shape, the parameters are overridden
So I highly recommend grouping shapes that rigidly belong to each other. But if for a reason or another you do not want to do this, then make sure that adjacent shapes that touch each other have their "local respondable mask" appropriately set in this dialog. e.g. shape 1 can have 1, shape 2 can have 254. That way both won't collide nor have a collision response.

Cheers

neostek
Posts: 21
Joined: 15 Feb 2013, 10:26

Re: Building new robot in Vrep

Post by neostek »

Just a question (maybe a little bit stupid but this is my 11th hour of work today):

- why do I have to add a non-pure shape for the visual effect? I mean, why not another pure-shape (if it is faster, maybe static)? I understand the usage of double structure (pure for dynamic calculation) and non-pure (or pure?) for visual effect
- for a two-dofs joint (spherical joint that is making roll/pitch combination) do you think I can create two pure-shape objects (non visible) with only one non-pure visible object in the same point? Obviously, one has to be the father of the other joint.

Cheers and really thank you,

Neostek

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

Re: Building new robot in Vrep

Post by coppelia »

You can also use a pure shape that is visible. You can even use the same shape as dynamic functional and visible shape. But:
  • Only the physics engines rely on pure shapes (or convex shapes). Meaning, that they are good only for the physics engines.
  • Other calculation modules can operate on random shapes. They can be very detailed. For example, when you do minimum mesh-mesh distance calculations, then you can have more realistic results by using precise shapes for the visible part (the other calculation modules will operate on them by default too). You can set the exact behaviour for each shape in the common properties dialog ("object special properties" section).
So the rules are:
  • when a shape is not involved in collision response calculation, then it doesn't matter if the shape is pure, convex or random
  • when a shape is involved in collision response calculation, then always try to use pure shapes. If this is not possible, use convex shapes.
Try looking at simulation scenes by clicking the "dynamic content visualization" toolbar button (only active during simulation). Then you will see at once all items that are involved in dynamics calculation. Refer also to the design considerations in this page.

For your second question, refer also to this post

Cheers

Post Reply