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
.
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
- TypeScript
- Python
- C++
- YAML
- Json
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));
import rtbot as rb
id = "id";
dt = -1;
times = 2;
program = rb.Program()
program.addOperator(rb.TimeShift(id, dt, times))
#include "rtbot/TimeShift.h"
auto id = "id";
auto dt = -1;
auto times = 2;
auto op = TimeShift<std::uint64_t, double>(id, dt, times)
# minimal RtBot program
operators:
- type: TimeShift
id: "id"
dt: -1
times: 2
{
"operators": [
{ "type": "TimeShift", "id": "id", "dt": -1, "times": 2 }
]
}