Constant
Inputs: i1
Outputs: o1
Emits the same value regardless the time field of the message received on i1
.
The Constant
operator does not hold a message buffer on i1
, so it emits a message with a constant value field through o1
right after it receives a message on i1
.
.
Parameters
id: The id of the operator
value: The constant to emit when required.
Usage
- TypeScript
- Python
- C++
- YAML
- Json
import { Program, Constant } from "@rtbot-dev/rtbot";
const id = "id";
const value = 3.14;
const program = new Program();
program.addOperator(new Constant(id, value));
import rtbot as rb
id = "id";
value = 3.14;
program = rb.Program()
program.addOperator(rb.Constant(id, value))
#include "rtbot/Constant.h"
auto id = "id";
auto value = 3.14;
auto op = Constant<std::uint64_t, double>(id, value)
# minimal RtBot program
operators:
- type: Constant
id: "id"
value: 3.14
{
"operators": [
{ "type": "Constant", "id": "id", "value": 3.14 }
]
}