Closed DavideLanzoniSacmi closed 8 months ago
EDIT: there is a Fortress branch now, try that one instead. Original post below:
why should this template use only Garden
This is an example repository. Imo it aims at documenting the concepts rather than trying to provide an exact copy-paste solution for each and every version or ROS / Gazebo combination.
What should I use as template for Gazebo Fortress?
You have to adapt the CMakeLists.txt
to correspond to the package releases for Fortress.
They are listed in the collection-fortress.yaml file.
E.g. you will have to replace
find_package(gz-cmake3 REQUIRED)
find_package(gz-plugin2 REQUIRED COMPONENTS register)
set(GZ_PLUGIN_VER ${gz-plugin2_VERSION_MAJOR})
find_package(gz-common5 REQUIRED COMPONENTS profiler)
set(GZ_COMMON_VER ${gz-common5_VERSION_MAJOR})
find_package(gz-sim7 REQUIRED)
set(GZ_SIM_VER ${gz-sim7_VERSION_MAJOR})
[...]
by:
EDIT: not tested; correct names seem to be rather ignition-cmake2
instead of ign-cmake2
. See further comments in this thread.
find_package(ign-cmake2 REQUIRED)
find_package(ign-plugin1 REQUIRED COMPONENTS register)
set(IGN_PLUGIN_VER ${ign-plugin1_VERSION_MAJOR})
find_package(ign-common4 REQUIRED COMPONENTS profiler)
set(IGN_COMMON_VER ${ign-common4_VERSION_MAJOR})
find_package(ign-gazebo6 REQUIRED)
set(IGN_GAZEBO_VER ${ign-gazebo6_VERSION_MAJOR})
[...]
Obviously not just this section, but throughout the remainder of all CMakeList.txt
files.
Mind also that from Fortress to Garden there has been a rename from "Ignition Gazebo" to "Gazebo Sim" due to trademark issues on the 'Ignition' name. That's e.g. why in above code snippet gz-sim7
for Garden is replaced by ign-gazebo6
for Fortress (as opposed to gz-sim6
).
Also in the code you will have to change many references of gz
and sim
into ign
and gazebo
. For further documentation see the gazebosim.org site.
Anyway, I would not spend the time to try and make this particular repository compile for Fortress. instead, just use it as an example and implement your own code for your project. E.g. start with the system plugin documentation for Fortress, try and get that to compile. The code for that example is in the gz-sim repository (ign-gazebo6 branch), see here.
See also this post on the community forum for more pointers to info on writing Gazebo system plugins.
There is also this upcoming talk at ROSCon2023: Simulate your World: A deeper look at extending Gazebo.
If you have further questions, ask them at the Robotics Stack Exchange instead of here.
Thanks a lot! Really complete answer. I will dig into it better with your pointers
Hi @DavideLanzoniSacmi,
I happened to experience the same error. How are you able to solve all the errors? I try to read the above hints provided but not really sure what to change in the CMakeLists.
Thank you.
@jrutgeer
Found the error. The naming in the yaml file is wrong. On apt,the library name isn't libign-cmake2-dev but libignition-cmake2 which means the version to be called with find_package is ignition-cmake2.
find_package(ignition-cmake2 REQUIRED)
After using ignition-cmake2, find_package works and compile succsed. Can you please confirm? If it is the case we need to keep an history of wrong version names and fix the yaml file itself I suspect it is the case for all libaries version names.
The funny thing is that on the fortress branch the CMakeLists is correct, so people(including me) fall from the beginning because we check the wrong branch :)
@EyalBrilling Yeah, changing to ignition seems to solve most of the package issues. But I have another error arise regarding BasicSystem.hh and FullSystem.hh. Did it also happened to you?
@EyalBrilling
Yes, it seems the correct name is ignition-cmake2
instead of ign-cmake2
.
The yaml file is correct though, as it contains the github repository name and branch:
The CMakeLists.txt
file seems to need rather the corresponding project names, as defined e.g. here.
Anyway, given there appears to be a Fortress branch to this repository now (this thread pre-dates it), the obvious choice is to use that branch, instead of redoing the work. @AlfonGio same remark: try with the Fortress branch instead.
Environment
Description
colcon build --cmake-args -DBUILD_TESTING=ON
should build without errorsros_gz_example_gazebo
looks for gz-cmake3 which is included only in gazebo Garden, but there is no branch for Fortress as template. In the CMake other packages from Garden are required. The actual suggested combination of ROS and Gazebo are Humble + Garden, so why should this template use only Garden? What should I use as template for Gazebo Fortress?Steps to reproduce
Install gazebo for ROS humble (https://gazebosim.org/docs/fortress/ros_installation):
sudo apt-get install ros-humble-ros-gz
Clone this repository under the source folder of a workspace (following https://gazebosim.org/docs/fortress/ros_gz_project_template_guide)
colcon build --cmake-args -DBUILD_TESTING=ON
Output