Skip to content

tempo-sim/Tempo

Repository files navigation

Tempo

tempo_sizzle.mov

Tempo is a collection of simulation-focused plugins for Unreal Engine. Tempo makes the power of Unreal accessible to simulation and robotics developers, including plugins for scripting, sensor simulation, agent behaviors, and more.

Tempo is the foundation on which you can build a simulator for your unique application. Not sure where to start? Want some guidance from the authors? Find us on Discord

Compatibility

  • Linux (Ubuntu 22.04 and 24.04), MacOS (13.0 "Ventura" or newer, Apple silicon only), Windows 10 and 11
  • Unreal Engine 5.6 and 5.7

Prerequisites

  • Linux:
  • Mac:
    • Unreal: Install using Epic Games Launcher
    • jq: brew install jq
  • Windows:
    • Unreal: Install using Epic Games Launcher
    • Git Bash (Run all Tempo *.sh scripts from Git Bash)
    • jq: (Use Administrator Git Bash) curl -L -o /usr/bin/jq.exe https://github.com/jqlang/jq/releases/latest/download/jq-win64.exe

Environment Variables

  • UNREAL_ENGINE_PATH: On Linux only must be set to your Unreal Engine installation directory (the folder containing Engine). On Mac and Windows, Tempo will attempt to automatically find Unreal via your uproject file, but you can still set this to override it.

Getting Started

Follow along the steps below with this video. Sound on!

tempo_first_steps.mp4

TempoSample

The TempoSample project is provided as a reference. If you are starting a new project, consider creating your repo using TempoSample as a template, and renaming the project with Scripts/Rename.sh.

Clone Tempo

To add Tempo to an existing project (if you are not starting with TempoSample), clone tempo to your project's Plugins directory:

git submodule add https://github.com/tempo-sim/Tempo.git
git submodule update --init --recursive

One-Time Setup

Run the Setup.sh script (from the Tempo root) once. This script will:

  • Modify your project's *.Target.cs files to use Tempo's custom toolchain, which is necessary for linking certain third party dependencies properly
  • Install the Tempo Unreal Engine mods, making some changes to your installed Engine in-place
  • Download third party dependencies
  • Add git hooks to keep engine mods and third party dependencies up to date automatically as you check out different Tempo commits

Build and Run

Use the included Scripts/Build.sh and Scripts/Run.sh to build your project and open it in Unreal Editor.

Hello World

Note

You don't have to install any Python package or dependences to use Tempo. The build step automatically generated a tempo Python package and virtual environment, which will be used below.

  1. With your Tempo project open in Unreal Editor, from the root of your project, activate the Tempo virtual environment (source ./TempoEnv/bin/activate on Linux & Mac, or source ./TempoEnv/Scripts/activate on Windows)
  2. Start the Python interpreter (python on Linux & Mac, or winpty python on Windows) and use the Tempo API to start the simulation:
import tempo.tempo_core_editor as tce
tce.play_in_editor() # Simulation should begin
  1. Use TempoWorld to add an Actor to your scene:
import tempo.tempo_world as tw
tw.spawn_actor(type="BP_SensorRig") # An Actor with a tripod mesh should appear. It has a TempoCamera on top (although it may not be visible).
  1. From another terminal, run the included SensorPlayground example client: python ./ExampleClients/SensorPlayground.py. Use it to start streaming color images from the TempoCamera
  2. While streaming images, from the Python interpreter again, use TempoWorld to change one of the Camera's properties:
tw.set_float_property(actor="BP_SensorRig", component="TempoCamera", property="FOVAngle", value=60.0) # The field of view of your streaming images should decrease
  1. Lastly, use TempoTime to pause, resume, and step the simulation:
import tempo.tempo_time as tt
import TempoTime.Time_pb2 as Time
tt.pause() # Time should pause
tt.play() # Time should resume
tt.set_time_mode(Time.FIXED_STEP) # Time mode should switch to Fixed Step, simulation should run faster than real-time
tt.step() # Time should advance to the nearest whole number of fixed time steps (0.1 seconds by default)
tt.step() # Time should advance one step. You should get one new camera image every step.

Congratulations, you are officially up and running! Continue experimenting with Tempo by creating new scenes, streaming sensor data, and varying the many properties of your simulation at runtime.

Package

Use the included Scripts/Package.sh to package your project into a standalone binary, which you can then run from the Packaged folder.

Continuous Integration

If you would like to set up a GitHub actions pipeline to build, package, run, and/or release your Tempo project, check out the build_and_package reusable workflow in .github/workflows. TempoSample's tempo_sample_build_and_package workflow is a good reference.

Issues

Something not working as expected? Are we missing a key feature you need? Feel free to send us an issue.

Giving Back

Want to contribute to Tempo? We'll be happy to review your PR.

Going Deeper

You can learn about the individual tempo plugins in their respective READMEs:
TempoCore
TempoSensors
TempoAgents
TempoGeographic
TempoMovement
TempoWorld

And, if you are using ROS:
TempoROS
TempoROSBridge