--- name: bt-blackboard-patterns description: 'Use BT blackboard for data sharing. Use when passing goals, paths, or state between BT nodes via the blackboard.' --- # Blackboard Patterns and Data Flow ## Port Remapping Syntax The `{variable}` syntax connects node ports to blackboard entries. When a port value is enclosed in curly braces, the BT engine reads from or writes to that blackboard key: ```xml ``` Without braces, the value is treated as a literal: ```xml ``` ## Default Values in Port Declarations Ports can specify defaults in C++ that apply when the XML attribute is omitted: ```cpp static BT::PortsList providedPorts() { return { BT::InputPort("speed", 0.5, "Movement speed in m/s"), BT::InputPort("planner_id", "GridBased", "Planner plugin"), }; } ``` ```xml ``` ## SetBlackboard Node Sets a blackboard variable from XML. Only supports string values that are converted to the appropriate type when read: ```xml ``` For geometry types, the string format depends on the registered converter. Nav2 registers converters for `PoseStamped` using semicolon-separated values: ```xml ``` ## Script Node for Inline Computation BT.CPP v4's `