Message thread on Webots Modeling

Saadby Saad Javed (47) 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 - 31) 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 (47) 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 - 1224) 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 (47) 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 - 31) 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 (47) 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 - 31) 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 (47) 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 - 31) 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 (47) 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 - 147) 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 (47) 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 (47) 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 - 147) 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 (47) 2017-07-24 15:31:15
Thanks a lot Sir.
Re: Saadby Saad Javed (47) 2017-07-26 18:30:40
Hi..
Respected Sir,
I have a question. that if i am using 2 or 3 robots in simulation then should i use separate controllers for each robot or one controller can operate 2, 3 robots?. Which option is easier so i may implement it.
Thank you.
Saad Javed.
Re: Saadby Mansolino David (Webots PRO - 147) 2017-07-27 09:02:04
Dear Saad,

You can easily use the same controller for several robots. You simply need to assign the same controller to each robot. Then an instance of the same controller will be started for each robot.

Sincerely,
David
Re: Saadby Saad Javed (47) 2017-07-29 09:15:49
Dear Sir,
What is meaning by these 2 warnings when i am compiling a supervisor code for setting the position of a khepara 3 robot.
(1) In function 'main':
(2) implicit declaration of function 'actuateServos' [-Wimplicit-function-declaration].
Thank you Sir,
Saad Javed.
Re: Saadby Mansolino David (Webots PRO - 147) 2017-07-31 09:48:47
Dear Saad,

This warning means that the compiler can't found any declaration of 'actuateServos' before it's call.
Any search on google will give you a more detailed answer: https://stackoverflow.com/questions/8440816/warning-implicit-declaration-of-function

Sincerely,
David
Re: Saadby Saad Javed (47) 2017-08-01 14:37:03
Dear Sir,
I have developed my environment according to your link. Could you see my attachment webots file of what i have done so far ?.
and see why console is giving warning. What should i do to eliminate these warnings?.
Thank you.
Saad Javed.
.

Attachment: robot.wbt.
Re: Saadby Saad Javed (47) 2017-08-01 18:24:01
Dear Sir,
My console is giving warning message.

[display] Warning: wb_display_image_paste(): invalid WbImageRef.
[display] Warning: wb_display_image_paste(): invalid WbImageRef.
[display] Warning: wb_display_image_paste(): invalid WbImageRef.
[display] Warning: wb_display_image_paste(): invalid WbImageRef.
[display] Warning: wb_display_image_paste(): invalid WbImageRef.

[display] Warning: wb_display_image_paste(): invalid WbImageRef.
[display] Warning: wb_display_image_paste(): invalid WbImageRef.
[display] Warning: wb_display_image_paste(): invalid WbImageRef.

[display] Warning: wb_display_image_paste(): invalid WbImageRef.
[display] Warning: wb_display_image_paste(): invalid WbImageRef.
[display] Warning: wb_display_image_paste(): invalid WbImageRef.

[display] Warning: wb_display_image_paste(): invalid WbImageRef.
WARNING: DEF MYBOT DifferentialWheels > DEF EMOTICONS Display > Shape > Appearance > ImageTexture: First item of 'url' field is empty.
[display] Warning: wb_display_image_paste(): invalid WbImageRef.
[display] Warning: wb_display_image_paste(): invalid WbImageRef.
[display] Warning: wb_display_image_paste(): invalid WbImageRef.
[display] Warning: wb_display_image_paste(): invalid WbImageRef.
[display] Warning: wb_display_image_paste(): invalid WbImageRef.
[display] Warning: wb_display_image_paste(): invalid WbImageRef.
[display] Warning: wb_display_image_paste(): invalid WbImageRef.
[display] Warning: wb_display_image_paste(): invalid WbImageRef.
[display] Warning: wb_display_image_paste(): invalid WbImageRef.

