Michael,
You may find it useful to consult the paper “Chrono::Vehicle – Template-based Ground Vehicle Modeling and Simulation” (you can get the PDF here) and look over the Chrono::Vehicle module description at https://api.projectchrono.org/manual_vehicle.html. That will help you understand the philosophy and design of the vehicle module in Chrono.
Vehicle models in Chrono::Vehicle are constructed from parameterized templates of the various subsystems (chassis, suspension, steering, etc) and that can be done either by providing a set of concrete classes or else through a hierarchy of specification files in JSON format. For example, the classes for the CityBus modeled the first way are in: https://github.com/projectchrono/chrono/tree/main/src/chrono_models/vehicle/citybus, while the corresponding JSON files (for the same vehicle modeled the second way) are in: https://github.com/projectchrono/chrono/tree/main/data/vehicle/citybus. The concrete vehicle models distributed with Chrono (first method above) are all implemented in C++ and they can only be used as they are from PyChrono. A vehicle specified through JSON files can also be created in Python (see demo_VEH_WheeledJSON.py).
Having said that, some of the modifications to the vehicle model you want to make on the fly do not make much sense. Data for a vehicle model (at the level of fidelity of the Chrono::Vehicle models) must be consistent. For example, one doesn’t just change the track width – that is a result of how various hardpoints used to specify the suspension are provided. Others (such as the COG of the chassis subsystem) are meaningful to change during a simulation (unfortunately, that is currently not exposed for easy modification through a user-callable function – I’ll look into providing some of this functionality).
To make a long story short, vehicle models are assumed to be more or less “constant” and representing a meaningful vehicle system, specified through a consistent data set. Most of the parameters cannot be arbitrarily changed, else you end up with an incorrect model. But if you still want to try some of these things, one approach is to use a vehicle model specified through JSON files, modify one or more of these files, and then recreate the vehicle model with the new JSON specification. Look in https://github.com/projectchrono/chrono/tree/main/src/demos/vehicle/visualization for examples of reloading a vehicle model from (potentially modified) JSON files at run-time. There are two versions of that demo program there, one using the Chrono::OpenGL run-time visualization module, the other using the Chrono::VSG module. Note however, that neither Chrono::OpenGL nor Chrono::VSG are currently exposed to Python.
Regarding your question about tire models: you do not have to create a “tire model”, but you may have to specify the parameters in an existing Chrono tire model to represent the tire on the particular vehicle you are interested in. There are several tire models available in Chrono::Vehicle (see the links above and look in the source tree). Some of the Chrono models encoded in concrete C++ classes come with a few concrete tire implementations which you can select during construction. Look through the various demos in Chrono.
--Radu
--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
projectchron...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/projectchrono/a6a946d1-b823-4fea-bcd4-0b2098c807efn%40googlegroups.com.