Unity-Technologies / Robotics-Nav2-SLAM-Example

An example project which contains the Unity components necessary to complete Navigation2's SLAM tutorial with a Turtlebot3, using a custom Unity environment in place of Gazebo.
Apache License 2.0
327 stars 120 forks source link

sensor_msgs/image doesn't open in build #64

Open Strubu opened 1 year ago

Strubu commented 1 year ago

Hi,

I am publishing an image via the ros tcp endpoint. In the Unity editor the picture shows up with no problem. But when I build the project, the image windows does not show up (not even a "waiting for message"). The connection arrows also don't react to the publication of the image (when set at an interval of e.g. 2 sec).

Anybody got some idea how to debug this, since this problem only shows up in the build version (tested Linux AND Windows), not in the editor (other topic types are sent/received fine)

Strubu commented 1 year ago

Fixed it. You need to copy the ImageMsg.shader file to Resources folder since line 52 in ImageDefaultVisualizer asks for

"m_CheapTextureMaterial = new Material(Shader.Find("Unlit/ImageMsg"));"

and that only work in Editor mode.

Which brings up the question: Is this all just supposed to run in editor mode? Because no one ever checked if the image sensor message actually works during runtime...