Add
Inputs: i1
Outputs: o1
Adds a specified constant (value) to each message value it receives on i1
regardless the time 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
value: The constant to add to the incoming messages.
Usage
- TypeScript
- Python
- C++
- YAML
- Json
import { Program, Add } from "@rtbot-dev/rtbot";
const id = "id";
const value = 1;
const program = new Program();
program.addOperator(new Add(id, value));
import rtbot as rb
id = "id";
value = 1;
program = rb.Program()
program.addOperator(rb.Add(id, value))
#include "rtbot/Add.h"
auto id = "id";
auto value = 1;
auto op = Add<std::uint64_t, double>(id, value)
# minimal RtBot program
operators:
- type: Add
id: "id"
value: 1
{
"operators": [
{ "type": "Add", "id": "id", "value": 1 }
]
}