Hi all,

I've been following this discussion, as I've recently run into the same 
issue myself. As Radu mentioned, I've double-checked that the directory and 
full path are correctly set. Chrono seems to locate other .obj files in the 
same folder without any trouble. Typically, if there's a file missing, I 
encounter an error message along the lines of "no such file or directory".

However, since this particular error mentions "tiny_obj", I'm wondering if 
the problem might lie with the .obj file itself. Any insight into this 
aspect of the issue?

Thanks a lot for any help or suggestions!

Sarina,

On Wednesday, January 10, 2024 at 9:53:44 AM UTC-7 Radu Serban wrote:

> Davide,
>
>  
>
> I take it that you are working now **outside** the Chrono source and 
> build trees.  And yet, you still want to use data files from the Chrono 
> data/ directory.  The error message from tiny_obj is pretty clear: it 
> cannot find the specified OBJ file at the given path **relative** to 
> where your executable is.  
>
>  
>
> The default path for the Chrono data/ directory is set up so that it works 
> fine for the demos executable as they are created in the Chrono build 
> tree.  
>
> If you work now in some other location, you must tell Chrono where to find 
> those files. You have 2 options:
>
>    - You can provide the full path to the data files (e.g. to the 
>    location of that file in the data/ directory in the Chrono source tree).
>    - If you want to use things such as 
>         chrono::vehicle:: 
>    vehicle::GetDataFile(“hmmwv/hmmwv_tire_left.obj”);
>    then you must first call chrono::vehicle::SetDataPath(), typically 
>    right at the top of your main function, to specify the root path for your 
>    vehicle data directory.
>    - Similarly, if you want to access data files using something like
>         chrono:: GetChronoDataFile(“textures/pink.png”)
>    then you must first call chrono:: SetChronoDataPath() to specify the 
>    root path for your data directory.
>
>  
>
> See for example how that is done in the template_project 
> <https://github.com/projectchrono/chrono/tree/main/template_project> 
> distributed with Chrono.
>
>  
>
> --Radu
>
>  
>
>  
>
> *From:* [email protected] <[email protected]> *On 
> Behalf Of *Davide
> *Sent:* Wednesday, January 10, 2024 4:20 PM
> *To:* ProjectChrono <[email protected]>
> *Subject:* [chrono] Error loading obj file
>
>  
>
> Hi all,
>
> when I try to build demos involving the HMMWV vehicle or parts of it such 
> as "demo_VEH_HMMWV" or "demo_VEH_Multicore_TireTestRig", the following 
> error message is shown:
>
>  
>
> "tiny_obj error message: Cannot open file 
> [../data/vehicle/hmmwv/hmmwv_tire_left.obj]"
>
>  
>
> Given that all the demos work fine when I installed Chrono, I'm not 
> understanding what could be the problem. Might someone give me a help?
>
> Thank you in advance!
>
> Davide
>
>  
>
> -- 
> 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/ebc711cf-151f-4ebc-8c64-01d82e6b1b0bn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/projectchrono/ebc711cf-151f-4ebc-8c64-01d82e6b1b0bn%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/66a49c54-e305-4187-bb25-ab4f195ab7a2n%40googlegroups.com.

Reply via email to