Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  3. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    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:
    59
    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:
    59
    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:
    59
    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.