[Feat] Render lidar before agents and allow for tuple as color#115
[Feat] Render lidar before agents and allow for tuple as color#115matteobettini merged 7 commits intoproroklab:mainfrom
Conversation
…r function to lidar like in Agent.render so it allows for alpha in colors.
matteobettini
left a comment
There was a problem hiding this comment.
I am not so keen of changing the order of rendering objects (unless strictly necessary) as this might affect other users that were relying on sensors being rendered on top of the agent.
I am keen to add an alpha to sensors geoms, but we have to decide a way to uniform this.
Currently:
- agents have self.color and self.alpha
- entities have just self.color (which you just made me notice that it can sontrol alpha if it is size 4)
I think we should make also entities and sensors have self._alpha and force colors to be either the vmas object or a 3 dimentional tuple or tensor
vmas/simulator/core.py
Outdated
|
|
||
| for geom in geoms: | ||
| geom.set_color(*self.color, alpha=self._alpha) | ||
|
|
There was a problem hiding this comment.
What you are doing is now setting the colors of the sensor geoms to that of the agent
vmas/simulator/sensors.py
Outdated
|
|
||
| ray_circ = rendering.make_circle(0.01) | ||
| ray_circ.set_color(*self._render_color.value) | ||
| ray_circ.set_color(*self.render_color) |
There was a problem hiding this comment.
This just affects the ray circ and not the line, your problem seems to be the line
|
Co-authored-by: Matteo Bettini <55539777+matteobettini@users.noreply.github.com>
Co-authored-by: Matteo Bettini <55539777+matteobettini@users.noreply.github.com>
matteobettini
left a comment
There was a problem hiding this comment.
Perfect thanks!
These last changes and we are good to go
Her is an image of my problem.
When lidar is rendered after the agent geom, it is hard to see the shape of the agent.
I have two methods for solving this.
These are small changes that should not break anything.