Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Resolved Connect Unity with different ROS2 versions (galactic)

Discussion in 'Robotics' started by ActiveSim, Jan 31, 2022.

  1. ActiveSim

    ActiveSim

    Joined:
    May 10, 2019
    Posts:
    58
    Hi all,

    using the ROS2 connection I found an inconsistants in the ROS2 versions that can be used:
    So the questions is, how to choose the ROS2 version and get the ros_tcp_endpoint running (for the first step it would be enough for me to get it running with galactic)?
    Why does the Nav2 example run with galactic when the ros_tcp_endpoint doesn't (I tried)?
     
  2. LaurieUnity

    LaurieUnity

    Unity Technologies

    Joined:
    Oct 23, 2020
    Posts:
    77
    Hi, Ros TCP Endpoint definitely works with Galactic. What results are you getting when you try it?
     
  3. ActiveSim

    ActiveSim

    Joined:
    May 10, 2019
    Posts:
    58
    I get no connection between my native ROS2 system and the endpoint. E.g. ros2 topic list didn't show my published Unity topic, but replacing galactic with foxy it works instantly.
     
  4. antsa123

    antsa123

    Joined:
    May 10, 2021
    Posts:
    4
    Hi!

    Are you running the ROS-TCP-Endpoint in a Docker container? If so you should probably run the container with network mode host and make sure that the network interface definition and DDS domain are correctly set for the container. Otherwise the messages published by the endpoint are only published into the docker network and only other containers can access them.

    I use a docker-compose file to set the network mode to host and the environment variable CYCLONE_DDS_URI with the whole configuration XML. For some reason I can't paste the whole compose entry as the forum doesn't allow me to save the post after pasting the compose file.
     
    Last edited: Feb 3, 2022
    ActiveSim likes this.
  5. ActiveSim

    ActiveSim

    Joined:
    May 10, 2019
    Posts:
    58
    Thanks @antsa123. Yes I run it in a docker container. For me it was enough to set the network mode to host so I just needed to add that in the docker run line:
    docker run --network="host" -it --rm -p 10000:10000 foxy /bin/bash
     
    antsa123 likes this.