INFO: display: Starting: ""D:\Testing\controllers\display\display.exe_webots""
INFO: display_supervisor: Starting: ""D:\Testing\controllers\display_supervisor\display_supervisor.exe_webots""
[display] Warning: "emoticon_display" device not found.
[display] Error: emoticons.png: file not found
[display] Warning: wb_display_image_load(): the emoticons.png image is unreadable.
WARNING: DEF MYBOT DifferentialWheels > DEF EMOTICONS Display > Shape > Appearance > ImageTexture: First item of 'url' field is empty.
WARNING: DEF MYBOT DifferentialWheels > DEF EMOTICONS Display > Shape > Appearance > ImageTexture: First item of 'url' field is empty.
WARNING: DEF MYBOT DifferentialWheels > DEF EMOTICONS Display > Shape > Appearance > ImageTexture: A texture can be defined relatively to the worlds directory of the current project, relatively to the worlds directory of the default project, relatively to its protos directory (if defined in a prototype), or absolutely.
WARNING: DEF MYBOT DifferentialWheels > DEF EMOTICONS Display > Shape > Appearance > ImageTexture: A texture can be defined relatively to the worlds directory of the current project, relatively to the worlds directory of the default project, relatively to its protos directory (if defined in a prototype), or absolutely.
WARNING: DEF MYBOT DifferentialWheels > DEF EMOTICONS Display > Shape > Appearance > ImageTexture: A texture can be defined relatively to the worlds directory of the current project, relatively to the worlds directory of the default project, relatively to its protos directory (if defined in a prototype), or absolutely.

[
Could you guide me sir?.
Thankyou.
Saad Javed.
Re: Saadby Mansolino David (Webots PRO - 147) 2017-08-02 08:34:49
Dear Saad,

Warning: "emoticon_display" device not found.

Means that you are trying to get an 'emoticon_display' Display device that doesn't exists.

[display] Error: emoticons.png: file not found
[display] Warning: wb_display_image_load(): the emoticons.png image is unreadable.

Means that you are trying to load an image file that doesn't exists.

[display] Warning: wb_display_image_paste(): invalid WbImageRef.

Means that the WbImageRef argument that you are sending to wb_display_image_paste is not valid (probably because it fails to load).

Sincerely,
David
Re: Saadby Saad Javed (47) 2017-08-04 12:37:50
Dear Sir,
It is stated, that when i run simulation, rotational field of my robot is incresing with time but translation field does not change (it remains static). Could you tell me why it is so?
.
Thank you.รจ
Re: Saadby Mansolino David (Webots PRO - 147) 2017-08-04 12:50:13
Dear Saad,

Does you robot moves? Are you editing or selecting the 'translation' field?

Sincerely,
David
Re: Saadby Saad Javed (47) 2017-08-05 01:55:30
Dear Sir,
No, my robot doesn, t move. Rotational field keep changing during simulation but translation field remains as it is.
Thankyou.
Re: Saadby Mansolino David (Webots PRO - 147) 2017-08-07 08:51:27
Dear Saad,

If your robot doesn't moves, then it is completely normal that the 'translation' field doesn't change.
If you are working with a DifferentialWheels, you need to call the wb_differential_wheels_set_speed function to make it move.

Sincerely,
David
Re: Saadby Saad Javed (47) 2017-08-08 19:59:52
Dear Sir,
In wb_supervisor_node_get position function what does this means that" the node argument must be a Transform node (or a derived node), otherwise the function will print a warning message and return 3 NaN (Not a number) values?.
Thank you.
Saad Javed.
Re: Saadby Mansolino David (Webots PRO - 147) 2017-08-09 08:50:15
Dear Saad,

It simply means that you can't call wb_supervisor_node_get function with any node type in argument, the node given in argument should inherit from Transform (otherwise the node doesn't have any concept of position). Please have a look at the node chart to know all the nodes inheriting from Transform:
https://www.cyberbotics.com/doc/reference/chart

Sincerely,
David
You need to log in to be able to reply, subscribe or unsubscribe to this thread