How unity-technologies/ros-tcp-connector works
Project type and purpose
• This is a Unity-based open-source robotics integration toolkit, delivered as two UPM packages:
• ROS TCP Connector – runtime code and editor tooling for sending/receiving ROS messages over a TCP link
• Visualizations Package – runtime scripts and prefabs for visualizing ROS messages in the Unity scene
• There is also a sample Unity project (TestRosTcpConnector) that demonstrates using the connector in a Unity scene.
File structure
• Top-level directories and files:
• Root contains project-wide configuration (.editorconfig, .gitignore, workflows), documentation (README.md, MessageGeneration.md, ROSGeometry.md), CONTRIBUTING, LICENSE.
• TestRosTcpConnector – a standalone Unity project with Assets, Packages, ProjectSettings. It hosts a sample scene and references the two packages.
• com.unity.robotics.ros-tcp-connector – Editor, Runtime, Tests subfolders implementing the ROS connection, message generation, message registry, TCP connector, ROSGeometry extensions.
• com.unity.robotics.visualizations – Editor, Runtime, Resources, ExampleVisualizers, Drawing3d, DefaultVisualizers providing settings editors, visualizer scripts, shaders, materials, prefabs.
• Pattern: clear separation between Editor-only code (message generation tools, settings editors) and Runtime code (message serialization, TCP connection, visualizers).
• Presence of package.json files means Unity Package Manager is used. Tests folders signal unit and integration tests.
README for additional insights
• Key features:
• ROSConnection component (entry point at runtime)
• Message Generation tool (generates C# classes from ROS msg/srv definitions)
• Visualizations suite (default API for rendering messages)
• ROSGeometry extensions (coordinate conversions)
• Supported targets: ROS1 (melodic, noetic), ROS2 (foxy, galactic), Unity 2020.2+