This package provides a network bridge which enables the exchange of messages between ROS 1 and Ignition Transport.
The bridge is currently implemented in C++. At this point there's no support for service calls.Its support is limited to only the following message types:
ROS 1 type | Ignition Transport type |
---|---|
std_msgs/Float32 | ignition::msgs::Float |
std_msgs/Header | ignition::msgs::Header |
std_msgs/String | ignition::msgs::StringMsg |
geometry_msgs/Quaternion | ignition::msgs::Quaternion |
geometry_msgs/Vector3 | ignition::msgs::Vector3d |
geometry_msgs/Point | ignition::msgs::Vector3d |
geometry_msgs/Pose | ignition::msgs::Pose |
geometry_msgs/PoseStamped | ignition::msgs::Pose |
geometry_msgs/Transform | ignition::msgs::Pose |
geometry_msgs/TransformStamped | ignition::msgs::Pose |
mav_msgs/Actuators | ignition::msgs::Actuators |
rosgraph_msgs/Clock | ignition::msgs::Clock |
sensor_msgs/Imu | ignition::msgs::IMU |
sensor_msgs/Image | ignition::msgs::Image |
sensor_msgs/JointState | ignition::msgs::Model |
sensor_msgs/LaserScan | ignition::msgs::LaserScan |
sensor_msgs/MagneticField | ignition::msgs::Magnetometer |
Run parameter_bridge -h
for instructions.
For all examples you need to source the environment of the install space where
the bridge was built or unpacked to.
Additionally you will need to either source the ROS 1 environment or at least
set the ROS_MASTER_URI
and run a roscore
.
The following ROS 1 packages are required to build and use the bridge:
catkin
geometry_msgs
mav_msgs
roscpp
roslaunch
(forroscore
executable)rosmsg
sensor_msgs
std_msgs
To run the following examples you will also need these ROS 1 packages:
rosbash
(forrosrun
executable)roscpp_tutorials
rostopic
rqt_image_view
The following Ignition dependencies are also needed:
libignition-msgs4-dev
libignition-transport7-dev
Before continuing you should have the prerequisites for building the bridge from source installed.
Here are the steps (for Linux and OSX; you probably don't have ROS 1 installed on Windows).
- Create a catkin workspace:
# Setup the workspace
mkdir -p ~/bridge_ws/src
cd ~/bridge_ws/src
# Download needed software
git clone https://github.com/osrf/ros1_ign_bridge.git
- Build the workspace:
# Source ROS distro's setup.bash
source /opt/ros/melodic/setup.bash
# Build and install into workspace
cd ~/bridge_ws/
catkin_make install
First we start a ROS 1 roscore
:
# Shell A:
. /opt/ros/melodic/setup.bash
roscore
Then we start the parameter bridge which will watch the specified topics.
# Shell B:
. ~/bridge_ws/install/setup.bash
rosrun ros1_ign_bridge parameter_bridge /chatter@std_msgs/[email protected]
Now we start the ROS 1 listener.
# Shell C:
. /opt/ros/melodic/setup.bash
rostopic echo /chatter
Now we start the Ignition Transport talker.
# Shell D:
ign topic pub -t /chatter -m ignition.msgs.StringMsg -p 'data:"Hello"'
First we start a ROS 1 roscore
:
# Shell A:
. /opt/ros/melodic/setup.bash
roscore
Then we start the parameter bridge which will watch the specified topics.
# Shell B:
. ~/bridge_ws/install/setup.bash
rosrun ros1_ign_bridge parameter_bridge /chatter@std_msgs/[email protected]
Now we start the Ignition Transport listener.
# Shell C:
ign topic -e -t /chatter
Now we start the ROS 1 talker.
# Shell D:
. /opt/ros/melodic/setup.bash
rostopic pub /chatter std_msgs/String "data: 'Hi'" --once
In this example, we're going to generate Ignition Transport images using Gazebo,
that will be converted into ROS 1 images, and visualized with rqt_viewer
.
First we start a ROS 1 roscore
:
# Shell A:
. /opt/ros/melodic/setup.bash
roscore
Then we start Gazebo.
# Shell B:
gazebo
Once Gazebo is running, click on the Insert
tab, and then, insert a Camera
object into the scene. Now, let's see the topic where the camera images are
published.
# Shell C:
ign topic -l | grep image
/default/camera/link/camera/image
Then we start the parameter bridge with the previous topic.
# Shell D:
. ~/bridge_ws/install/setup.bash
rosrun ros1_ign_bridge parameter_bridge /default/camera/link/camera/image@sensor_msgs/[email protected]
Now we start the ROS 1 GUI:
# Shell E:
. /opt/ros/melodic/setup.bash
rqt_image_view /default/camera/link/camera/image
You should see the current images in rqt_image_view
which are coming from
Gazebo (published as Ignition Msgs over Ignition Transport).
The screenshot shows all the shell windows and their expected content (it was taken using ROS Kinetic):