Input
Inputs: i1
...iN
defined by numPorts
Outputs: o1
...oN
defined by numPorts
The Input
operator is used to ensure that only messages with increasing timestamp
are sent to the rest of the program.
In certain scenarios data received from the outside world may arrive not time-ordered,
or messages with same timestamp might be received consecutively. In such scenarios the Input
operator
will discard invalid messages to ensure the proper functioning of the operator pipeline
behind it. The Input
operator does not hold a message buffer on any of the ports defined,
so it forwards the received message on the port ik
through the port ok
right after.
The received messages are not buffered therefore it has a little footprint on the calculation process.
Parameters
id: The id of the operator
numPorts: The number of possible input ports. Useful if more than one input is taken. Default value: 1. Minimum value: 1.
Usage
- TypeScript
- Python
- C++
- YAML
- Json
import { Program, Input } from "@rtbot-dev/rtbot";
const id = "id";
const numPorts = 20;
const program = new Program();
program.addOperator(new Input(id, numPorts));
import rtbot as rb
id = "id";
numPorts = 20;
program = rb.Program()
program.addOperator(rb.Input(id, numPorts))
#include "rtbot/Input.h"
auto id = "id";
auto numPorts = 20;
auto op = Input<std::uint64_t, double>(id, numPorts)
# minimal RtBot program
operators:
- type: Input
id: "id"
numPorts: 20
{
"operators": [
{ "type": "Input", "id": "id", "numPorts": 20 }
]
}