1

I want to create a real time simulation of autonomous vehicle for an intersection manager. I was able to do it by creating a fixed number of cars before the simulation starts. Now, I would like to create a simulation for the same purpose but now I would like to have a lot of cars, so I would like to create a Supervisor node and have the Supervisor node create new cars(nodes) at some defined positions so that it looks like a real time simulation. I know I can set up the position of the other robots using the supervisor node, but I would like to know if there is a possibility or are there any functions for creating new nodes during the simulation run?

1 Answers1

1

This is feasible thanks to the Supervisor import functions:

  • wb_supervisor_field_import_mf_node
  • wb_supervisor_field_import_mf_node_from_string

These functions allow you to import a node in any MF field (for example the 'children' field of the top Group node).

Find more information here: https://www.cyberbotics.com/doc/reference/supervisor#wb_supervisor_field_import_mf_node

David Mansolino
  • 1,713
  • 7
  • 13