mecha10-behavior-patterns 0.1.23

Common behavior patterns for Mecha10 - subsumption, ensemble, and more
Documentation
{
  "$schema": "https://mecha10.dev/schemas/behavior-composition-v1.json",
  "name": "navigation",
  "description": "Default point-to-point navigation with dynamic path planning and collision avoidance",
  "root": {
    "type": "sequence",
    "name": "navigation_pipeline",
    "children": [
      {
        "type": "node",
        "node": "validate_goal",
        "name": "goal_validator",
        "config": {
          "require_valid_position": true,
          "check_reachability": true,
          "timeout_sec": 1.0
        }
      },
      {
        "type": "parallel",
        "name": "plan_and_localize",
        "policy": "require_all",
        "children": [
          {
            "type": "node",
            "node": "compute_global_path",
            "name": "global_planner",
            "config_ref": "global_planning"
          },
          {
            "type": "node",
            "node": "update_localization",
            "name": "localizer",
            "config": {
              "localization_method": "amcl",
              "update_rate_hz": 30.0,
              "initial_pose_required": true
            }
          }
        ]
      },
      {
        "type": "selector",
        "name": "execute_navigation",
        "children": [
          {
            "type": "sequence",
            "name": "adaptive_navigation",
            "children": [
              {
                "type": "parallel",
                "name": "navigate_with_safety",
                "policy": "require_one",
                "children": [
                  {
                    "type": "selector",
                    "name": "path_execution",
                    "children": [
                      {
                        "type": "sequence",
                        "name": "dynamic_obstacle_handling",
                        "children": [
                          {
                            "type": "node",
                            "node": "detect_dynamic_obstacles",
                            "name": "dynamic_detector",
                            "config": {
                              "tracking_enabled": true,
                              "predict_trajectories": true,
                              "prediction_horizon_sec": 2.0,
                              "min_velocity_threshold": 0.1
                            }
                          },
                          {
                            "type": "selector",
                            "name": "avoidance_or_replan",
                            "children": [
                              {
                                "type": "node",
                                "node": "compute_local_avoidance",
                                "name": "local_avoider",
                                "config_ref": "local_avoidance"
                              },
                              {
                                "type": "sequence",
                                "name": "replan_global",
                                "children": [
                                  {
                                    "type": "node",
                                    "node": "invalidate_current_path",
                                    "name": "path_invalidator",
                                    "config": {
                                      "clear_trajectory": true,
                                      "reset_controller": false
                                    }
                                  },
                                  {
                                    "type": "node",
                                    "node": "compute_global_path",
                                    "name": "replanner",
                                    "config_ref": "global_planning"
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "type": "node",
                        "node": "execute_local_plan",
                        "name": "local_controller",
                        "config_ref": "local_control"
                      }
                    ]
                  },
                  {
                    "type": "node",
                    "node": "monitor_safety_constraints",
                    "name": "safety_monitor",
                    "config": {
                      "max_linear_velocity": 1.5,
                      "max_angular_velocity": 2.0,
                      "min_obstacle_distance": 0.4,
                      "emergency_stop_distance": 0.25,
                      "monitor_rate_hz": 50.0
                    }
                  }
                ]
              },
              {
                "type": "node",
                "node": "check_goal_reached",
                "name": "goal_checker",
                "config": {
                  "xy_tolerance": 0.2,
                  "yaw_tolerance_deg": 15.0,
                  "require_stopped": true,
                  "max_velocity_for_success": 0.1
                }
              }
            ]
          },
          {
            "type": "sequence",
            "name": "recovery_behavior",
            "children": [
              {
                "type": "node",
                "node": "log_navigation_failure",
                "name": "failure_logger",
                "config": {
                  "log_level": "warn",
                  "include_telemetry": true,
                  "notify_operator": false
                }
              },
              {
                "type": "selector",
                "name": "recovery_strategies",
                "children": [
                  {
                    "type": "node",
                    "node": "clear_costmap",
                    "name": "costmap_clearer",
                    "config": {
                      "clear_radius": 1.0,
                      "keep_obstacles": true
                    }
                  },
                  {
                    "type": "node",
                    "node": "rotate_in_place",
                    "name": "rotation_recovery",
                    "config": {
                      "rotation_angle_deg": 360.0,
                      "rotation_speed": 0.5,
                      "clear_sensor_data": true
                    }
                  },
                  {
                    "type": "node",
                    "node": "backup_and_retry",
                    "name": "backup_recovery",
                    "config": {
                      "backup_distance": 0.3,
                      "backup_speed": 0.2,
                      "retry_after_backup": true
                    }
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "node",
        "node": "publish_navigation_result",
        "name": "result_publisher",
        "config": {
          "topic": "/navigation/result",
          "include_path": false,
          "include_stats": true
        }
      }
    ]
  },
  "configs": {
    "global_planning": {
      "planner_algorithm": "a_star",
      "grid_resolution": 0.05,
      "allow_unknown_space": false,
      "use_dijkstra_heuristic": false,
      "cost_neutral_threshold": 50,
      "cost_lethal_threshold": 253,
      "smooth_path": true,
      "smoothing_iterations": 5
    },
    "local_avoidance": {
      "algorithm": "dwa",
      "max_vel_x": 1.2,
      "min_vel_x": -0.3,
      "max_vel_theta": 1.5,
      "acc_lim_x": 2.0,
      "acc_lim_theta": 3.0,
      "sim_time": 1.5,
      "sim_granularity": 0.025,
      "vx_samples": 10,
      "vtheta_samples": 20,
      "path_distance_bias": 32.0,
      "goal_distance_bias": 20.0,
      "occdist_scale": 0.02
    },
    "local_control": {
      "controller_frequency": 20.0,
      "max_vel_x": 1.0,
      "min_vel_x": 0.0,
      "max_vel_theta": 1.2,
      "min_in_place_vel_theta": 0.4,
      "xy_goal_tolerance": 0.15,
      "yaw_goal_tolerance": 0.2,
      "latch_xy_goal_tolerance": false
    }
  }
}