-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding ign_gazebo_dev package #240
Draft
harshmahesheka
wants to merge
2
commits into
gazebosim:foxy
Choose a base branch
from
harshmahesheka:foxy
base: foxy
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
find_package(ament_cmake REQUIRED) | ||
project(ign_gazebo_dev) | ||
|
||
ament_package( | ||
CONFIG_EXTRAS cmake/ignition_gazebo_dev-extras.cmake) |
24 changes: 24 additions & 0 deletions
24
ros_ign_dev/ign_gazebo_dev/cmake/ignition_gazebo_dev-extras.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# This code here calls and sets required igniton gazebo based on ROS Distribution so,packages can directly go find_package(ign_gazebo_dev) so,that | ||
# they don't need to change code with different ros distros | ||
set( ENV{OVERRIDE_ROS_GZ_VERSION} 6 ) | ||
|
||
if(DEFINED ENV{ROS_DISTRO}) | ||
message(STATUS "Detected ROS Distro is $ENV{ROS_DISTRO}") | ||
endif() | ||
|
||
if("$ENV{ROS_DISTRO}" MATCHES "foxy") | ||
find_package(ignition-gazebo3 REQUIRED) | ||
set(IGN_GAZEBO_VER ${ignition-gazebo3_VERSION_MAJOR}) | ||
elseif("$ENV{ROS_DISTRO}" MATCHES "galactic") | ||
find_package(ignition-gazebo5 REQUIRED) | ||
set(IGN_GAZEBO_VER ${ignition-gazebo5_VERSION_MAJOR}) | ||
elseif("$ENV{ROS_DISTRO}" MATCHES "humble") | ||
find_package(ignition-gazebo6 REQUIRED) | ||
set(IGN_GAZEBO_VER ${ignition-gazebo6_VERSION_MAJOR}) | ||
else() | ||
message(STATUS "No ROS Distro detected") | ||
message(STATUS "Setting to default gazebo version") | ||
find_package(ignition-gazebo$ENV{OVERRIDE_ROS_GZ_VERSION} REQUIRED) | ||
set(IGN_GAZEBO_VER ${ignition-gazebo$ENV{OVERRIDE_ROS_GZ_VERSION}_VERSION_MAJOR}) | ||
|
||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0"?> | ||
<package format="3"> | ||
<name>ign_gazebo_dev</name> | ||
<version>1.0.0</version> | ||
<description>Package to pull default ignition gazebo version for each ROS distro</description> | ||
|
||
<maintainer email="[email protected]">Harsh Mahesheka</maintainer> | ||
|
||
<license>Apache License 2.0</license> | ||
|
||
<author>Harsh Mahesheka</author> | ||
|
||
<build_depend>ros_environment</build_depend> | ||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
<depend condition="$ROS_DISTRO == foxy">ignition-gazebo3</depend> | ||
<depend condition="$ROS_DISTRO == galactic">ignition-gazebo5</depend> | ||
<depend condition="$ROS_DISTRO == humble">ignition-gazebo6</depend> | ||
|
||
<!-- If no known ROS DISTRO is found,it will fall back to default a version --> | ||
|
||
<depend condition="$ROS_DISTRO !=humble and $ROS_DISTRO !=galactic and $ROS_DISTRO!=foxy" >ignition-gazebo6</depend> | ||
|
||
|
||
|
||
|
||
|
||
<!-- The above line makes the package depend on igniton version based on ROS Distribution So, packages can directly depend on it | ||
so that they don't have to change code with different ros distros --> | ||
<export> | ||
<build_type>ament_cmake</build_type> | ||
</export> | ||
</package> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is probably worth allowing an override / fallback for unofficial ROS distributions.
Using a CMake variable like
OVERRIDE_ROS_GZ_VERSION
or similar for override or checkingROS_GZ_VERSION
environment variable to fall back to if no known ROS_DISTRO is found.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added ign fortress as an override version in ignition_gazebo_dev-extras.cmake and package.xml.