[ROS2] Problems using rmw_connect_cpp in ROS2 eloquent

asked 2020-03-06 03:10:30 -0500

Andreas Ziegler gravatar image

updated 2020-03-06 05:26:31 -0500

I want to run a simple ROS2 subscriber example with rti connect DDS as rmw on Ubuntu Bionic.

This is my code:

#include <memory>

#include "rclcpp/rclcpp.hpp"
#include "geometry_msgs/msg/transform_stamped.hpp"
using std::placeholders::_1;

class MinimalSubscriber : public rclcpp::Node
{
  public:
    MinimalSubscriber()
    : Node("transform_subscriber")
    {
      subscription_ = this->create_subscription<geometry_msgs::msg::TransformStamped>(
      "rcv_transform", 10, std::bind(&MinimalSubscriber::topic_callback, this, _1));
    }

  private:
    void topic_callback(const geometry_msgs::msg::TransformStamped::SharedPtr msg) const
    {
      RCLCPP_INFO(this->get_logger(), "I received: \n transformation: x: %f", msg->transform.translation.x);
    }
    rclcpp::Subscription<geometry_msgs::msg::TransformStamped>::SharedPtr subscription_;
};

int main(int argc, char * argv[])
{
  rclcpp::init(argc, argv);
  rclcpp::spin(std::make_shared<MinimalSubscriber>());
  rclcpp::shutdown();
  return 0;
}

when I run it with the following commands

source /opt/ros/eloquent/setup.bash
export RMW_IMPLEMENTATION=rmw_connext_cpp
export RTI_LICENSE_FILE=/opt/rti_connext_dds-5.3.1/rti_license.dat
source /opt/rti_connext_dds-5.3.1/resource/scripts/rtisetenv_x64Linux3gcc5.4.0.bash
source /opt/rti_connext_dds-5.3.1/resource/scripts/rtisetenv_x64Linux3gcc5.4.0.bash
ros2 run transform-subscriber transform-subscriber

I get the following output:

COMMENDBeWriterService_assertRemoteReader:Discovered remote reader with GUID 0X10144E8,0X96E8534E,0X63411DE6,0X200C7 using a non-addressable locator.
This can occur if the transport is not installed and/or enabled in the local participant.
See https://community.rti.com/kb/what-does-cant-reach-locator-error-message-mean for additional info.
can't reach: locator: shmem://E065:0396:E192:051E:2899:D2FA:0000:0000:7410

How can I fix this?

edit retag flag offensive close merge delete