MRPT / mvsim

Vehicle and mobile robotics simulator. C++ & Python API. Use it as a standalone application or via ROS 1 or ROS 2
https://mvsimulator.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
251 stars 40 forks source link

Catkin build failure while cloning into a catkin workspace #33

Closed omerfarukadastec closed 10 months ago

omerfarukadastec commented 10 months ago

Hi,

I am trying to install MVSim as a ROS package. Because of that, I created a new catkin workspace and sourced "/opt/ros/noetic/setup.bash". But I got a catkin build error as you can see in below:

../../apply-protol.sh: line 7: /home/username/catkin_ws/build/mvsim/venv/bin/activate: No such file or directory make[2]: [modules/msgs/CMakeFiles/mvsim-msgs.dir/build.make:915: modules/msgs/lib/libmvsim-msgs.so.0.8.1] Error 1 make[2]: Deleting file 'modules/msgs/lib/libmvsim-msgs.so.0.8.1' make[1]: [CMakeFiles/Makefile2:2249: modules/msgs/CMakeFiles/mvsim-msgs.dir/all] Error 2 make: [Makefile:141: all] Error 2

I googled it for solving but I cannot find anything useful. What should I do?

Thanks in advance.

jlblancoc commented 10 months ago

Have you tried building with colcon instead? colcon is used for ROS 2, but it works great for ROS1 too. Just clone as usual in a clean workspace, and run colcon build --symlink-install instead of the catkin command.

If you can confirm it works for you with colcon but fails with catkin, I might try to fix it, but as long as we normally build everything with colcon nowadays it wouldn't be a top priority.

jlblancoc commented 10 months ago

PS: You can also just install it with sudo apt install ros-noetic-mvsim if you don't want to "dig" into the sources...

omerfarukadastec commented 10 months ago

When I tried to setup MVSim with sudo apt install ros-noetic-mvsim, apt said to me that it would install these packages (libxxf86vm-dev python3-venv python3.8-venv ros-noetic-mrpt2 ros-noetic-mvsim x11proto-xf86vidmode-dev) as well. So I installed these packages without ros-noetic-mvsim and after that I tried to rebuild with catkin. Now I am getting a different error as you can see in below:

