Questions about V-REP simulation, world&controller edition

Typically: "How do I... ", "How can I... " questions
vick217
Posts: 12
Joined: 26 Jun 2013, 18:27

Questions about V-REP simulation, world&controller edition

Post by vick217 » 26 Jun 2013, 18:30

1) Is possible to edit the worlds through a program code and not to manually rearrange the objects and add children?

2) Is possible to rewrite the robot (and its parts or children) program through a main program (I am trying to simulate a central system that sends the path generate by itself to each of the robot in a dynamic environment)

3) A further step will be to use the robots a multi agent system, is possible to provide communication between the robots?

4) Is possible to know how many collisions there were and from which robots, or at what part of the simulated path or at what time of the simulation and the depth or how much damage how the robots have suffered? as well as the final time to take all the robots to get their goal positions?

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

Re: Questions about V-REP simulation, world&controller editi

Post by coppelia » 26 Jun 2013, 19:29

Hello,
Cheers

vick217
Posts: 12
Joined: 26 Jun 2013, 18:27

Re: Questions about V-REP simulation, world&controller editi

Post by vick217 » 01 Aug 2013, 16:03

Hello,

It is possible to debug a simulation? and know where in the space are the positions and values that are used in the programming code?

It is possible to create an scenario/environment from a program in an object? and to move the objects from the scenario during the simulation with programmed code?
I would like to test several scenarios but I wouldn't like to change the positions manually, but mainly with generated code that I just need to copy and paste.

Kind regards,
Victor

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

Re: Questions about V-REP simulation, world&controller editi

Post by coppelia » 01 Aug 2013, 19:22

Hello Victor,

You cannot directly debug child scripts in the usual way, but you can output debug text via following functions:
You can also create a scenario/environment from within a child script. However, by default, everything that is added during simulation (e.g. new objects, etc.) will be removed at the end of a simulation. Similarly, all positions, orientations and parenting will be restored at the end of a simulation. You can however change that behaviour in the simulation dialog.

Cheers

vick217
Posts: 12
Joined: 26 Jun 2013, 18:27

Re: Questions about V-REP simulation, world&controller editi

Post by vick217 » 05 Aug 2013, 22:20

Hello,
Thank you for your answer, you could explain further about "text debugging" ? do you mean to screen the outputs at key stages of the simulation with an user dialog?

I have been trying to repeat the 3DoF holonomic path planning example in the scene folder, with some variations, instead of using an L shape I just use a cuboid and the floor is not 1 of unit, but the starting floor (5 units).

I get the path build, but only the red one, no the blue coming from the goal, and therefore they never join. After that I click the bottom follow path but the cuboid is not moving, however, when I touch with the mouse the Dummy Start configuration, the surrounding white invisible square changes it shape like following the path, but the attached cuboid does not move.

I have scale the values of the parameters in "adjust search parameters", and in the calculation path planning module, but is still not working. Could you please help me with that? it is possible to send a file?

Cheers

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

Re: Questions about V-REP simulation, world&controller editi

Post by coppelia » 06 Aug 2013, 10:25

Hello,

With text debugging I mean outputting text (to the console, to an auxiliary console or to the status bar (see my previous post)) from specific locations in the code. But breakpoints are not yet supported for embedded scripts. For plugins, you can use the debugger of your choice, depending on your development environment.

About your path planning problem: I suppose you have checked the option Show searched configuration nodes in the path planning dialog. In that case, it will display a red and a blue search tree, that should eventually touch each other. If you can only see the red search tree, that means that the goal configuration is illegal (either it is out of the specified search range, or it is already in a colliding state). In your case I suppose your search range is wrong. Try visualizing it with Adjust search parameters --> Visualize the search area.

If possible, try uploading your scene to a free service such as google drive in order to share your problematic scene with us.

Cheers

vick217
Posts: 12
Joined: 26 Jun 2013, 18:27

Re: Questions about V-REP simulation, world&controller editi

Post by vick217 » 06 Aug 2013, 12:28

Hello,
I have upload the scene to google drive and grant access to anyone with the link.
The searching area it includes the goal configuration and the goal shape does not have tick on the fields: collidable, measurable or detectable. I try to set the same characteristics as in the example 3DoF holonomic for the L-shape.

I also upload a video of how it looks when I touch with the mouse the StartConfiguration

I would appreciate your help

Kind regards,
Victor
Last edited by vick217 on 06 Aug 2013, 14:51, edited 1 time in total.

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

Re: Questions about V-REP simulation, world&controller editi

Post by coppelia » 06 Aug 2013, 14:38

Hello Victor,

Looking at the video (which is a slightly different scene than the one you uploaded), then you should make sure that the shape Cuboid12 is static and non-respondable: currently the shape will simply follow the laws of physics (fall and stay on the ground). You can change this in the shape dynamics dialog.

Then, in the scene you uploaded, you have selected Check robot - obstacle minimum & maximum distance. Change this to Check robot - obstacle minimum distance or Check robot - obstacle collision.

Finally, for the dummy StartConfiguration, uncheck Follow parent path (only direct parent) in the dummy dialog in order to NOT have your dummy position automatically assigned to its parent path (in your scene a child script will take care of that)

Cheers

vick217
Posts: 12
Joined: 26 Jun 2013, 18:27

Re: Questions about V-REP simulation, world&controller editi

Post by vick217 » 06 Aug 2013, 15:57

Hello,

Thank you very much, now is working almost perfect.
I just have some final questions, the shape is moving through the path but is not reaching the final orientation, just the final position.
It is possible to leave the start shape in the final position, or it always have to come back to the initial position?
It is possible to summarize the path in key points through the path? and avoid unnecessary rotations in the holonomic option? It is possible to do this by increasing the number of post processing steps in the path planning dialog?

Thank you very much in advance
Kind regards,
Victor

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

Re: Questions about V-REP simulation, world&controller editi

Post by coppelia » 07 Aug 2013, 18:45

Hi Victor,

you are free to edit the child script that controlls the simulation. So, if you don't want the shape to come back to its initial position/orientation after the movement, just comment out the 2 lines after the instruction simFollowPath.

You can reduce the rotation by setting a small range for the Delta search range value.

Cheers

Post Reply