maliput / delphyne

Scenario and search based Ego/Ado Car traffic simulations
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Adds traffic lights to the scene. #835

Closed francocipollone closed 2 years ago

francocipollone commented 2 years ago

related to #834 related to https://github.com/ToyotaResearchInstitute/delphyne_demos/issues/38

Summary

Notes on the implementation

The final output of the entire system is a ign::msgs::Scene message that is later on loaded by the Scene3D plugin(ign-gui3 builtin plugin) at delphyne_gui.

Sadly, once the scene is loaded, there is no way to edit the models, (the only thing you could do via a particular topic is to change the pose of the models). In our case, we wanted to change the color of the material of the traffic lights in order to simulate the different states in a semaphore. Other things that the Scene3d plugin allows is whether to remove the models or add new models.

So the workaround I ended up following was to delete the traffic light model when there is an update and add the model again. To do so visualizer/deletion and scene topics are being used. These two topics are later passed to the Scene3D plugin, in delphyne_gui when the visualizer is started.

Demo

4/1. New demo updated:

https://user-images.githubusercontent.com/53065142/161300594-2ee077b2-a4b5-45f8-ab16-47aee07418cb.mp4

Pendings

francocipollone commented 2 years ago

1 - Docstrings for improving documentation was added. 2 - This PR doesn't add tests for the new systems that were created, however, the behavior was verified through the integration demo added at https://github.com/ToyotaResearchInstitute/delphyne_demos/pull/41. An issue will be created for adding tests later on as this PR has already several lines of code.

liangfok commented 2 years ago

Let's squash the three commits into one.

francocipollone commented 2 years ago

Let's squash the three commits into one.

Done!