meta-ros icon indicating copy to clipboard operation
meta-ros copied to clipboard

{WIP} Add new recipe for building Gazebo Classic

Open robwoolley opened this issue 10 months ago • 3 comments

This has some outstanding issues with building against Boost.

Sharing as a PR to get help with resolving the Boost issues.

robwoolley avatar Feb 17 '25 18:02 robwoolley

Thanks for giving this a shot, @robwoolley! I am not able to get to the Boost errors because CMake is having a hard time finding my OGRE installation. My build of gazebo11 using your recipe fails here:

| -- BUILD ERRORS: These must be resolved before compiling.
| --    Missing: Ogre3d version >=1.7.4(http://www.orge3d.org)

When scrolling up through the logs, I see:

| CMake Warning at cmake/SearchForStuff.cmake:421 (find_package):
|   By not providing "FindOGRE.cmake" in CMAKE_MODULE_PATH this project has
|   asked CMake to find a package configuration file provided by "OGRE", but
|   CMake did not find one.
| 
|   Could not find a package configuration file provided by "OGRE" with any of
|   the following names:
| 
|     OGREConfig.cmake
|     ogre-config.cmake
| 
|   Add the installation prefix of "OGRE" to CMAKE_PREFIX_PATH or set
|   "OGRE_DIR" to a directory containing one of the above files.  If "OGRE"
|   provides a separate development package or SDK, be sure it has been
|   installed.

Did you encounter this same problem?

graceagrace avatar Feb 17 '25 19:02 graceagrace

My apologies, I forgot to commit some local changes that fixed that. This commit should fix that: https://github.com/robwoolley/meta-ros/commit/621043dc83e2537d8acf27160a228c504da20964

The boost problems that I am seeing are:

| In file included from $BUILDDIR/tmp/work/core2-64-oe-linux/gazebo11/11.15.1/build/gazebo/transport/transport.hh:3,
|                  from<BUILDDIR>/tmp/work/core2-64-oe-linux/gazebo11/11.15.1/git/gazebo/util/LogRecord.cc:54:
| $BUILDDIR/tmp/work/core2-64-oe-linux/gazebo11/11.15.1/git/gazebo/transport/Connection.hh:412:19: error: 'boost::asio::ip::resolver::iterator' has not been declared
|   412 |                   boost::asio::ip::tcp::resolver::iterator _endPointIter);
|       |                   ^~~~~
| In file included from $BUILDDIR/tmp/work/core2-64-oe-linux/gazebo11/11.15.1/build/gazebo/transport/transport.hh:5:
| $BUILDDIR/tmp/work/core2-64-oe-linux/gazebo11/11.15.1/git/gazebo/transport/IOManager.hh:45:28: error: 'io_service' in namespace 'boost::asio' does not name a type; did you mean 'use_service'?
|    45 |       public: boost::asio::io_service &GetIO();
|       |                            ^~~~~~~~~~
|       |                            use_service                                                                                                                                                                 

robwoolley avatar Feb 17 '25 19:02 robwoolley

Progress! I'm stuck here, now:

| cc1plus: warning: $BUILDDIR/tmp/work/core2-64-linux/gazebo11/11.15.1/recipe-sysroot/usr/include/OGRE: No such file or directory [-Wmissing-include-dirs]
| In file included from $BUILDDIR/tmp/work/core2-64-linux/gazebo11/11.15.1/git/gazebo/server_main.cc:21:
| $BUILDDIR/tmp/work/core2-64-linux/gazebo11/11.15.1/git/gazebo/rendering/ogre_gazebo.h:26:10: fatal error: OGRE/Ogre.h: No such file or directory
|    26 | #include <OGRE/Ogre.h>
|       |          ^~~~~~~~~~~~~
| compilation terminated.

The naive solution I tried first was to change the path for all the includes in ogre_gazebo.h to OGRE19 instead of OGRE,which resolves the above... but then the compiler complains about headers within the recipe sysroot installation of OGRE not finding one another, like this:

cc1plus: warning:$BUILDDIR/tmp/work/core2-64-linux/gazebo11/11.15.1/recipe-sysroot/usr/include/OGRE: No such file or directory [-Wmissing-include-dirs]
In file included from $BUILDDIR/tmp/work/core2-64-linux/gazebo11/11.15.1/recipe-sysroot/usr/include/OGRE19/Paging/OgrePageManager.h:32,
                 from $BUILDDIR/tmp/work/core2-64-linux/gazebo11/11.15.1/git/gazebo/rendering/ogre_gazebo.h:59,
                 from $BUILDDIR/tmp/work/core2-64-linux/gazebo11/11.15.1/git/gazebo/server_main.cc:21:
$BUILDDIR/tmp/work/core2-64-linux/gazebo11/11.15.1/recipe-sysroot/usr/include/OGRE19/Paging/OgrePagingPrerequisites.h:32:10: fatal error: OgrePrerequisites.h: No such file or directory
   32 | #include "OgrePrerequisites.h"
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.

No sign of the boost issue, yet, but I'm confident I can patch it. It seems this change to boost caused a headache for a lot of package maintainers, and there is a fairly straightforward substitution.

graceagrace avatar Feb 17 '25 21:02 graceagrace

I have merged preliminary recipes for gazebo11 into the tree. It isn't part of desktop-full anymore, so it won't build by default. It may require additional fixes to make it build successfully on any given supported combination of Yocto and ROS 2. Please feel free to file any issues or pull requests for any problems you find against it.

robwoolley avatar Feb 24 '25 21:02 robwoolley

@robwoolley, thank you for your effort on this. I realize Gazebo Classic is now EOL, so this is not a high-priority package for meta-ros, but I'll try to spend some time in the coming weeks ensuring it builds and works at runtime. Again, thank you very much for the great start on this!

graceagrace avatar Mar 03 '25 15:03 graceagrace