Unity-based excavator simulation with ROS 2 integration. This repository contains the Unity project, ROS 2 TCP endpoint workspace, excavator configuration, and sensor publishing setup for the TERA excavation autonomy simulation environment.
- Project page: droneslab.github.io/tera
- Demo video: EARTH | Simulation
Ensure you have the following software installed:
- Unity
- ROS Humble
- Algoryx AGX Dynamics for Unity
colconand the standard ROS 2 build tools
No shared Unity login is required for normal use. The project should import from a fresh clone using the packages declared in Unity/Excavator/Packages/manifest.json.
Terrain deformation and any entities/components that rely on deformable AGX behavior require a valid AGX license to be loaded. Without a valid AGX license, deformation-related scenes, terrain, and deformable entities should be expected to fail or behave incorrectly.
Do not commit AGX license files, Unity account credentials, activation IDs/passwords, tokens, or other local secrets. AGX licenses are expected to be installed or activated per machine through the AGX Unity license tools.
Unity/Excavator/: Unity project.sim_ws/: ROS 2 workspace containingROS-TCP-Endpoint,deltacan, and helper nodes.excavator_config.yaml: Runtime excavator and sensor configuration consumed by the Unity scene.excavator_config_template.yaml: Larger sensor configuration example.CAD/andExamples/: Supporting assets and examples.
Clone the repository:
git clone https://github.com/droneslab/tera-simulation.git
cd tera-simulationOpen the Unity project:
- Open Unity Hub.
- Add
Unity/Excavator. - Let Unity restore packages from
Packages/manifest.json. - Open the scene for your workflow:
Assets/Scenes/SampleScene.unityfor the non-YAML deformation analysis scene.Assets/Scenes/YAML_Scene.unityfor YAML-configured sensor testing.
- Confirm the AGX license is active from
AGXUnity -> License -> License Manager.
Build the ROS 2 workspace:
cd sim_ws
source /opt/ros/humble/setup.bash
colcon build
source install/setup.bashStart the ROS TCP endpoint before pressing Play in Unity:
ros2 run ros_tcp_endpoint default_server_endpointFor custom Unity ROS settings:
ros2 run ros_tcp_endpoint default_server_endpoint --ros-args -p ROS_IP:=<your_ip_address> -p ROS_TCP_PORT:=<your_port>- Start the ROS TCP endpoint when using ROS-connected workflows.
- Press Play in the selected scene.
- Inspect ROS topics:
ros2 topic listYAML_Scene.unity reads excavator_config.yaml and is the primary scene for sensor testing. The default config spawns two excavators. excavator1 includes IMU and camera sensors; both excavators publish excavator state topics such as odometry, ground truth, and effector pose.
SampleScene.unity is the non-YAML scene for deformation analysis. Deformation behavior depends on AGX Dynamics and requires a valid AGX license.
Camera sensors are configured in excavator_config.yaml. For excavator1, the current camera base topic is /camera, so ROS 2 topics are namespaced under the excavator:
/excavator1/camera/color/image/compressed
/excavator1/camera/color/camera_info
/excavator1/camera/depth/image/compressed
/excavator1/camera/depth/camera_info
/excavator1/camera/depth/points
View the RGB stream:
ros2 run rqt_image_view rqt_image_viewSelect:
/excavator1/camera/color/image/compressed
RViz Camera displays require both the image topic and matching camera_info. If RViz drops messages because the camera frame is missing, publish a temporary transform:
ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 odom excavator1/RGB_CAMERA_frameThen set RViz Fixed Frame to odom.
In Unity Play mode, spawned sensors are named with their excavator prefix, for example excavator1_RGB_CAMERA. Enable Scene view Gizmos and select the object to see the camera marker and frustum.
Sensors are spawned by Unity/Excavator/Assets/Scripts/Excavator_Creator.cs from excavator_config.yaml. Each excavator entry can define a sensors list with:
id: sensor instance name.type: one of the supported prefab types, such asIMU,GPS,LIDAR,RGB_CAMERA, orRGBD_CAMERA.topic: base topic. The spawner prefixes it with the excavator id.location: attachment target such asCHASIS,BOOM,ARM, orBUCKET.offsetandrotation: local pose relative to the attachment target.
After changing excavator_config.yaml, restart Unity Play mode so the scene respawns sensors.
If you use this simulator in academic work, cite:
@INPROCEEDINGS{10979147,
author={Aluckal, Christo and Kumar Lal, Roopesh Vinodh and Courtney, Sean and Turkar, Yash and Dighe, Yashom and Kim, Youngjin and Gemerek, Jake and Dantu, Karthik},
booktitle={2025 IEEE International Conference on Simulation, Modeling, and Programming for Autonomous Robots (SIMPAR)},
title={TERA: A Simulation Environment for Terrain Excavation Robot Autonomy},
year={2025},
volume={},
number={},
pages={1-6},
keywords={Deformation;Scalability;Programming;Excavation;Real-time systems;Extensibility;Complexity theory;Time-varying systems;Autonomous robots;Excavation;Simulation;Autonomy},
doi={10.1109/SIMPAR62925.2025.10979147}
}- If Unity cannot connect to ROS 2, confirm
ros_tcp_endpointis running and Unity Robotics ROS settings match the endpoint IP and port. - If camera topics appear in ROS 2 but RViz shows a blank/off-white view, first verify the image in
rqt_image_view; then check RVizCameraInfoand TF frame settings. - If Unity does not show AGX, Robotics, or UnitySensors menus after import, let package import finish and re-open the project.
- If AGX reports a missing license, activate or import a license locally through
AGXUnity -> License -> License Manager; do not add license files to the repository. - If deformation analysis or deformable terrain/entities do not work, first confirm that a valid AGX license is loaded.