The repository's component model is based on Component and TimerComponent from the cyber runtime.
A component typically:
- declares readers or a timer interval
- implements
Init() - implements
Proc(...)orProc() - registers itself via
CYBER_REGISTER_COMPONENT
The canonical example is examples/common_component_example.
examples/common_component_example/common_component_example.ccexamples/common_component_example/common_component_example.hexamples/common_component_example/common.dagexamples/common_component_example/common.launch
bazel build //examples/common_component_example/...cyber_launch start examples/common_component_example/common.launchOr:
mainboard -d examples/common_component_example/common.dagmodule_config {
module_library: "../bazel-bin/examples/common_component_example/libcommon_component_example.so"
components {
class_name: "CommonComponentSample"
config {
name: "common"
readers { channel: "/apollo/prediction" }
readers { channel: "/apollo/test" }
}
}
}The reader count must match the component arity.
The timer example is in examples/timer_component_example:
bazel build //examples/timer_component_example/...
cyber_launch start examples/timer_component_example/timer.launchThis variant uses timer_components with an interval instead of input readers.
The component loads from the shared library and processes input as configured in the DAG.