ros2-for-unity icon indicating copy to clipboard operation
ros2-for-unity copied to clipboard

Release 1.2.0 did not work on my PC

Open samiamlabs opened this issue 2 years ago • 6 comments

Describe the bug 1.2.0 does not seem to work for me on Linux 22.04 and Unity 2021.3.2 (LTS). It looks like it was an overlay release so I installed humble using apt-get on my computer and started the editor from a terminal where I already sourced ROS2 humble.

To Reproduce Steps to reproduce the behavior:

  1. Start with a computer with Ubuntu 22.04
  2. Make a fresh project in Unity 2021.3.2
  3. Download Ros2ForUnity_humble_ubuntu2204.zip
  4. Open a terminal and run source /opt/ros/humble/setup.bash
  5. Open the Unity editor in the same terminal by writing, for example, Unity/Hub/Editor/2021.3.20f1/Editor
  6. Add a ROS2 Unity Component script to an emtpy GameObject.

Expected behavior No errors

Screenshots image

Desktop (please complete the following information):

  • OS: Ubuntu22.04, Windows 10
  • ros2 distro humble
  • ros2-for-unity version 1.2.0
  • ros2cs version ?
  • ros2 dds middleware fastdds
  • ros2 environment setup single pc

samiamlabs avatar Mar 08 '23 14:03 samiamlabs

Can you verify that the ROS_DISTRO is set to humble and the /opt/ros/humble/lib is in LD_LIBRARY_PATH after sourcing the ROS 2?

env | grep ROS_DISTRO
env | grep LD_LIBRARY_PATH

pijaro avatar Mar 08 '23 14:03 pijaro

sam@sam-blade:~$ env | grep ROS_DISTRO
ROS_DISTRO=humble

sam@sam-blade:~$ env | grep LD_LIBRARY_PATH
LD_LIBRARY_PATH=/opt/ros/humble/opt/rviz_ogre_vendor/lib:/opt/ros/humble/lib/x86_64-linux-gnu:/opt/ros/humble/lib

samiamlabs avatar Mar 08 '23 15:03 samiamlabs

How did you import the .zip package to unity? I tried to renaming it .unitypackage but got an error for couldn't decompress. I tried decompressing the zip and drag the two folders into an empty project still doesn't seem to work.

Edit: Actually nvm I figured it out but I am also have the same problem as @samiamlabs with ros2 humble

zp-yang avatar Mar 14 '23 17:03 zp-yang

As a quick solution, you might look for the check that outputs this message and disable the check. If the check is invalid and not a symptom of some mismatch, this should be enough. We will be looking into it next week.

adamdbrw avatar Mar 17 '23 16:03 adamdbrw

As @adamdbrw mentioned, try to check the versions which are detected by Ros2ForUnity by adding debug log to Ros2ForUnity/Scripts/ROS2ForUnity.cs somewhere in the if statement in line 180:

Debug.Log("Sourced: " + ros2SourcedCodename + ". From metadata: " + ros2FromRos2csMetadata);

Logged ROS 2 versions should be the same and not empty. If it is not the case, then there might be an issue with path resolution.

Can you also make sure that Ros2ForUnity folder lives inside project Assets?:

Assets/
└── Ros2ForUnity
    ├── Plugins
    │   └── Linux
    │       └── x86_64
    └── Scripts
        └── Time

pijaro avatar Mar 19 '23 21:03 pijaro

Same happened with me then I tried running the Unity from terminal as shown below and it worked.

https://github.com/RobotecAI/ros2-for-unity/issues/32#issuecomment-1023981776

rahulswa08 avatar May 20 '23 18:05 rahulswa08