Message thread on Webots Modeling

Saadby Saad Javed (10) 2017-03-19 11:40:21
Hi...
Respected Sir,
It is stated that i want to divide my floor into grid cells, with each cell having its own identification.
Could you help me out in this because i am stuck here. I am using webots 7.1.0.
Thank you
Your,s Obediently,
Saad Javed
Mechatronics Department
University of Engineering and Technology
Peshawar (Pakistan)

Attachment: obstacles.wbt.
Re: Saadby Tom Norton (Webots PRO - 14) 2017-03-20 08:41:26
Dear Saad,

Webots 7.1.0 is no longer supported.

Please upgrade to Webots 8.5.4, and I can offer direct assistance.

Best Regards,

Tom Norton
Re: Saadby Saad Javed (10) 2017-03-22 07:25:56
Respected Sir,
I have upgraded to webots 8.5.4. Could you now help me how to divide the floor into grid cells with each cell having its own identification?
Thank you
Saad Javed
Re: Saadby Fabien Rohrer (Webots PRO - 1215) 2017-03-22 09:00:40
Hi Saad,

How do you plan to use the grid cells?
If it's just a matter to know in which cell the robot is located in an abstract way, you can simply store some grid data (typically a 2D array of identifiers) in the robot controller, and determine only by programming in which cell the robot is using the robot GPS.
Are your expectations more complex, or do you have issues to implement this?

Sincerely,
Fabien Rohrer
Re: Saadby Saad Javed (10) 2017-03-22 15:57:56
Hi Sir...
I want to know in which cell robot is located, in which cells obstacles are located and in which cells other robots are located.
Thank you
Your,s Obediently,
Saad Javed.
Re: Saadby Tom Norton (Webots PRO - 14) 2017-03-23 08:31:37
Hi Saad,

As Fabien said, a good approach to this is to perform this programmatically, in a controller.

The best solution for what you are trying to achieve is to use the Supervisor API to get the nodes (robots & obstacles) you wish to track, store the grid data in your controller, and perform position checks using this Supervisor function: wb_supervisor_node_get_position().

Compare its return value against your grid data to determine in which cells your tracked objects are located.

Note that the use of Supervisors and the Supervisor API requires a PRO license.

Best Regards,

Thomas Norton
Re: Saadby Saad Javed (10) 2017-03-30 15:15:14
Hi
Sir,
I have read supervisor APl in webots manual but i am not understanding how i should implement it to track robots/obstacles.
Can you help me out?
Thank you,
Saad Javed
Re: Saadby Tom Norton (Webots PRO - 14) 2017-03-30 17:25:11
Hi Saad,

The first thing to understand is that robots/objects/devices are represented as Nodes (Robot, Background, Supervisor etc.), with each node having a set of Fields (translation, rotation etc.).

The supervisor API allows you to retrieve references to nodes, and using those references it is possible to get/set field values (amongst many other things!).

For example, to get the robot's translation, you may do the following assuming your robot has the def name "BOT":

WbNodeRef bot = wb_supervisor_node_get_from_def("BOT");
WbFieldRef translationField = wb_supervisor_node_get_field(bot, "translation");
const double* translation = wb_supervisor_field_get_sf_vec3f(translationField);

This would give you the Robot's translation at the time of the API call.

Let me know if that helps you get started.

Best Regards,

Tom Norton
Re: Saadby Saad Javed (10) 2017-03-31 16:29:33
Hi
Sir

It is questioned that should i create my own robot from solid node or select robots available in webots i.e e-puck, khepara etc.
Thank you.
Saad Javed
Re: Saadby Tom Norton (Webots PRO - 14) 2017-04-04 15:06:20
Dear Saad,

The choice is yours, it honestly depends on the type of robot you wish to use for your simulation. For example, if you want a robot with wheels, the e-puck would be a good choice. Otherwise, designing your own robot specifically for your needs could work better for you. I recommend you browse the library of robots already in Webots and see if any of them match your needs.

Best Regards,

Tom Norton
Re: Saadby Saad Javed (10) 2017-07-19 17:33:04
Hi.
Respected Sir,
Can you send me any webots video of how to:
(1) track nodes (robots, obstacles) using supervisor API ?.
(2) store the grid data in the controller?.
(3) perform position checks using this Supervisor function: wb_supervisor_node_get_position()?.
(4) Compare its return value against grid data to determine in which cells tracked objects are located?.
Thank you,
Saad Javed.
Re: Saadby Mansolino David (Webots PRO - 90) 2017-07-20 09:23:50
Dear Saad,

We don't have any video of this, however in Webots you can open the 'projects/samples/devices/display' sample which is the closest to what you want to do.

In this example, a Supervisor is tracking the position of the robot, it is then using a Display node to display the position (and path) of the robot on the floor, as the Display is pixelated it can be seen as a grid.

Sincerely,
David
Re: Saadby Saad Javed (10) 2017-07-22 09:20:28
Hi...
In the example you said in which a supervisor is tracking the position of the robot, here they have used their own differential wheeled robot and designed it accordingly. I am using khepara 3 on assistance of my teacher. How can i make grids by khepara 3 as in example they have made grids by designing their own differential wheeled robot. Is grid making for me different because i am not designing a robot?.
Is programmimg have any issue in their example as compared to my case of changed robot?.
Re: Saadby Saad Javed (10) 2017-07-22 09:28:44
Can i send you webots file of my environment so that you may understand and guide me properly?.
I shall be very thankful to you.
Saad Javed.
Re: Saadby Mansolino David (Webots PRO - 90) 2017-07-24 08:51:43
Dear Saad,

You can use any robot you want with this example, the only important point is that you have to set a DEF name to the robot node and use the same DEF name in the 'wb_supervisor_node_get_from_def' function.

As a first step I advise you to simply replace the 'MYBOT' DifferentialWheels in this world by your own robot and try to make the Supervisor works with your robot.

Sincerely,
David
Re: Saadby Saad Javed (10) 2017-07-24 15:31:15
Thanks a lot Sir.
You need to log in to be able to reply, subscribe or unsubscribe to this thread