ami-iit / meshcat-cpp

Self-contained C++ interface for the MeshCat visualizer
BSD 3-Clause "New" or "Revised" License
25 stars 4 forks source link

Unable to run the example #12

Closed GiulioRomualdi closed 10 months ago

GiulioRomualdi commented 10 months ago

I installed meshcat-cpp in the robot-install folder as follows

gromualdi@iiticublap261:~/robot-code/meshcat-cpp/build (master)$ make install
[ 54%] Built target uSockets
[ 90%] Built target MeshcatCpp
Consolidate compiler generated dependencies of target example
[100%] Built target example
Install the project...
-- Install configuration: "Release"
-- Up-to-date: /home/gromualdi/robot-install/lib/libMeshcatCpp.so.0.1.0
-- Up-to-date: /home/gromualdi/robot-install/lib/libMeshcatCpp.so
-- Up-to-date: /home/gromualdi/robot-install/include/MeshcatCpp/Meshcat.h
-- Up-to-date: /home/gromualdi/robot-install/include/MeshcatCpp/Material.h
-- Up-to-date: /home/gromualdi/robot-install/include/MeshcatCpp/MatrixView.h
-- Up-to-date: /home/gromualdi/robot-install/include/MeshcatCpp/Shape.h
-- Up-to-date: /home/gromualdi/robot-install/lib/cmake/MeshcatCpp/MeshcatCppConfigVersion.cmake
-- Up-to-date: /home/gromualdi/robot-install/lib/cmake/MeshcatCpp/MeshcatCppConfig.cmake
-- Up-to-date: /home/gromualdi/robot-install/lib/cmake/MeshcatCpp/MeshcatCppTargets.cmake
-- Up-to-date: /home/gromualdi/robot-install/lib/cmake/MeshcatCpp/MeshcatCppTargets-release.cmake
-- Up-to-date: /home/gromualdi/robot-install/share/MeshcatCpp/misc
-- Up-to-date: /home/gromualdi/robot-install/share/MeshcatCpp/misc/LICENSE_MESHCAT
-- Up-to-date: /home/gromualdi/robot-install/share/MeshcatCpp/misc/main.min.js.THIRD_PARTY_LICENSES.json
-- Up-to-date: /home/gromualdi/robot-install/share/MeshcatCpp/misc/index.html
-- Up-to-date: /home/gromualdi/robot-install/share/MeshcatCpp/misc/main.min.js
-- Up-to-date: /home/gromualdi/robot-install/share/MeshcatCpp/misc/favicon.ico

When I tried to run the example I got a runtime error. Indeed the visualizer is not able to find index.html because it is looking in the build folder build/share/MeshcatCpp

Unable to load the file in "/home/gromualdi/robot-code/meshcat-cpp/build/share/MeshcatCpp/misc/index.html"
terminate called after throwing an instance of 'std::runtime_error

still, this should not happen since I'm using https://github.com/ami-iit/reloc-cpp to locate the installation folder


cc @traversaro

traversaro commented 10 months ago

Probably the example is using the build library instead of the installed one. See the comment in https://github.com/ami-iit/meshcat-cpp/pull/1#issuecomment-1412037838 .