Skip to main content

mecha10_behavior_runtime/
lib.rs

1//! Mecha10 Behavior Runtime
2//!
3//! Unified behavior composition system for robotics and AI: behavior logic is Rust code
4
5pub mod actions;
6mod behavior;
7mod composition;
8pub mod config;
9pub mod control;
10mod execution;
11mod loader;
12mod registry;
13mod status;
14#[cfg(test)]
15mod test_helpers;
16
17pub use actions::{
18    register_builtin_actions, GoToLocationNode, LandNode, MoveNode, RlTaskNode, SensorCheckNode,
19    SetGoToLocationTargetNode, SetRlTargetNode, TakeoffNode, TimerNode, WanderNode,
20};
21pub use behavior::{boxed_children_mut, BehaviorNode, BehaviorNodeExt, BoxedBehavior};
22pub use composition::{
23    ForceFailureNode, ForceSuccessNode, InverterNode, ParallelNode, ParallelPolicy, RepeatNode, RetryNode,
24    SelectOrNode, SequenceNode, SubsumptionLayer, SubsumptionNode, TimeoutNode, WatchNode,
25};
26pub use config::{
27    detect_project_root, get_current_environment, list_available_behaviors, load_behavior_config,
28    resolve_behavior_config_path, validate_behavior_composition_json, validate_behavior_config, BehaviorConfig,
29    CompositionConfig, NodeConfig, NodeReference, ParallelPolicyConfig, SubsumptionLayerConfig, ValidationResult,
30};
31pub use control::{PidController, PidGains};
32pub use execution::{BehaviorExecutor, ExecutionContext, ExecutionStats};
33pub use loader::BehaviorLoader;
34pub use registry::NodeRegistry;
35pub use status::NodeStatus;
36
37pub mod hot_reload;
38
39pub use mecha10_core::Context;
40
41pub mod prelude {
42    pub use crate::actions::{
43        GoToLocationNode, LandNode, MoveNode, RlTaskNode, SensorCheckNode, SetGoToLocationTargetNode, SetRlTargetNode,
44        TakeoffNode, TimerNode, WanderNode,
45    };
46    pub use crate::behavior::{BehaviorNode, BehaviorNodeExt, BoxedBehavior};
47    pub use crate::composition::{
48        ForceFailureNode, ForceSuccessNode, InverterNode, ParallelNode, ParallelPolicy, RepeatNode, RetryNode,
49        SelectOrNode, SequenceNode, SubsumptionLayer, SubsumptionNode, TimeoutNode, WatchNode,
50    };
51    pub use crate::config::{
52        BehaviorConfig, CompositionConfig, NodeConfig, NodeReference, ParallelPolicyConfig, SubsumptionLayerConfig,
53    };
54    pub use crate::control::{PidController, PidGains};
55    pub use crate::execution::{BehaviorExecutor, ExecutionContext, ExecutionStats};
56    pub use crate::loader::BehaviorLoader;
57    pub use crate::registry::NodeRegistry;
58    pub use crate::status::NodeStatus;
59    pub use async_trait::async_trait;
60    pub use mecha10_core::Context;
61}