Skip to content

Commit

Permalink
Imported upstream version '0.247.0' of 'upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
ahcorde committed Nov 2, 2023
1 parent 0ec36c2 commit da1d318
Show file tree
Hide file tree
Showing 42 changed files with 411 additions and 35 deletions.
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Galactic | Edifice | [galactic](https://github.com/gazebosim/ros_gz/tree/galacti
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 | [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
Rolling | Edifice | [ros2](https://github.com/gazebosim/ros_gz/tree/ros2) | only from source
Rolling | Fortress | [ros2](https://github.com/gazebosim/ros_gz/tree/ros2) | https://packages.ros.org
Rolling | Garden | [ros2](https://github.com/gazebosim/ros_gz/tree/ros2) | only from source
Expand Down Expand Up @@ -51,11 +53,11 @@ This repository holds packages that provide integration between

## Install

This branch supports ROS Rolling. See above for other ROS versions.
This branch supports ROS Iron. See above for other ROS versions.

### Binaries

Rolling binaries are available for Fortress.
Iron binaries are available for Fortress.
They are hosted at https://packages.ros.org.

1. Add https://packages.ros.org
Expand All @@ -66,14 +68,14 @@ They are hosted at https://packages.ros.org.

1. Install `ros_gz`

sudo apt install ros-rolling-ros-ign
sudo apt install ros-iron-ros-gz

### From source

#### ROS

Be sure you've installed
[ROS Rolling](https://index.ros.org/doc/ros2/Installation/)
[ROS Iron](https://docs.ros.org/en/iron/Installation.html)
(at least ROS-Base). More ROS dependencies will be installed below.

#### Gazebo
Expand Down Expand Up @@ -121,3 +123,10 @@ The following steps are for Linux and OSX.
cd ~/ws
colcon build
```
## ROSCon 2022
[![](img/video_img.png)](https://vimeo.com/showcase/9954564/video/767127300)
## Project Template
[A template project integrating ROS and Gazebo simulator](https://github.com/gazebosim/ros_gz_project_template)
3 changes: 3 additions & 0 deletions ros_gz/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Changelog for package ros_gz
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.247.0 (2023-11-02)
--------------------

0.245.0 (2023-05-23)
--------------------

Expand Down
2 changes: 1 addition & 1 deletion ros_gz/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- TODO: Make this a metapackage, see
https://github.com/ros2/ros2/issues/408 -->
<name>ros_gz</name>
<version>0.245.0</version>
<version>0.247.0</version>
<description>Meta-package containing interfaces for using ROS 2 with <a href="https://gazebosim.org">Gazebo</a> simulation.</description>
<maintainer email="[email protected]">Louise Poubel</maintainer>
<license>Apache 2.0</license>
Expand Down
15 changes: 15 additions & 0 deletions ros_gz_bridge/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@
Changelog for package ros_gz_bridge
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.247.0 (2023-11-02)
--------------------
* Fix double wait in ros_gz_bridge (`#347 <https://github.com/gazebosim/ros_gz/issues/347>`_) (`#449 <https://github.com/gazebosim/ros_gz/issues/449>`_)
Co-authored-by: ymd-stella <[email protected]>
* [backport iron] SensorNoise msg bridging (`#417 <https://github.com/gazebosim/ros_gz/issues/417>`_) (`#425 <https://github.com/gazebosim/ros_gz/issues/425>`_)
Co-authored-by: Aditya Pande <[email protected]>
* Merge pull request `#420 <https://github.com/gazebosim/ros_gz/issues/420>`_ from gazebosim/ahcorde/iron/backport/411
[backport iron] Update README.md (`#411 <https://github.com/gazebosim/ros_gz/issues/411>`_)
* Merge branch 'iron' into ahcorde/iron/backport/411
* [backport Iron] Added Altimeter msg bridging (`#413 <https://github.com/gazebosim/ros_gz/issues/413>`_) (`#414 <https://github.com/gazebosim/ros_gz/issues/414>`_)
Co-authored-by: Aditya Pande <[email protected]>
* Update README.md (`#411 <https://github.com/gazebosim/ros_gz/issues/411>`_)
The ROS type for gz.msgs.NavSat messages should be **sensor_msgs/msg/NavSatFix** instead of **sensor_msgs/msg/NavSatFixed**
* Contributors: Alejandro Hernández Cordero, Arjun K Haridas

0.245.0 (2023-05-23)
--------------------
* Backport: Add missing rosidl_cmake dep to ros_gz_bridge (`#391 <https://github.com/gazebosim/ros_gz/issues/391>`_) (`#396 <https://github.com/gazebosim/ros_gz/issues/396>`_)
Expand Down
16 changes: 9 additions & 7 deletions ros_gz_bridge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,32 @@ The following message types can be bridged for topics:
| geometry_msgs/msg/TwistWithCovariance| ignition::msgs::TwistWithCovariance |
| nav_msgs/msg/Odometry | ignition::msgs::Odometry |
| nav_msgs/msg/Odometry | ignition::msgs::OdometryWithCovariance |
| rcl_interfaces/msg/ParameterValue | ignition::msgs::Any |
| rcl_interfaces/msg/ParameterValue | ignition::msgs::Any |
| ros_gz_interfaces/msg/Altimeter | ignition::msgs::Altimeter |
| ros_gz_interfaces/msg/Contact | ignition::msgs::Contact |
| ros_gz_interfaces/msg/Contacts | ignition::msgs::Contacts |
| ros_gz_interfaces/msg/Dataframe | ignition::msgs::Dataframe |
| ros_gz_interfaces/msg/Dataframe | ignition::msgs::Dataframe |
| ros_gz_interfaces/msg/Entity | ignition::msgs::Entity |
| ros_gz_interfaces/msg/Float32Array | ignition::msgs::Float_V |
| ros_gz_interfaces/msg/GuiCamera | ignition::msgs::GUICamera |
| ros_gz_interfaces/msg/JointWrench | ignition::msgs::JointWrench |
| ros_gz_interfaces/msg/Light | ignition::msgs::Light |
| ros_gz_interfaces/msg/SensorNoise | ignition::msgs::SensorNoise |
| ros_gz_interfaces/msg/StringVec | ignition::msgs::StringMsg_V |
| ros_gz_interfaces/msg/TrackVisual | ignition::msgs::TrackVisual |
| ros_gz_interfaces/msg/VideoRecord | ignition::msgs::VideoRecord |
| ros_gz_interfaces/msg/WorldControl | ignition::msgs::WorldControl |
| ros_gz_interfaces/msg/VideoRecord | ignition::msgs::VideoRecord |
| ros_gz_interfaces/msg/WorldControl | ignition::msgs::WorldControl |
| rosgraph_msgs/msg/Clock | ignition::msgs::Clock |
| sensor_msgs/msg/BatteryState | ignition::msgs::BatteryState |
| sensor_msgs/msg/CameraInfo | ignition::msgs::CameraInfo |
| sensor_msgs/msg/FluidPressure | ignition::msgs::FluidPressure |
| sensor_msgs/msg/Imu | ignition::msgs::IMU |
| sensor_msgs/msg/Image | ignition::msgs::Image |
| sensor_msgs/msg/JointState | ignition::msgs::Model |
| sensor_msgs/msg/Joy | ignition::msgs::Joy |
| sensor_msgs/msg/Joy | ignition::msgs::Joy |
| sensor_msgs/msg/LaserScan | ignition::msgs::LaserScan |
| sensor_msgs/msg/MagneticField | ignition::msgs::Magnetometer |
| sensor_msgs/msg/NavSatFixed | ignition::msgs::NavSat |
| sensor_msgs/msg/NavSatFix | ignition::msgs::NavSat |
| sensor_msgs/msg/PointCloud2 | ignition::msgs::PointCloudPacked |
| tf2_msgs/msg/TFMessage | ignition::msgs::Pose_V |
| trajectory_msgs/msg/JointTrajectory | ignition::msgs::JointTrajectory |
Expand All @@ -64,7 +66,7 @@ And the following for services:

| ROS type | Gazebo request | Gazebo response |
|--------------------------------------|:--------------------------:| --------------------- |
| ros_gz_interfaces/srv/ControlWorld | ignition.msgs.WorldControl | ignition.msgs.Boolean |
| ros_gz_interfaces/srv/ControlWorld | ignition.msgs.WorldControl | ignition.msgs.Boolean |

Run `ros2 run ros_gz_bridge parameter_bridge -h` for instructions.

Expand Down
28 changes: 28 additions & 0 deletions ros_gz_bridge/include/ros_gz_bridge/convert/ros_gz_interfaces.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#define ROS_GZ_BRIDGE__CONVERT__ROS_GZ_INTERFACES_HPP_

// Gazebo Msgs
#include <ignition/msgs/altimeter.pb.h>
#include <ignition/msgs/entity.pb.h>
#include <ignition/msgs/joint_wrench.pb.h>
#include <ignition/msgs/contact.pb.h>
Expand All @@ -25,12 +26,14 @@
#include <ignition/msgs/light.pb.h>
#include <ignition/msgs/param.pb.h>
#include <ignition/msgs/param_v.pb.h>
#include <ignition/msgs/sensor_noise.pb.h>
#include <ignition/msgs/stringmsg_v.pb.h>
#include <ignition/msgs/track_visual.pb.h>
#include <ignition/msgs/video_record.pb.h>
#include <ignition/msgs/world_control.pb.h>

// ROS 2 messages
#include <ros_gz_interfaces/msg/altimeter.hpp>
#include <ros_gz_interfaces/msg/entity.hpp>
#include <ros_gz_interfaces/msg/joint_wrench.hpp>
#include <ros_gz_interfaces/msg/contact.hpp>
Expand All @@ -39,6 +42,7 @@
#include <ros_gz_interfaces/msg/gui_camera.hpp>
#include <ros_gz_interfaces/msg/light.hpp>
#include <ros_gz_interfaces/msg/param_vec.hpp>
#include <ros_gz_interfaces/msg/sensor_noise.hpp>
#include <ros_gz_interfaces/msg/string_vec.hpp>
#include <ros_gz_interfaces/msg/track_visual.hpp>
#include <ros_gz_interfaces/msg/video_record.hpp>
Expand Down Expand Up @@ -69,6 +73,18 @@ convert_gz_to_ros(
const ignition::msgs::JointWrench & gz_msg,
ros_gz_interfaces::msg::JointWrench & ros_msg);

template<>
void
convert_ros_to_gz(
const ros_gz_interfaces::msg::Altimeter & ros_msg,
ignition::msgs::Altimeter & gz_msg);

template<>
void
convert_gz_to_ros(
const ignition::msgs::Altimeter & gz_msg,
ros_gz_interfaces::msg::Altimeter & ros_msg);

template<>
void
convert_ros_to_gz(
Expand Down Expand Up @@ -143,6 +159,18 @@ convert_gz_to_ros(
const ignition::msgs::Light & gz_msg,
ros_gz_interfaces::msg::Light & ros_msg);

template<>
void
convert_ros_to_gz(
const ros_gz_interfaces::msg::SensorNoise & ros_msg,
ignition::msgs::SensorNoise & gz_msg);

template<>
void
convert_gz_to_ros(
const ignition::msgs::SensorNoise & gz_msg,
ros_gz_interfaces::msg::SensorNoise & ros_msg);

template<>
void
convert_ros_to_gz(
Expand Down
2 changes: 1 addition & 1 deletion ros_gz_bridge/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>ros_gz_bridge</name>
<version>0.245.0</version>
<version>0.247.0</version>
<description>Bridge communication between ROS and Gazebo Transport</description>
<maintainer email="[email protected]">Louise Poubel</maintainer>

Expand Down
2 changes: 2 additions & 0 deletions ros_gz_bridge/ros_gz_bridge/mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
Mapping('ParameterValue', 'Any'),
],
'ros_gz_interfaces': [
Mapping('Altimeter', 'Altimeter'),
Mapping('Contact', 'Contact'),
Mapping('Contacts', 'Contacts'),
Mapping('Entity', 'Entity'),
Expand All @@ -62,6 +63,7 @@
Mapping('Light', 'Light'),
Mapping('ParamVec', 'Param'),
Mapping('ParamVec', 'Param_V'),
Mapping('SensorNoise', 'SensorNoise'),
Mapping('StringVec', 'StringMsg_V'),
Mapping('TrackVisual', 'TrackVisual'),
Mapping('VideoRecord', 'VideoRecord'),
Expand Down
73 changes: 73 additions & 0 deletions ros_gz_bridge/src/convert/ros_gz_interfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,30 @@ convert_gz_to_ros(
convert_gz_to_ros(gz_msg.body_2_wrench(), ros_msg.body_2_wrench);
}

template<>
void
convert_ros_to_gz(
const ros_gz_interfaces::msg::Altimeter & ros_msg,
ignition::msgs::Altimeter & gz_msg)
{
convert_ros_to_gz(ros_msg.header, (*gz_msg.mutable_header()));
gz_msg.set_vertical_position(ros_msg.vertical_position);
gz_msg.set_vertical_velocity(ros_msg.vertical_velocity);
gz_msg.set_vertical_reference(ros_msg.vertical_reference);
}

template<>
void
convert_gz_to_ros(
const ignition::msgs::Altimeter & gz_msg,
ros_gz_interfaces::msg::Altimeter & ros_msg)
{
convert_gz_to_ros(gz_msg.header(), ros_msg.header);
ros_msg.vertical_position = gz_msg.vertical_position();
ros_msg.vertical_velocity = gz_msg.vertical_velocity();
ros_msg.vertical_reference = gz_msg.vertical_reference();
}

template<>
void
convert_ros_to_gz(
Expand Down Expand Up @@ -356,6 +380,55 @@ convert_gz_to_ros(
ros_msg.intensity = gz_msg.intensity();
}

template<>
void
convert_ros_to_gz(
const ros_gz_interfaces::msg::SensorNoise & ros_msg,
ignition::msgs::SensorNoise & gz_msg)
{
convert_ros_to_gz(ros_msg.header, *gz_msg.mutable_header());
if (ros_msg.type == 0) {
gz_msg.set_type(ignition::msgs::SensorNoise_Type::SensorNoise_Type_NONE);
} else if (ros_msg.type == 2) {
gz_msg.set_type(ignition::msgs::SensorNoise_Type::SensorNoise_Type_GAUSSIAN);
} else if (ros_msg.type == 3) {
gz_msg.set_type(ignition::msgs::SensorNoise_Type::SensorNoise_Type_GAUSSIAN_QUANTIZED);
}

gz_msg.set_mean(ros_msg.mean);
gz_msg.set_stddev(ros_msg.stddev);
gz_msg.set_bias_mean(ros_msg.bias_mean);
gz_msg.set_bias_stddev(ros_msg.bias_stddev);
gz_msg.set_precision(ros_msg.precision);
gz_msg.set_dynamic_bias_stddev(ros_msg.dynamic_bias_stddev);
}

template<>
void
convert_gz_to_ros(
const ignition::msgs::SensorNoise & gz_msg,
ros_gz_interfaces::msg::SensorNoise & ros_msg)
{
convert_gz_to_ros(gz_msg.header(), ros_msg.header);

if (gz_msg.type() == ignition::msgs::SensorNoise_Type::SensorNoise_Type_NONE) {
ros_msg.type = 0;
} else if (gz_msg.type() == ignition::msgs::SensorNoise_Type::SensorNoise_Type_GAUSSIAN) {
ros_msg.type = 2;
} else if (gz_msg.type() == // NOLINT
ignition::msgs::SensorNoise_Type::SensorNoise_Type_GAUSSIAN_QUANTIZED) // NOLINT
{ // NOLINT
ros_msg.type = 3;
}

ros_msg.mean = gz_msg.mean();
ros_msg.stddev = gz_msg.stddev();
ros_msg.bias_mean = gz_msg.bias_mean();
ros_msg.bias_stddev = gz_msg.bias_stddev();
ros_msg.precision = gz_msg.precision();
ros_msg.dynamic_bias_stddev = gz_msg.dynamic_bias_stddev();
}

template<>
void
convert_ros_to_gz(
Expand Down
3 changes: 0 additions & 3 deletions ros_gz_bridge/src/parameter_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,5 @@ int main(int argc, char * argv[])
// ROS 2 spinner
rclcpp::spin(bridge_node);

// Wait for gz node shutdown
ignition::transport::waitForShutdown();

return 0;
}
3 changes: 0 additions & 3 deletions ros_gz_bridge/src/static_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,5 @@ int main(int argc, char * argv[])

rclcpp::spin(bridge_node);

// Wait for gz node shutdown
ignition::transport::waitForShutdown();

return 0;
}
48 changes: 48 additions & 0 deletions ros_gz_bridge/test/utils/gz_test_msg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,54 @@ void compareTestMsg(const std::shared_ptr<ignition::msgs::Vector3d> & _msg)
EXPECT_EQ(expected_msg.z(), _msg->z());
}

void createTestMsg(ignition::msgs::Altimeter & _msg)
{
createTestMsg(*_msg.mutable_header());
_msg.set_vertical_position(100);
_msg.set_vertical_velocity(200);
_msg.set_vertical_reference(300);
}

void compareTestMsg(const std::shared_ptr<ignition::msgs::Altimeter> & _msg)
{
ignition::msgs::Altimeter expected_msg;
createTestMsg(expected_msg);

EXPECT_EQ(expected_msg.vertical_position(), _msg->vertical_position());
EXPECT_EQ(expected_msg.vertical_velocity(), _msg->vertical_velocity());
EXPECT_EQ(expected_msg.vertical_reference(), _msg->vertical_reference());
compareTestMsg(std::make_shared<ignition::msgs::Header>(_msg->header()));
}

void createTestMsg(ignition::msgs::SensorNoise & _msg)
{
createTestMsg(*_msg.mutable_header());
_msg.set_type(ignition::msgs::SensorNoise_Type::SensorNoise_Type_GAUSSIAN_QUANTIZED);
_msg.set_mean(100);
_msg.set_stddev(200);
_msg.set_bias_mean(300);
_msg.set_bias_stddev(400);
_msg.set_precision(500);
_msg.set_dynamic_bias_stddev(600);
}

void compareTestMsg(const std::shared_ptr<ignition::msgs::SensorNoise> & _msg)
{
ignition::msgs::SensorNoise expected_msg;
createTestMsg(expected_msg);

EXPECT_EQ(
expected_msg.type(),
ignition::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());
EXPECT_EQ(expected_msg.bias_stddev(), _msg->bias_stddev());
EXPECT_EQ(expected_msg.precision(), _msg->precision());
EXPECT_EQ(expected_msg.dynamic_bias_stddev(), _msg->dynamic_bias_stddev());
compareTestMsg(std::make_shared<ignition::msgs::Header>(_msg->header()));
}

void createTestMsg(ignition::msgs::Param & _msg)
{
createTestMsg(*_msg.mutable_header());
Expand Down
Loading

0 comments on commit da1d318

Please sign in to comment.