/home/username/catkin_ws/src/mvsim/modules/comms/python/generated-sources-pybind/std/exception.cpp: In member function ‘virtual const char PyCallBack_std_exception::what() const’: /home/username/catkin_ws/src/mvsim/modules/comms/python/generated-sources-pybind/std/exception.cpp:37:30: error: ‘override_caster_t’ in namespace ‘pybind11::detail’ does not name a template type; did you mean ‘overload_caster_t’? 37 | static pybind11::detail::override_caster_t<const char> caster; | ^~~~~ | overload_caster_t /home/username/catkin_ws/src/mvsim/modules/comms/python/generated-sources-pybind/std/exception.cpp:40:20: error: ‘caster’ was not declared in this scope 40 | std::move(o), caster); | ^~ /home/username/catkin_ws/src/mvsim/modules/comms/python/generated-sources-pybind/std/stdexcept.cpp: In member function ‘virtual const char PyCallBack_std_runtime_error::what() const’: /home/username/catkin_ws/src/mvsim/modules/comms/python/generated-sources-pybind/std/stdexcept.cpp:39:30: error: ‘override_caster_t’ in namespace ‘pybind11::detail’ does not name a template type; did you mean ‘overload_caster_t’? 39 | static pybind11::detail::override_caster_t<const char> caster; | ^~~~~ | overload_caster_t /home/username/catkin_ws/src/mvsim/modules/comms/python/generated-sources-pybind/std/stdexcept.cpp:42:20: error: ‘caster’ was not declared in this scope 42 | std::move(o), caster); | ^~ /home/username/catkin_ws/src/mvsim/modules/comms/python/generated-sources-pybind/mvsim/Comms/common.cpp: In member function ‘virtual const char PyCallBack_mvsim_UnexpectedMessageException::what() const’: /home/username/catkin_ws/src/mvsim/modules/comms/python/generated-sources-pybind/mvsim/Comms/common.cpp:40:30: error: ‘override_caster_t’ in namespace ‘pybind11::detail’ does not name a template type; did you mean ‘overload_caster_t’? 40 | static pybind11::detail::override_caster_t<const char> caster; | ^~~~~ | overload_caster_t /home/username/catkin_ws/src/mvsim/modules/comms/python/generated-sources-pybind/mvsim/Comms/common.cpp:43:20: error: ‘caster’ was not declared in this scope 43 | std::move(o), caster); | ^~ make[2]: [modules/comms/CMakeFiles/pymvsim_comms.dir/build.make:102: modules/comms/CMakeFiles/pymvsim_comms.dir/python/generated-sources-pybind/std/exception.cpp.o] Error 1 make[2]: Waiting for unfinished jobs.... make[2]: [modules/comms/CMakeFiles/pymvsim_comms.dir/build.make:76: modules/comms/CMakeFiles/pymvsim_comms.dir/python/generated-sources-pybind/mvsim/Comms/common.cpp.o] Error 1 make[2]: [modules/comms/CMakeFiles/pymvsim_comms.dir/build.make:115: modules/comms/CMakeFiles/pymvsim_comms.dir/python/generated-sources-pybind/std/stdexcept.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:2195: modules/comms/CMakeFiles/pymvsim_comms.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... In file included from /opt/ros/noetic/include/mrpt/core/include/mrpt/core/format.h:12, from /opt/ros/noetic/include/mrpt/math/include/mrpt/math/TPoint2D.h:12, from /home/username/catkin_ws/src/mvsim/modules/simulator/include/mvsim/basic_types.h:13, from /home/username/catkin_ws/src/mvsim/modules/simulator/include/mvsim/ClassFactory.h:11, from /home/username/catkin_ws/src/mvsim/modules/simulator/include/mvsim/FrictionModels/FrictionBase.h:12, from /home/username/catkin_ws/src/mvsim/modules/simulator/include/mvsim/FrictionModels/DefaultFriction.h:13, from /home/username/catkin_ws/src/mvsim/modules/simulator/src/FrictionModels/FrictionBase.cpp:10: /home/username/catkinws/src/mvsim/modules/simulator/src/FrictionModels/FrictionBase.cpp:21:1: note: #pragma message: TODO: When each wheel will have its own friction - remove logger. 21 | MRPTTODO("When each wheel will have its own friction - remove logger.") | ^~~~~ In file included from /opt/ros/noetic/include/mrpt/core/include/mrpt/core/format.h:12, from /opt/ros/noetic/include/mrpt/math/include/mrpt/math/TPoint2D.h:12, from /opt/ros/noetic/include/mrpt/math/include/mrpt/math/TPose2D.h:12, from /home/username/catkin_ws/src/mvsim/modules/simulator/src/VehicleBase.cpp:11: /home/username/catkin_ws/src/mvsim/modules/simulator/src/VehicleBase.cpp: In member function ‘virtual void mvsim::VehicleBase::simul_pre_timestep(const mvsim::TSimulContext&)’: /home/username/catkin_ws/src/mvsim/modules/simulator/src/VehicleBase.cpp:413:2: note: #pragma message: TODO: Use chassis cog point 413 | MRPT_TODO("Use chassis cog point"); | ^~~~~ In file included from /opt/ros/noetic/include/mrpt/core/include/mrpt/core/exceptions.h:14, from /opt/ros/noetic/include/mrpt/core/include/mrpt/core/safe_pointers.h:11, from /opt/ros/noetic/include/mrpt/maps/include/mrpt/maps/CPointsMap.h:15, from /opt/ros/noetic/include/mrpt/maps/include/mrpt/maps/CSimplePointsMap.h:11, from /home/username/catkin_ws/src/mvsim/modules/simulator/src/Sensors/Lidar3D.cpp:11: /home/username/catkin_ws/src/mvsim/modules/simulator/src/Sensors/Lidar3D.cpp:32:1: note: #pragma message: TODO: Also store obs as CObservationRotatingScan? 32 | MRPT_TODO("Also store obs as CObservationRotatingScan?") | ^~~~~ /home/username/catkin_ws/src/mvsim/modules/simulator/src/Sensors/Lidar3D.cpp: In member function ‘virtual void mvsim::Lidar3D::internalGuiUpdate(mrpt::optional_ref&, mrpt::optional_ref&, bool)’: /home/username/catkin_ws/src/mvsim/modules/simulator/src/Sensors/Lidar3D.cpp:116:3: note: #pragma message: TODO: render 3D lidar FOV 116 | MRPT_TODO("render 3D lidar FOV"); | ^~~~~ In file included from /opt/ros/noetic/include/mrpt/core/include/mrpt/core/exceptions.h:14, from /opt/ros/noetic/include/mrpt/core/include/mrpt/core/safe_pointers.h:11, from /opt/ros/noetic/include/mrpt/opengl/include/mrpt/opengl/Viewport.h:12, from /opt/ros/noetic/include/mrpt/opengl/include/mrpt/opengl/COpenGLViewport.h:11, from /opt/ros/noetic/include/mrpt/opengl/include/mrpt/opengl/COpenGLScene.h:11, from /home/username/catkin_ws/src/mvsim/modules/simulator/src/WorldElements/ElevationMap.cpp:10: /home/username/catkin_ws/src/mvsim/modules/simulator/src/WorldElements/ElevationMap.cpp: In member function ‘virtual void mvsim::ElevationMap::loadConfigFrom(const rapidxml::xml_node*)’: /home/username/catkin_ws/src/mvsim/modules/simulator/src/WorldElements/ElevationMap.cpp:98:3: note: #pragma message: TODO: Imgs or txt matrix 98 | MRPT_TODO("Imgs or txt matrix") | ^~~~~ make: *** [Makefile:141: all] Error 2

I gave that error when the build process is %90. What should I do?

PS: I installed with apt, I am using it well. I am writing this to let you know and maybe other people will benefit from it.

jlblancoc commented 10 months ago

That "overload_caster_t" error is due to a mismatch in the expected version of pybind11... which I think was handled automatically whatever version you used, but it seems it fails in your case for some reason (?).

Anyhow, if you don't need the MVSIM Python API (you can still use the regular ROS Python API), just go to the "catkin_ws" build directory for mvsim, and run cmake . -DMVSIM_WITH_PYTHON=OFF to disable that feature, then try continue building.

omerfarukadastec commented 10 months ago

It worked that building with cmake argument -DMVSIM_WITH_PYTHON=OFF. Thank you very much for your interest. Also, I congratulate you for developing such a useful application. Really easy to use and great performance.

jlblancoc commented 10 months ago

Awesome! 👍