I've read the code and this is my understanding. If I create a new vehicle 
A, if I want to import JSON I also need to do it like in the demo. 1. 
Create a class A, inherit Vehicle_Model, and then configure the json path 
such as virtual std::string VehicleJSON() const override { return 
"mtv/vehicle/MTV_Vehicle_WalkingBeam.json"; } 2. I use WheeledVehicle 
vehicle(vehicle::GetDataFile(vehicle_model.VehicleJSON()), 
vehicle_model.ContactMethod()); in the int function to read Json information

在2023年9月5日星期二 UTC+8 15:18:34<[email protected]> 写道:

> On the vehicle tutorials page [1] you see a reference to a demo called 
> "demo_VEH_WheeledJSON" which is a good starting point to learn about how to 
> read a vehicle from JSON files. The demo itself you can see here [2] and 
> around line 50 there is a list of available models that you can try. Note 
> that this demo does need to be changed (C++ source) and recompiled if you 
> want it to load a different vehicle. I'm not aware of a demo that will 
> allow you to simply point to a main vehicle JSON file that will 
> automatically load all other JSON files without any modifications and/or 
> recompiling. That said, if that is the direction you want to go in, that is 
> certainly possible with some changes.
>
> Greetings, Marcel
>
>
> [1] 
> https://api.projectchrono.org/development/tutorial_table_of_content_chrono_vehicle.html
>
> [2] 
> https://github.com/projectchrono/chrono/blob/main/src/demos/vehicle/wheeled_models/demo_VEH_WheeledJSON.cpp
> On 05-Sep-23 7:40, '马浩楠' via ProjectChrono wrote:
>
> "I'm reading the code for the 'chrono' vehicle library, and I've 
> understood some of the inheritance relationships between the header files. 
> Specifically, the vehicle CPP files are responsible for reading JSON data. 
> I want to know in which header file or method the JSON data is imported 
> into the vehicle. In other words, if I've defined a new vehicle in the form 
> of a JSON file, how do I import my defined vehicle file for simulation or 
> import a demo to see how it behaves? I'm using translation software, so 
> there may be some syntax errors. 
>
> -- 
> 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 [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/projectchrono/a235ae7a-2c8a-4a40-9a84-260ca54f965fn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/projectchrono/a235ae7a-2c8a-4a40-9a84-260ca54f965fn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/projectchrono/944eee41-cbac-4666-b1e0-8ce5fcb5d3e2n%40googlegroups.com.

Reply via email to