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

Question ROS2 Topic not present while trying to run RosPublisherExample

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

  1. Horakles

    Horakles

    Joined:
    Nov 21, 2022
    Posts:
    4
    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
    upload_2022-11-21_20-51-39.png

    Commands trying to open correct topic
    upload_2022-11-21_20-52-40.png

    Unity
    upload_2022-11-21_20-53-51.png

    What is in ros2_ws/src
    upload_2022-11-21_20-54-27.png

    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

    LaurieUnity

    Unity Technologies

    Joined:
    Oct 23, 2020
    Posts:
    77
    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

    Horakles

    Joined:
    Nov 21, 2022
    Posts:
    4
    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

    Horakles

    Joined:
    Nov 21, 2022
    Posts:
    4
    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
    //wsl$/Ubuntu-20.04/home/juraj/ros2_ws/src/unity_robotics_demo_msgs

    Any advice what to do now?

    upload_2022-11-24_1-43-2.png

    upload_2022-11-24_1-43-16.png