Skip to content

Commit

Permalink
Add harmonic CI (#447)
Browse files Browse the repository at this point in the history
* Add harmonic CI

Signed-off-by: Michael Carroll <[email protected]>

* Include garden options

Signed-off-by: Michael Carroll <[email protected]>

* Add harmonic stanza

Signed-off-by: Michael Carroll <[email protected]>

* Additional message headers

Signed-off-by: Michael Carroll <[email protected]>

---------

Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll authored and azeey committed Nov 14, 2023
1 parent 55eebea commit e7b1824
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 11 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ if [ "$GZ_VERSION" == "garden" ]; then

GZ_DEPS="libgz-sim7-dev"

ROSDEP_ARGS="--skip-keys='sdformat-urdf'"
elif [ "$GZ_VERSION" == "harmonic" ]; then
echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list
echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-nightly `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-nightly.list
wget https://packages.osrfoundation.org/gazebo.key -O - | apt-key add -

GZ_DEPS="libgz-sim8-dev"

ROSDEP_ARGS="--skip-keys='sdformat-urdf'"
fi

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ros2-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
- docker-image: "ubuntu:22.04"
gz-version: "garden"
ros-distro: "rolling"
- docker-image: "ubuntu:22.04"
gz-version: "harmonic"
ros-distro: "rolling"
container:
image: ${{ matrix.docker-image }}
steps:
Expand Down
9 changes: 9 additions & 0 deletions ros_gz_bridge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ elseif("$ENV{GZ_VERSION}" STREQUAL "garden")
set(GZ_TRANSPORT_VER ${gz-transport12_VERSION_MAJOR})

message(STATUS "Compiling against Gazebo Garden")
elseif("$ENV{GZ_VERSION}" STREQUAL "harmonic")
find_package(gz-transport13 REQUIRED)
find_package(gz-msgs10 REQUIRED)

set(GZ_TARGET_PREFIX gz)
set(GZ_MSGS_VER ${gz-msgs10_VERSION_MAJOR})
set(GZ_TRANSPORT_VER ${gz-transport13_VERSION_MAJOR})

message(STATUS "Compiling against Gazebo Harmonic")
# Default to Fortress
else()
find_package(ignition-transport11 REQUIRED)
Expand Down
3 changes: 3 additions & 0 deletions ros_gz_bridge/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<!-- Garden -->
<depend condition="$GZ_VERSION == garden or $IGNITION_VERSION == garden">gz-msgs9</depend>
<depend condition="$GZ_VERSION == garden or $IGNITION_VERSION == garden">gz-transport12</depend>
<!-- Harmonic -->
<depend condition="$GZ_VERSION == harmonic">gz-msgs10</depend>
<depend condition="$GZ_VERSION == harmonic">gz-transport13</depend>
<!-- Fortress (default) -->
<depend condition="$GZ_VERSION == fortress or $IGNITION_VERSION == fortress">ignition-msgs8</depend>
<depend condition="$GZ_VERSION == fortress or $IGNITION_VERSION == fortress">ignition-transport11</depend>
Expand Down
9 changes: 9 additions & 0 deletions ros_gz_image/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ elseif("$ENV{GZ_VERSION}" STREQUAL "garden")

set(GZ_TARGET_PREFIX gz)

message(STATUS "Compiling against Gazebo Garden")
elseif("$ENV{GZ_VERSION}" STREQUAL "harmonic")
find_package(gz-transport13 REQUIRED)
find_package(gz-msgs10 REQUIRED)

set(GZ_TARGET_PREFIX gz)
set(GZ_MSGS_VER ${gz-msgs10_VERSION_MAJOR})
set(GZ_TRANSPORT_VER ${gz-transport13_VERSION_MAJOR})

message(STATUS "Compiling against Gazebo Garden")
# Default to Fortress
else()
Expand Down
4 changes: 4 additions & 0 deletions ros_gz_image/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<depend condition="$GZ_VERSION == edifice or $IGNITION_VERSION == edifice">ignition-msgs7</depend>
<depend condition="$GZ_VERSION == edifice or $IGNITION_VERSION == edifice">ignition-transport10</depend>

<!-- Harmonic -->
<depend condition="$GZ_VERSION == harmonic">gz-msgs10</depend>
<depend condition="$GZ_VERSION == harmonic">gz-transport13</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<export>
Expand Down
16 changes: 16 additions & 0 deletions ros_gz_sim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ elseif("$ENV{GZ_VERSION}" STREQUAL "garden")
set(GZ_TARGET_PREFIX gz)

message(STATUS "Compiling against Gazebo Garden")
elseif("$ENV{GZ_VERSION}" STREQUAL "harmonic")
find_package(gz-math7 REQUIRED)
set(GZ_MATH_VER ${gz-math7_VERSION_MAJOR})

find_package(gz-transport13 REQUIRED)
set(GZ_TRANSPORT_VER ${gz-transport13_VERSION_MAJOR})

find_package(gz-msgs10 REQUIRED)
set(GZ_MSGS_VER ${gz-msgs10_VERSION_MAJOR})

find_package(gz-sim8 REQUIRED)
set(GZ_SIM_VER ${gz-sim8_VERSION_MAJOR})

set(GZ_TARGET_PREFIX gz)

message(STATUS "Compiling against Gazebo Harmonic")
# Default to Fortress
else()
find_package(ignition-math6 REQUIRED)
Expand Down
5 changes: 5 additions & 0 deletions ros_gz_sim/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
<!-- Edifice -->
<depend condition="$GZ_VERSION == edifice or $IGNITION_VERSION == edifice">ignition-gazebo5</depend>
<depend condition="$GZ_VERSION == edifice or $IGNITION_VERSION == edifice">ignition-math6</depend>
<!-- Harmonic -->
<depend condition="$GZ_VERSION == harmonic">gz-math7</depend>
<depend condition="$GZ_VERSION == harmonic">gz-msgs10</depend>
<depend condition="$GZ_VERSION == harmonic">gz-sim8</depend>
<depend condition="$GZ_VERSION == harmonic">gz-transport13</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
Expand Down
26 changes: 15 additions & 11 deletions ros_gz_sim/src/create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@
// limitations under the License.

#include <gflags/gflags.h>
#include <ignition/msgs/entity_factory.pb.h>

#include <gz/msgs/boolean.pb.h>
#include <gz/msgs/entity.pb.h>
#include <gz/msgs/entity_factory.pb.h>
#include <gz/msgs/stringmsg_v.pb.h>

#include <sstream>
#include <string>

#include <ignition/math/Pose3.hh>
#include <ignition/msgs/Utility.hh>
#include <ignition/transport/Node.hh>
#include <gz/math/Pose3.hh>
#include <gz/msgs/Utility.hh>
#include <gz/transport/Node.hh>

#include <rclcpp/rclcpp.hpp>
#include <std_msgs/msg/string.hpp>
Expand Down Expand Up @@ -59,13 +63,13 @@ int main(int _argc, char ** _argv)
std::string world_name = FLAGS_world;
if (world_name.empty()) {
// If caller doesn't provide a world name, get list of worlds from gz-sim server
ignition::transport::Node node;
gz::transport::Node node;

bool executed{false};
bool result{false};
unsigned int timeout{5000};
std::string service{"/gazebo/worlds"};
ignition::msgs::StringMsg_V worlds_msg;
gz::msgs::StringMsg_V worlds_msg;

// This loop is here to allow the server time to download resources.
while (rclcpp::ok() && !executed) {
Expand All @@ -88,7 +92,7 @@ int main(int _argc, char ** _argv)
std::string service{"/world/" + world_name + "/create"};

// Request message
ignition::msgs::EntityFactory req;
gz::msgs::EntityFactory req;

// File
if (!FLAGS_file.empty()) {
Expand Down Expand Up @@ -142,8 +146,8 @@ int main(int _argc, char ** _argv)
}

// Pose
ignition::math::Pose3d pose{FLAGS_x, FLAGS_y, FLAGS_z, FLAGS_R, FLAGS_P, FLAGS_Y};
ignition::msgs::Set(req.mutable_pose(), pose);
gz::math::Pose3d pose{FLAGS_x, FLAGS_y, FLAGS_z, FLAGS_R, FLAGS_P, FLAGS_Y};
gz::msgs::Set(req.mutable_pose(), pose);

// Name
if (!FLAGS_name.empty()) {
Expand All @@ -155,8 +159,8 @@ int main(int _argc, char ** _argv)
}

// Request
ignition::transport::Node node;
ignition::msgs::Boolean rep;
gz::transport::Node node;
gz::msgs::Boolean rep;
bool result;
unsigned int timeout = 5000;
bool executed = node.Request(service, req, timeout, rep, result);
Expand Down

0 comments on commit e7b1824

Please sign in to comment.