wpilib-best-practices

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

WPILib Best Practices

WPILib最佳实践

WPILib best practices span multiple domains. Load only the reference(s) relevant to the current task.
WPILib最佳实践涵盖多个领域。仅加载与当前任务相关的参考文档即可。

References

参考文档

DomainReferenceWhen to load
Command-based architecturereferences/command-based.mdProject structure,
Robot
/
RobotContainer
layout, command definition patterns (inline vs factory vs subclass), autonomous routines, subsystem organization,
Constants
class
Command Schedulerreferences/command-scheduler.mdHow the scheduler runs, per-iteration execution order, default commands, scheduling conflicts, event callbacks,
disable()
/
cancel()
Command Compositionsreferences/command-compositions.mdCombining commands with
sequence
,
parallel
,
race
,
deadline
,
repeatedly
; end condition and end behavior decorators;
ConditionalCommand
;
ProxyCommand
领域参考文档适用场景
基于命令的架构references/command-based.md项目结构、
Robot
/
RobotContainer
布局、命令定义模式(内联 vs 工厂 vs 子类)、自主程序、子系统组织、
Constants
命令调度器references/command-scheduler.md调度器运行方式、每轮迭代执行顺序、默认命令、调度冲突、事件回调、
disable()
/
cancel()
方法
命令组合references/command-compositions.md使用
sequence
parallel
race
deadline
repeatedly
组合命令;结束条件与结束行为装饰器;
ConditionalCommand
ProxyCommand

Quick Navigation

快速导航

  • "How do I structure my command-based project?"command-based.md (Project Structure)
  • "Should I use a factory method or a Command subclass?"command-based.md (Pattern Selection)
  • "Where do subsystems and button bindings go?"command-based.md (RobotContainer)
  • "How do I handle multi-subsystem commands without circular deps?"command-based.md (Static Command Factories)
  • "How does the scheduler decide what runs and when?"command-scheduler.md (Per-Iteration Run Sequence)
  • "What happens when two commands need the same subsystem?"command-scheduler.md (Scheduling a Command)
  • "How do I run commands in sequence or parallel?"command-compositions.md (Composition Types)
  • "How do I add a timeout or stop-when condition to a command?"command-compositions.md (End Condition Decorators)
  • "How do I run different commands based on a condition?"command-compositions.md (Conditional Commands)
  • “如何构建基于命令的项目结构?”command-based.md(项目结构)
  • “我应该使用工厂方法还是Command子类?”command-based.md(模式选择)
  • “子系统和按钮绑定应该放在哪里?”command-based.md(RobotContainer)
  • “如何处理多子系统命令而避免循环依赖?”command-based.md(静态命令工厂)
  • “调度器如何决定运行内容和时机?”command-scheduler.md(每轮迭代运行顺序)
  • “当两个命令需要同一个子系统时会发生什么?”command-scheduler.md(命令调度)
  • “如何按顺序或并行运行命令?”command-compositions.md(组合类型)
  • “如何为命令添加超时或停止条件?”command-compositions.md(结束条件装饰器)
  • “如何根据条件运行不同的命令?”command-compositions.md(条件命令)