robotics-design-patterns

Provides architecture patterns and implementation recipes for robot software systems.

Updated Aug 16, 2026
One-click install
npx skills add https://github.com/three1324/yeonjinautomotive --skill robotics-design-patterns-three1324
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: robotics-design-patterns
Source: https://github.com/three1324/yeonjinautomotive/tree/main/.claude/skills/robotics-design-patterns
Command: npx skills add https://github.com/three1324/yeonjinautomotive --skill robotics-design-patterns-three1324

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires py_trees, smach.

What problem does it solve? Designing robot software involves recurring architectural decisions—behavior trees vs. state machines, sensor fusion structure, safety watchdogs, sim-to-real separation—and getting these wrong leads to fragile, unmaintainable systems. This Skill supplies proven patterns with working code so you make these decisions correctly the first time. ## Core Features & Use Cases - Behavioral Frameworks: Implement behavior trees with py_trees or FSMs with smach, including blackboard data sharing and guidance on when to choose each. - Safety Systems: Build layered safety with software watchdogs, heartbeat monitoring, workspace limits, and graceful degradation. - Hardware Abstraction & Sim-to-Real: Structure HAL interfaces so identical application code runs in simulation and on real hardware. - Use Case: When building a ROS2 pick-and-place robot, use the Skill to structure the perception-planning-control pipeline, add a safety watchdog for critical nodes, and define a HAL so the same code runs in Gazebo and on the real arm. ## Quick Start Ask the AI to design a behavior tree with safety watchdogs for a ROS2 mobile robot navigation task.

Frequently Asked Questions about robotics-design-patterns

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

FAQPage Schema
How do I implement a behavior tree for a robot in Python?

Use the py_trees library to compose Sequence, Fallback, and Parallel nodes with Action and Condition leaves. Each behavior implements setup, initialise, update, and terminate methods, and nodes share data through a blackboard.

When should I use a behavior tree vs a finite state machine for robot control?

Use FSMs for simple, linear workflows with clear states, such as protocol handling or UI logic. Use behavior trees for complex robots with reactive behaviors, many conditional branches, and reusable sub-behaviors.

How do I make robot code work in both simulation and real hardware?

Apply the hardware abstraction layer pattern: define abstract interfaces for each device, implement simulated and real drivers behind them, and select implementations via configuration. Application code never knows which mode it runs in.

How do I add a software watchdog to a ROS2 robot?

Create a watchdog that registers critical components, receives periodic heartbeats from each, and triggers a safe stop when a critical component misses its timeout. Run the monitor in a separate thread so it cannot be blocked.

What are common anti-patterns in robot software architecture?

Common anti-patterns include god nodes doing everything, hardcoded magic numbers, polling instead of event-driven callbacks, missing error recovery, blocking the control loop with perception, and logging no data for debugging or training.