Skip to main content

Crate mecha10_behavior_patterns

Crate mecha10_behavior_patterns 

Source
Expand description

Mecha10 Behavior Patterns

This crate provides common behavior patterns as reusable BehaviorNode implementations. These patterns solve common robotics problems like priority-based control and multi-model fusion.

§Available Patterns

  • Subsumption: Priority-based layered control for safety-critical systems
  • Ensemble: Multi-model fusion with various voting strategies

§Example

use mecha10_behavior_patterns::prelude::*;
use mecha10_behavior_runtime::prelude::*;


// Subsumption: Safety overrides task behavior
let subsumption = SubsumptionNode::new()
    .add_layer(10, Box::new(SafetyBehavior))  // High priority
    .add_layer(1, Box::new(TaskBehavior));    // Low priority

Modules§

prelude

Structs§

EnsembleNode
SubsumptionLayer
A single priority layer in a SubsumptionNode: a priority (higher wins) plus the behavior that implements it.
SubsumptionNode
Priority-based preemption (subsumption architecture): on each tick, tries each layer highest-priority first. The first layer whose tick() returns Running/Success “wins” and its status is returned for that tick - lower-priority layers aren’t ticked at all that cycle, so their own internal progress (e.g. a SequenceNode’s current child index) is naturally preserved rather than reset, which is what gives a preempted lower layer “resume where it left off” semantics for free.
WeightedModel

Enums§

EnsembleStrategy