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. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Question ROS2 Topic not present while trying to run RosPublisherExample

Discussion in 'Robotics' started by Horakles, Nov 21, 2022.

  1. Horakles


    Nov 21, 2022
    Hi all, i have a problem.

    I have connected ROS2 FOXY and UNITY, and i am trying to run RosPublisherExample, but when i enter ros2 topic list, there is only /parameter_events and /rosout, there is no pos_rot topic.

    i tried adding --network="host" to the command, and i also changed name of the topic, but it didnt work.

    My OS: Windows 10, but i am running ROS2 and have my Colcon Workspace in WSL and with Windows Terminal
    Unity Version: 2020.3.30f1
    ROS2: FOXY
    ROS2 Domain ID: 1
    Also, i am not using Docker

    Here are screenshots of the issue:

    Commands running Colcon WS

    Commands trying to open correct topic


    What is in ros2_ws/src

    Please can somebody help me to fix this issue, or give me advice what else i should try?

    Thank you very much

    Attached Files:

  2. LaurieUnity


    Unity Technologies

    Oct 23, 2020
    Weird. The log shows your endpoint has tried to register as a publisher and subscriber (and it thinks it has succeeded, and indeed ros is warning that you had already registered) - I can't imagine how you'd get that message without the publisher also showing up in the topic list.

    All I can think is that your "ros2 topic list" command is somehow talking to a different instance of ros2? (If you run ros2 topic list without having started ros_tcp_endpoint, do you get a different output?)

    PS: 192.168 is the prefix for a local IP address, so there's no reason to black them out. (Each local area network has its own version of those addresses. If someone tried to connect to it, it would be like opening the door with your apartment number, except they're in the wrong building.)
  3. Horakles


    Nov 21, 2022
    Thank you, i just ran ros2 topic list without running endpoint, and it shows the same thing

    also thank you for telling about that IP
  4. Horakles


    Nov 21, 2022
    Hi, so a little update, i uninstalled Ubuntu and installed it agin with wsl install Ubuntu-20.04 in CMD.
    i also changed wsl version to 2. this is what is happening now. I can finally see the topic, but when i try to run it, it shows that it cannot find unity_robotics_demo_msgs

    also, path to unity_robotics_demo_msgs has changed into

    Any advice what to do now?