Jack,

You misunderstand the meaning of the Chrono and Chrono::Vehicle data paths.  
What you are supposed to provide through the functions chrono.SetChronoDataPath 
and veh.SetDataPath are the locations of *directories* containing data file.  
With what you have, the terrain file is probably found fine, but the incorrect 
setting for the vehicle data path may mess up something else (difficult to tell 
without seeing your code, but one possibility is if you are using some 
visualization mesh for the HMMWV vehicle).

Try something like this:
chrono.SetChronoDataPath('Users/wagne/anaconda3/envs/pychrono/Library/data/)
veh. SetDataPath(chrono.GetChronoDataPath() + ‘vehicle/')
…
terrain = veh.RigidTerrain(hmmwv.GetSystem(), 
veh.GetDataFile(‘terrain/WaveFrontTest.json’)
…

(Of course, this also assumes that your JSON terrain specification file is 
correct)

--Radu

From: [email protected] <[email protected]> On Behalf 
Of Jack Wagner
Sent: Sunday, August 4, 2024 10:35 PM
To: ProjectChrono <[email protected]>
Subject: [chrono] Re: Issues With Importing JSON for RigidTerrain (PyChrono)

Additionally, I am using the win-64_pychrono-9.0.0-py39_4852 package downloaded 
through Anaconda.
On Sunday, August 4, 2024 at 2:53:11 PM UTC-4 Jack Wagner wrote:
I have been trying to import the example RigidTerrain JSON with the example 
Wavefront OBJ to examine vehicle behavior on variable landforms and learn more 
about the wavefront terrain structure, however just trying to implement it into 
the simulation is causing me issues. I have the following code block to signify 
the directory for the JSON file:

chrono.SetChronoDataPath('Users/wagne/anaconda3/envs/pychrono/Library/data/vehicle/terrain/')
veh.SetDataPath(chrono.GetChronoDataPath() + 'WaveFrontTest.json')
terrain_file = veh.GetDataPath()

Then simply implement and initialize the terrain with the terrain file:

    terrain = veh.RigidTerrain(hmmwv.GetSystem(), terrain_file)
    terrain.Initialize()

However, every time I try to run this, I receive a fatal access violation and 
am unsure of what i am doing wrong. I keep thinking it's a simple syntax issue, 
however everything I try moving around (making terrain_file equal to the exact 
data path, switching around using Set/GetDataPath, etc.) has been ineffective.

Assistance would be very helpful. Below is a copy of my terminal's output and 
the JSON file I am using for reference, although the JSON is nearly identical 
to the example specified in the PyChrono documentation.

[https://groups.google.com/u/5/group/projectchrono/attach/5a8640db5350f/Screenshot%202024-08-04%20145215.png?part=0.2&view=1]
--
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]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/projectchrono/9f78401a-09bf-4608-af53-0a7428159dcen%40googlegroups.com<https://urldefense.com/v3/__https:/groups.google.com/d/msgid/projectchrono/9f78401a-09bf-4608-af53-0a7428159dcen*40googlegroups.com?utm_medium=email&utm_source=footer__;JQ!!Mak6IKo!Lnk1xcDYC3MkRaSq-70_bWbzrFHgZmMr0rjmMAkaYYWRlWuSAul8_5glWkH4bMe0Rg2D94x4BkVIMnQ8$>.

-- 
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/CH3PPF46CDC2185D29FBDA92D3D673E961DA7BE2%40CH3PPF46CDC2185.namprd06.prod.outlook.com.

Reply via email to