Hi Radu,
now it works, I was giving the wrong path as you mentioned.
Thank you very much for the help!
Davide

Il giorno mer 10 gen 2024 alle ore 17:53 'Radu Serban' via ProjectChrono <
[email protected]> ha scritto:

> 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/PH0PR06MB82374CE85F12B1F9AF1BDCFAA7692%40PH0PR06MB8237.namprd06.prod.outlook.com
> <https://groups.google.com/d/msgid/projectchrono/PH0PR06MB82374CE85F12B1F9AF1BDCFAA7692%40PH0PR06MB8237.namprd06.prod.outlook.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/CAOQ4fRXHT%2BeWOhSkLOCscRykKcZKLC-SkVkN1yCYHKPBtdeCNA%40mail.gmail.com.

Reply via email to