Closed Frzgunr1 closed 10 months ago
I noticed a previous issue mentioning the feature, but based on the description, it appears to be hidden. I'd like to know how to customize their crashboxes and specify colors (max acceleration and chassis if possible) after adding agents.
If possible, could you please tell me in which files there are such cases, or a general approach on how to implement the feature.
THX!
Hello @Frzgunr1, I will look into this tomorrow to see what work would be involved.
Do you have a specific model of truck you are looking for? The main resource requirement is a urdf
file of the vehicle you want.
Hi @Gamenot , I have not implemented a separate urdf modeling for truck at the moment, if possible you could use the truck mentioned in #767 instead.
Agent is always of type car when generated, however I noticed that the `SMARTS/smarts/ core/vehicle_state.py` file has some different vehicles than when the smarts are generated, hopefully it will be possible to implement the ability to specify the vehicle parameter of the agent (at least the collision box) when customizing the agent!
Looking forward to hearing back from you! :)
Hello @Frzgunr1, what is given in #767 is unfortunately just a set of visual models, it is still missing the dynamics model.
The two current physics models are hardcoded in vehicle.py
to draw from smarts/core/models/
one of vehicle.urdf
("sedan"
) or bus.urdf
("bus"
) based on the value of AgentInterface.vehicle_type
.
What is your timeline?
There are a few components to a vehicle within our simulation.
Current vehicle selection is done in the agent interface: https://github.com/huawei-noah/SMARTS/blob/c2ebaaaca4eec8d122f7c75143b899b1611095c9/smarts/core/agent_interface.py#L323-L326
And constrained: https://github.com/huawei-noah/SMARTS/blob/c2ebaaaca4eec8d122f7c75143b899b1611095c9/smarts/core/agent_interface.py#L370
This currently is resolved to a urdf
when the vehicle is constructed:
https://github.com/huawei-noah/SMARTS/blob/c2ebaaaca4eec8d122f7c75143b899b1611095c9/smarts/core/vehicle.py#L300-L305
The vehicle state is where the visual representation of the vehicle is resolved and where the simulation is intended to redirect to the appropriate .glb
.
https://github.com/huawei-noah/SMARTS/blob/c2ebaaaca4eec8d122f7c75143b899b1611095c9/smarts/core/vehicle_state.py#L50-L93
It also looks like there is currently a bug that does not forward the visual vehicle configuration and default dimensions when generating agents: https://github.com/huawei-noah/SMARTS/blob/c2ebaaaca4eec8d122f7c75143b899b1611095c9/smarts/core/vehicle.py#L339-L343
This would normally be done through specifying vehicle_config_type
(relating to VEHICLE_CONFIGS
).
https://github.com/huawei-noah/SMARTS/blob/c2ebaaaca4eec8d122f7c75143b899b1611095c9/smarts/core/vehicle.py#L58-L70
The physics is represented in the following way:
There appears to be a second bug related to vehicle selection in which the vehicle can only ever have the dimensions of the default "passenger"
vehicle instead of using information from the AgentInterface.vehicle_type
.
https://github.com/huawei-noah/SMARTS/blob/c2ebaaaca4eec8d122f7c75143b899b1611095c9/smarts/core/vehicle.py#L286
https://github.com/huawei-noah/SMARTS/blob/c2ebaaaca4eec8d122f7c75143b899b1611095c9/smarts/core/vehicle.py#L248-L266
The controller arguments are currently defined here: https://github.com/huawei-noah/SMARTS/blob/c2ebaaaca4eec8d122f7c75143b899b1611095c9/smarts/core/models/controller_parameters.yaml#L1-L51
It looks like there is a final bug where if a vehicle is replaced (rather than a new vehicle generated) no configuration is used and defaults to "sedan"
:
https://github.com/huawei-noah/SMARTS/blob/c2ebaaaca4eec8d122f7c75143b899b1611095c9/smarts/core/vehicle_index.py#L462
Configuration is intended to be provided such as with a newly generated vehicle: https://github.com/huawei-noah/SMARTS/blob/c2ebaaaca4eec8d122f7c75143b899b1611095c9/smarts/core/vehicle.py#L322-L330
urdf
Hi @Gamenot , you're right, thank you very much for your analyses, they are very accurate and readable, you're a great engineer. Considering the current situation, I am going to write the text part of the paper first. I will wait for you to finish this important work and, if there is any material I can provide, just tell me. THX :)
@Frzgunr1 I am about to start work on this, is there a particular grade of truck you are looking for?
Alternatively, the truck (7.1m 2.4m 2.4m) as is defined by SUMO.
Sure,just use the truck (7.1m) as is defined by SUMO. Then We could make more customized vehicles!
High Level Description
Version
ver [1.4.0]
Operating System
ubuntu 20.04
Problems
No response