tiny_obj error message: Cannot open file

115 views
Skip to first unread message

Prabasgarage

unread,
Feb 27, 2024, 9:50:13 AM2/27/24
to ProjectChrono
Dear Community,

I am able to compile and run the template_project successfully. As a next step I wanted to run the demo_VEH_MAN.cpp as it is. I copied the code to new folder and modified the cmakefile accordingly. I modified nothing in demo_VEH_MAN.cpp except adding SetChronoDataPath(CHRONO_DATA_DIR); next to the main function. I am able to build and get the exe. but running the exe throws the following error as shown in the attached image. I had a look at discussions in this forum, they all suggest adding line SetChronoDataPath(CHRONO_DATA_DIR); in .cpp, which doesn't help in my case. Any help is highly appreciated.

Thanks,
Prabanjan
obj file missing.png

Dario Mangoni

unread,
Feb 27, 2024, 10:34:36 AM2/27/24
to ProjectChrono
Prabas,
please always provide a reference to the script that throws issues, not just the error itself.

Second: I wrote to you in the previous post " I think you are also missing vehicle::SetDataPath(CHRONO_VEHICLE_DATA_DIR);"
Did you do it?

Prabasgarage

unread,
Feb 27, 2024, 10:44:13 AM2/27/24
to ProjectChrono
The script is nothing but the same demo_veh_man.cpp. Anyways let me attach it here.

I am not sure where should I add this  "vehicle::SetDataPath(CHRONO_VEHICLE_DATA_DIR);". Can you advise me on this please? 

Thanks,
Prabanjan


CMakeLists.txt
my_example.cpp

Radu Serban

unread,
Feb 27, 2024, 11:00:27 AM2/27/24
to ProjectChrono

Prabanjan,

 

Please look (carefully) at the chrono-projects repository at https://github.com/projectchrono/chrono-projects.

 

Note that this GitHub repository is different from the main Chrono repository.

chrono-projects contains a bunch of different codes and projects that depend on various modules of Chrono, all of which are set up exactly like the template_project that you’ve been looking at so far.   In particular, it has several “configuration projects” which test precisely the kind of things you are having trouble with:  setting up one of the Chrono demos as an “external project”.  The main difference in any one of these programs in chrono-projects (compared to the corresponding demo in Chrono) is exactly the proper setting of the paths to Chrono and/or Chrono::Vehicle data.

 

You can clone the chrono-projects repository and look at demo_VEH_CityBus.cpp in that repository (not in the main repository!).  Also look carefully at how the CMakeLists scripts are set up there to properly specify the paths to data directories.

 

--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/4086e530-d126-48e9-bfda-25e7eaa48632n%40googlegroups.com.

Prabasgarage

unread,
Feb 27, 2024, 12:19:54 PM2/27/24
to ProjectChrono

Thanks for the reference to the chrono_project Radu. I had a look at it.

I think my problem is chrono_data_dir is pointing to chrono/data while the obj file search path also begins with /data/vehicle/MAN_kat1/meshes..... so the "data" folder is repeated in the path. Not sure how to rectify this path issue though. 
my_example.cpp
obj data.png
CMakeLists.txt
Reply all
Reply to author
Forward
0 new messages