Skip to content

Commit

Permalink
Merge pull request #571 from azeey/jazzy_to_ros2
Browse files Browse the repository at this point in the history
Merge jazzy ➡️  ros2
  • Loading branch information
ahcorde authored Jun 28, 2024
2 parents a781b78 + cc9eb90 commit c70f23f
Show file tree
Hide file tree
Showing 11 changed files with 228 additions and 84 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ Foxy | Edifice | [foxy](https://github.com/gazebosim/ros_gz/tree/foxy) | only fr
Galactic | Edifice | [galactic](https://github.com/gazebosim/ros_gz/tree/galactic) | https://packages.ros.org
Galactic | Fortress | [galactic](https://github.com/gazebosim/ros_gz/tree/galactic) | only from source
Humble | Fortress | [humble](https://github.com/gazebosim/ros_gz/tree/humble) | https://packages.ros.org
Humble | Garden | [humble](https://github.com/gazebosim/ros_gz/tree/humble) | only from source
Iron | Fortress | [iron](https://github.com/gazebosim/ros_gz/tree/iron) | https://packages.ros.org
Iron | Garden | [iron](https://github.com/gazebosim/ros_gz/tree/iron) | only from source
Iron | Harmonic | [iron](https://github.com/gazebosim/ros_gz/tree/iron) | only from source
Jazzy* | Fortress | [humble](https://github.com/gazebosim/ros_gz/tree/humble) | only from source
Humble | Garden | [humble](https://github.com/gazebosim/ros_gz/tree/humble) | [gazebo packages](https://gazebosim.org/docs/latest/ros_installation#gazebo-garden-with-ros-2-humble-iron-or-rolling-use-with-caution-)[^1]
Humble | Harmonic | [humble](https://github.com/gazebosim/ros_gz/tree/humble) | [gazebo packages](https://gazebosim.org/docs/harmonic/ros_installation#-gazebo-harmonic-with-ros-2-humble-iron-or-rolling-use-with-caution-)[^1]
Iron | Fortress | [humble](https://github.com/gazebosim/ros_gz/tree/iron) | https://packages.ros.org
Iron | Garden | [humble](https://github.com/gazebosim/ros_gz/tree/iron) | only from source
Iron | Harmonic | [humble](https://github.com/gazebosim/ros_gz/tree/iron) | only from source
Jazzy* | Garden | [ros2](https://github.com/gazebosim/ros_gz/tree/ros2) | only from source
Jazzy* | Harmonic | [ros2](https://github.com/gazebosim/ros_gz/tree/ros2) | https://packages.ros.org
Rolling | Fortress | [humble](https://github.com/gazebosim/ros_gz/tree/humble) | https://packages.ros.org
Rolling | Garden | [ros2](https://github.com/gazebosim/ros_gz/tree/ros2) | only from source
Rolling | Harmonic | [ros2](https://github.com/gazebosim/ros_gz/tree/ros2) | only from source

[^1]: Binaries for these pairings are provided from a the packages.osrfoundation.org repository. Refer to https://gazebosim.org/docs/latest/ros_installation for installation instructions.

* ROS 2 Jazzy Jalisco is slated for release on May 23rd, 2024. [Full ROS 2 release information is available in REP-2000.]

For information on ROS(1) and Gazebo compatibility, refer to the [noetic branch README](https://github.com/gazebosim/ros_gz/tree/noetic)
Expand Down Expand Up @@ -91,7 +93,7 @@ Install either [Edifice, Fortress, or Garden](https://gazebosim.org/docs).
Set the `GZ_VERSION` environment variable to the Gazebo version you'd
like to compile against. For example:

export GZ_VERSION=edifice
export GZ_VERSION=edifice # IMPORTANT: Replace with correct version

> You only need to set this variable when compiling, not when running.
Expand Down
6 changes: 3 additions & 3 deletions ros_gz_bridge/ros_gz_bridge/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ def ign_string(self):
return f'ignition.msgs.{self.gz_message_name}'

def ign_type(self):
# Return GZ type of a message (eg ignition::msgs::Bool)
return f'ignition::msgs::{self.gz_message_name}'
# Return GZ type of a message (eg gz::msgs::Bool)
return f'gz::msgs::{self.gz_message_name}'

def gz_string(self):
# Return GZ string version of a message (eg ignition.msgs.Bool)
return f'gz.msgs.{self.gz_message_name}'

def gz_type(self):
# Return GZ type of a message (eg ignition::msgs::Bool)
# Return GZ type of a message (eg gz::msgs::Bool)
return f'gz::msgs::{self.gz_message_name}'

def unique(self):
Expand Down
2 changes: 1 addition & 1 deletion ros_gz_bridge/src/convert/gps_msgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ convert_gz_to_ros(
ros_msg.track = atan2(gz_msg.velocity_north(), gz_msg.velocity_east());
ros_msg.climb = gz_msg.velocity_up();

// position_covariance is not supported in Ignition::Msgs::NavSat.
// position_covariance is not supported in gz::msgs::NavSat.
ros_msg.position_covariance_type = gps_msgs::msg::GPSFix::COVARIANCE_TYPE_UNKNOWN;
ros_msg.status.status = gps_msgs::msg::GPSStatus::STATUS_GBAS_FIX;
}
Expand Down
2 changes: 1 addition & 1 deletion ros_gz_bridge/src/convert/sensor_msgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ convert_gz_to_ros(
ros_msg.longitude = gz_msg.longitude_deg();
ros_msg.altitude = gz_msg.altitude();

// position_covariance is not supported in Ignition::Msgs::NavSat.
// position_covariance is not supported in gz::msgs::NavSat.
ros_msg.position_covariance_type = sensor_msgs::msg::NavSatFix::COVARIANCE_TYPE_UNKNOWN;
ros_msg.status.status = sensor_msgs::msg::NavSatStatus::STATUS_FIX;
}
Expand Down
4 changes: 3 additions & 1 deletion ros_gz_bridge/test/utils/gz_test_msg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ void compareTestMsg(const std::shared_ptr<gz::msgs::SensorNoise> & _msg)
gz::msgs::SensorNoise expected_msg;
createTestMsg(expected_msg);

EXPECT_EQ(expected_msg.type(), gz::msgs::SensorNoise_Type::SensorNoise_Type_GAUSSIAN_QUANTIZED);
EXPECT_EQ(
expected_msg.type(),
gz::msgs::SensorNoise_Type::SensorNoise_Type_GAUSSIAN_QUANTIZED);
EXPECT_EQ(expected_msg.mean(), _msg->mean());
EXPECT_EQ(expected_msg.stddev(), _msg->stddev());
EXPECT_EQ(expected_msg.bias_mean(), _msg->bias_mean());
Expand Down
2 changes: 1 addition & 1 deletion ros_gz_image/test/publishers/gz_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ int main(int /*argc*/, char **/*argv*/)
gz::transport::Node node;

// gz::msgs::Image.
auto image_pub = node.Advertise<ignition::msgs::Image>("image");
auto image_pub = node.Advertise<gz::msgs::Image>("image");
gz::msgs::Image image_msg;
ros_gz_image::testing::createTestMsg(image_msg);

Expand Down
18 changes: 9 additions & 9 deletions ros_gz_image/test/test_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <chrono>
#include <string>
#include <thread>
#include <ignition/msgs.hh>
#include <gz/msgs.hh>

namespace ros_gz_image
{
Expand Down Expand Up @@ -142,7 +142,7 @@ namespace testing

/// \brief Create a message used for testing.
/// \param[out] _msg The message populated.
void createTestMsg(ignition::msgs::Header &_msg)
void createTestMsg(gz::msgs::Header &_msg)
{
auto seq_entry = _msg.add_data();
seq_entry->set_key("seq");
Expand All @@ -156,9 +156,9 @@ namespace testing

/// \brief Compare a message with the populated for testing.
/// \param[in] _msg The message to compare.
void compareTestMsg(const ignition::msgs::Header &_msg)
void compareTestMsg(const gz::msgs::Header &_msg)
{
ignition::msgs::Header expected_msg;
gz::msgs::Header expected_msg;
createTestMsg(expected_msg);

EXPECT_EQ(expected_msg.stamp().sec(), _msg.stamp().sec());
Expand All @@ -183,24 +183,24 @@ namespace testing

/// \brief Create a message used for testing.
/// \param[out] _msg The message populated.
void createTestMsg(ignition::msgs::Image &_msg)
void createTestMsg(gz::msgs::Image &_msg)
{
ignition::msgs::Header header_msg;
gz::msgs::Header header_msg;
createTestMsg(header_msg);

_msg.mutable_header()->CopyFrom(header_msg);
_msg.set_width(320);
_msg.set_height(240);
_msg.set_pixel_format_type(ignition::msgs::PixelFormatType::RGB_INT8);
_msg.set_pixel_format_type(gz::msgs::PixelFormatType::RGB_INT8);
_msg.set_step(_msg.width() * 3);
_msg.set_data(std::string(_msg.height() * _msg.step(), '1'));
}

/// \brief Compare a message with the populated for testing.
/// \param[in] _msg The message to compare.
void compareTestMsg(const ignition::msgs::Image &_msg)
void compareTestMsg(const gz::msgs::Image &_msg)
{
ignition::msgs::Image expected_msg;
gz::msgs::Image expected_msg;
createTestMsg(expected_msg);

compareTestMsg(_msg.header());
Expand Down
Loading

0 comments on commit c70f23f

Please sign in to comment.