Skip to main content

TimeShift

Inputs: i1
Outputs: o1

Adds a specified constant (dt * times) to each message time it receives on i1 regardless the value field of the message.

The Add operator does not hold a message buffer on i1, so it emits a modified version of the message through o1 right after it receives a message on i1.

y(tn)=x(tn)+n×Δty(t_n)= x(t_n) + n \times \Delta t

Parameters

id: The id of the operator

dt: The constant that defines the time grid. Default value: 1. Minimum value: 1.

times: The multiplier to apppy. Default value: 1.

Usage

import { Program, TimeShift } from "@rtbot-dev/rtbot";

const id = "id";
const dt = -1;
const times = 2;

const program = new Program();
program.addOperator(new TimeShift(id, dt, times));