custom-bt-condition-cpp

Create custom ROS 2 BehaviorTree.CPP condition nodes in C++ with BT::ConditionNode inheritance and providedPorts().

18|2|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/wimblerobotics/ros2-copilot-skills --skill custom-bt-condition-cpp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: custom-bt-condition-cpp
Source: https://github.com/wimblerobotics/ros2-copilot-skills/tree/main/custom-bt-condition-cpp
Command: npx skills add https://github.com/wimblerobotics/ros2-copilot-skills --skill custom-bt-condition-cpp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enable developers to implement custom ROS 2 BehaviorTree.CPP condition nodes in C++ to query world state and influence task flow with deterministic checks.

Core Features & Use Cases

  • Inherit from BT::ConditionNode and expose ports via providedPorts() to declare inputs like topics, thresholds, and outputs.
  • Access ROS 2 world state through the BT blackboard to read the node handle and sensor data, enabling synchronized decision logic.
  • Use with Nav2 or any ROS 2 navigation/automation flow to gate actions based on concrete conditions.

Quick Start

Implement a new condition node by extending BT::ConditionNode, implement tick() with your logic, expose ports, and register it with the BT factory.

Frequently Asked Questions about custom-bt-condition-cpp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a custom ROS 2 behavior tree condition node in C++?

To create a ROS 2 behavior tree condition node in C++, inherit from BT::ConditionNode, implement tick() with your logic, expose inputs via providedPorts(), and register the node with the BT factory.

How does a behavior tree condition node access ROS 2 sensor data?

A behavior tree condition node accesses ROS 2 sensor data through the BT blackboard to read the ROS 2 node handle, enabling synchronized world-state checks for deterministic decision logic.

When do I need a synchronous condition node in a ROS 2 behavior tree?

You need a synchronous condition node in a ROS 2 behavior tree when performing deterministic world-state checks such as obstacle detection, sensor gating, and conditional navigation task gating.

Does this approach to custom BT nodes work with Nav2 navigation flows?

Yes, this custom BT condition node approach works with Nav2 or any ROS 2 automation flow to gate actions based on concrete conditions read from the synchronized ROS 2 world state.

How do I integrate custom behavior tree nodes into a ROS 2 CMake build?

You integrate custom behavior tree nodes into a ROS 2 CMake build through proper compile-time integration that includes CMake configuration and plugin registration with the BT factory.

Do I need thread-safe message handling for ROS 2 behavior tree conditions?

Yes, you need thread-safe message handling when implementing ROS 2 behavior tree conditions to ensure reliable synchronized decision logic while reading sensor data from the blackboard.