Unity project for the Tardigrade pool scene. This is the ROS-TCP-Connector
based simulator backend described in
tardigrade_ws/docs/unity_simulation_plan.md —
see that doc for the full architecture. This README covers what actually
lives in this project and how to change robot movement/paths.
- Install the same Editor version as
ProjectSettings/ProjectVersion.txt. - Open the project once so packages resolve (
com.unity.robotics.ros-tcp-connectorandcom.unity.robotics.visualizationsare pulled from GitHub viaPackages/manifest.json). - Robotics → Generate ROS Messages, pointed at
tardigrade_ws/src/tardigrade_interfaces, generates the C# types underAssets/RosMessages/TardigradeInterfaces/. Re-run this whenever a.msgor.srvfile changes intardigrade_interfaces. - Robotics → ROS Settings → Protocol
ROS2, IP127.0.0.1, Port10000(matchesros_tcp_endpoint's default in the ROS workspace).
Start ros_tcp_endpoint in the tardigrade_ws Docker container:
cd /ws && source install/setup.bash
ros2 run ros_tcp_endpoint default_server_endpoint --ros-args \
-p ROS_IP:=0.0.0.0 -p ROS_TCP_PORT:=10000Press Play in the Unity Editor, then drive the robot from ROS — see
tardigrade_ws/docs/local_sim_backend.md
for path_follower and mission usage. Nothing on the ROS side needs to know
whether it's talking to Unity or the fake backend; the topic contract is
identical.
SampleScene uses a hybrid authored/runtime layout. Physical arrangement and
appearance are visible in Edit Mode; scripts configure changing scenario state
when Play Mode begins.
SampleScene
├── SimulationEnvironment
│ ├── AcceptancePoolCollisions (PoolEnvironment prefab)
│ ├── GateAcceptance (Gate prefab)
│ └── UnderwaterEffects (water, pool lights, particulate)
└── TardigradeRoot
├── Rigidbody + collider
├── RosRobotBridge + AuvPhysicsPlant
├── UnderwaterEnvironment + StereoCameraPublisher
├── Sensors (inspectable sensor mounting frames)
└── tardigrade (visual FBX model)
The imported lowercase tardigrade is presentation only. TardigradeRoot
owns the one Rigidbody and the vehicle transform, preventing individual FBX
mesh pieces from becoming separate physical bodies.
The pool, gate, water, lighting, particle system, robot collider, and sensor
mounts are saved in the scene or under Assets/Prefabs/Simulation. Runtime
scripts still own:
- scenario selection and reset pose,
- water current and visual profile,
- sensor noise, delay, drift, and dropout,
- thruster state and failures,
- ROS transport and simulation clock,
- temporary left/right camera renderers.
RosRobotBridge is the composition and ROS lifecycle component.
AuvPhysicsPlant applies buoyancy, six-axis damping, and distributed thruster
forces to the serialized Rigidbody at 100 Hz. Canonical physical values come
from Assets/StreamingAssets/tardigrade_vehicle.json, rather than being copied
into scene objects.
The Scene view is the free editor camera. The Game view is the output of the vehicle-mounted camera, so the two views are expected to look different.
To rebuild the authored assets after changing their procedural templates, use
Tardigrade → Rebuild Authored Simulation Scene. This recreates the three
simulation prefabs and their materials, reconnects SampleScene, and is safe to
run repeatedly.
Mission paths and control remain on the ROS side. Unity consumes normalized per-thruster commands and publishes raw simulated sensors and simulation-only ground truth.
Headless-automation scripts, useful for CI or re-running setup without
opening the Editor UI (Unity.exe -batchmode -nographics -quit -projectPath <proj> -executeMethod <Class>.<Method>):
CliMessageGen.GenerateTardigradeInterfaces: same as Robotics → Generate ROS Messages, scripted againsttardigrade_ws/src/tardigrade_interfaces.CliAttachBridge.ListSceneObjects/CliAttachBridge.AttachToRobot: lists the scene hierarchy, or finds the GameObject namedtardigradeand attachesRosRobotBridgeto it, saving the scene. Useful after rebuilding the scene from a new robot model import.SimulationSceneAuthoring.Run: rebuilds the simulator prefabs, materials, sensor mounts, and serialized scene references.SimulationBatchValidation.Run: validates configuration and coordinate/frame assumptions.SimulationPlayModeValidation.Run: runs the acceptance-scene smoke test.