10 Star 100 Fork 29

XRobot/XRobot

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

XRobot 自动代码生成工具集 / XRobot Auto Code Generation Toolkit


License GitHub Repo Documentation GitHub Issues CI/CD - Python Package

XRobot 是一套为嵌入式系统(如 STM32)设计的自动化代码生成工具,配合模块化硬件抽象层 LibXR 使用,支持模块仓库管理、构造参数配置、C++ 主函数生成等任务。
XRobot is a suite of automated code generation tools for embedded systems (e.g., STM32), designed to work with the modular hardware abstraction layer LibXR. It supports tasks such as module repository management, constructor configuration, and C++ main function generation.


🔧 安装 / Installation

使用pipx安装 (Install via pipx)

windows

python -m pip install --user pipx
python -m pipx ensurepath
pipx install xrobot
pipx ensurepath
# Restart your terminal

linux

sudo apt install pipx
pipx install xrobot
pipx ensurepath
# Restart your terminal

使用pip安装 (Install via pip)

pip install xrobot

从源码安装 (Install from source)

Or install from source:

git clone https://github.com/xrobot-org/XRobot.git
cd XRobot
pip install .

🧩 功能总览 / Features Overview

  • 模块仓库拉取与同步
    Clone and update module repositories
  • 模块构造参数提取与配置
    Extract and configure constructor arguments
  • 自动生成 XRobotMain() 主入口函数
    Auto-generate XRobotMain() main entry
  • 模块头文件中的 manifest 解析器
    Manifest parser from header files
  • 模块快速生成器(含 CMake 和 README)
    Module skeleton generator (with CMake & README)
  • 支持本地或远程 YAML 配置
    Support local or remote YAML config

🚀 命令行工具 / CLI Tools

以下命令在安装后可直接调用:

The following commands can be run after installation:

命令 Command 说明 Description
xrobot_add_mod 添加模块仓库或模块实例 Add repo or append module config
xrobot_init_mod 拉取并同步所有模块仓库 Clone and sync all module repos
xrobot_gen_main 生成 C++ 主函数 Generate main C++ entry source file
xrobot_create_mod 创建模块模板 Create a new module folder & header
xrobot_mod_parser 解析模块并打印 manifest 信息 Parse and show module manifest
xrobot_setup 一键配置模块 + 生成主函数 One-click setup & generate main

xrobot_add_mod

该工具根据输入目标(Git 仓库 URL 或模块名)自动判断操作类型,分别将模块信息写入:

  • Modules/modules.yaml(模块仓库配置)
  • User/xrobot.yaml(模块实例配置)

This tool automatically detects the operation type (repo or local module) and writes to:

  • Modules/modules.yaml for module repositories
  • User/xrobot.yaml for module instance configurations

🚀 使用方法 / Usage

# 添加模块仓库
# Add module repo  
# (default to Modules/modules.yaml)
xrobot_add_mod https://github.com/yourorg/BlinkLED.git --version main

# 追加模块实例
# Append module instance
# (default to User/xrobot.yaml)
xrobot_add_mod BlinkLED

🎛️ 命令行参数 / Command-Line Arguments

  • target
    位置参数,Git 仓库地址或模块名。
    Positional argument: Git repo URL or local module name.

  • --version, -v
    可选,指定仓库的分支或标签,仅在 target 为 URL 时有效。
    Optional version (branch or tag), valid only when target is a repo URL.

  • --config, -c
    可选,指定 YAML 配置文件路径。模块仓库默认写入 Modules/modules.yaml,模块实例默认写入 User/xrobot.yaml
    Optional config file path. Defaults to Modules/modules.yaml for repos or User/xrobot.yaml for instances.

📤 输出结果 / Output

  • 添加模块仓库 Add module repo
    会将如下内容添加到 Modules/modules.yaml
    It will add the following to Modules/modules.yaml:

    modules:
      - name: BlinkLED
        repo: https://github.com/yourorg/BlinkLED.git
        version: main
    
  • 追加模块实例 Append module instance
    自动读取模块头文件中的构造参数,并将如下内容追加到 User/xrobot.yaml
    It will append the following to User/xrobot.yaml:

    modules:
      - name: BlinkLED
        constructor_args:
          your_arg_name_here: <default or empty>
    

示例 / Example

MODULES/module_name/module_name.hpp

/* === MODULE MANIFEST ===
module_name: BMI088
module_description: 博世 BMI088 6 轴惯性测量单元(IMU)的驱动模块 / Driver module for Bosch BMI088 6-axis Inertial Measurement Unit (IMU)
constructor_args:
  - rotation:
      w: 1.0
      x: 0.0
      y: 0.0
      z: 0.0
  - pid_param:
      k: 1.0
      p: 0.0
      i: 0.0
      d: 0.0
      i_limit: 0.0
      out_limit: 0.0
      cycle: false
  - gyro_topic_name: "bmi088_gyro"
  - accl_topic_name: "bmi088_accl"
  - target_temperature: 45
  - task_stack_depth: 512
required_hardware: spi_bmi088/spi1/SPI1 bmi088_accl_cs bmi088_gyro_cs bmi088_accl_int bmi088_gyro_int pwm_bmi088_heat ramfs database
repository: https://github.com/xrobot-org/BMI088
=== END MANIFEST === */

modules.yaml

modules:
- name: BlinkLED
  repo: https://github.com/xrobot-org/BlinkLED
- name: BMI088
  repo: https://github.com/xrobot-org/BMI088
- name: MadgwickAHRS
  repo: https://github.com/xrobot-org/MadgwickAHRS

User/xrobot.yaml

global_settings:
  monitor_sleep_ms: 1000
modules:
- name: BlinkLED
  constructor_args:
    blink_cycle: 250
- name: BMI088
  constructor_args:
    rotation:
      w: 1.0
      x: 0.0
      y: 0.0
      z: 0.0
    pid_param:
      k: 0.15
      p: 1.0
      i: 0.1
      d: 0.0
      i_limit: 0.3
      out_limit: 1.0
      cycle: false
    gyro_topic_name: bmi088_gyro
    accl_topic_name: bmi088_accl
    target_temperature: 45
    task_stack_depth: 512
- name: MadgwickAHRS
  constructor_args:
    beta: 0.033
    gyro_topic_name: bmi088_gyro
    accl_topic_name: bmi088_accl
    quaternion_topic_name: ahrs_quaternion
    euler_topic_name: ahrs_euler
    task_stack_depth: 512

xrobot_init_mod

该工具用于根据模块配置文件(本地或远程 YAML)自动克隆或更新模块仓库,默认拉取至 Modules/ 目录。
This tool clones or updates module repositories based on a YAML config file (local or remote), and stores them under the Modules/ directory.

🚀 使用方法 / Usage

# 使用默认配置文件 modules.yaml 并拉取到 Modules/
# Pull modules from modules.yaml to Modules/
xrobot_init_mod

# 指定配置文件和目录
# Specify config file and directory
xrobot_init_mod --config my_config.yaml --directory MyModules

🎛️ 命令行参数 / Command-Line Arguments

  • --config, -c
    指定模块配置文件路径或 URL。默认为 Modules/modules.yaml
    Path or URL to the module configuration file. Default is Modules/modules.yaml.

  • --directory, -d
    指定模块仓库下载目录,默认为 Modules/
    Output directory for module repositories. Default is Modules/.

📤 输出结果 / Output

  • 如果配置文件不存在,将自动生成模板 If the configuration file does not exist, a template will be generated.
  • 若模块目录不存在,执行 git clone --recurse-submodules
    If the module directory does not exist, git clone --recurse-submodules is executed.
  • 若模块已存在,进入目录后执行 git pull,并根据配置切换分支(如果提供 version 字段)
    If the module exists, enter the directory and execute git pull, and switch branches if a version field is provided.
  • 每个模块最终存储在 <output_directory>/<module_name> 路径中
    Each module is stored at <output_directory>/<module_name>.

输出示例 / Output Example:

[INFO] Cloning new module: BlinkLED
[EXEC] git clone --recurse-submodules --branch main https://github.com/xrobot-org/BlinkLED Modules/BlinkLED

[SUCCESS] All modules processed

xrobot_gen_main

该工具用于根据模块清单和构造参数配置文件,自动生成 C++ 入口函数 XRobotMain(),支持嵌套参数、重复实例、多模块构造。
This tool generates a C++ entry function XRobotMain() based on the module list and configuration file, supporting nested args, multiple instances, and module composition.

🚀 使用方法 / Usage

# 自动发现所有模块并生成主函数
# Auto-discover modules and generate main entry
xrobot_gen_main --output User/xrobot_main.hpp

# 指定模块和构造参数配置
# Specify modules and config manually
xrobot_gen_main -o main.cpp -m BlinkLED Motor IMU --config User/xrobot.yaml

🎛️ 命令行参数 / Command-Line Arguments

  • --output, -o
    生成的 C++ 文件路径,默认为 User/xrobot_main.hpp
    Output path of generated C++ file, default is User/xrobot_main.hpp.

  • --modules, -m
    可选,指定模块名列表;若未指定,则自动扫描 Modules/ 目录下的模块。
    Optional. List of module names to include. If omitted, auto-discovered from Modules/.

  • --hw
    可选,指定硬件容器变量名,默认为 hw
    Optional. Hardware container variable name. Default: hw.

  • --config, -c
    可选,指定构造参数 YAML 文件;若文件不存在,则自动生成。
    Optional. Path to constructor configuration file. Will be created if not found.

📤 输出结果 / Output

  • 若未指定 --config,将扫描模块头文件中的 /* === MODULE MANIFEST === */ 区块并生成默认 YAML
    If --config is not specified, will scan for /* === MODULE MANIFEST === */ block and generate default YAML.
  • 生成一个包含 XRobotMain() 函数的 .hpp.cpp 文件
    Generates a .hpp or .cpp file containing the XRobotMain() function.
  • 每个模块按 static ModuleName<HardwareContainer> name(hw, appmgr, ...); 格式实例化
    Each module is instantiated as static ModuleName<HardwareContainer> name(hw, appmgr, ...);
  • 支持自动添加头文件
    Support for automatically adding header files
  • 主循环使用 appmgr.MonitorAll()Thread::Sleep()
    Main loop uses appmgr.MonitorAll() and Thread::Sleep()

输出代码示例 / Output Code Example:

#include "app_framework.hpp"
#include "libxr.hpp"

// Module headers
#include "BlinkLED.hpp"
#include "BMI088.hpp"
#include "MadgwickAHRS.hpp"

template <typename HardwareContainer>
static void XRobotMain(HardwareContainer &hw) {
  using namespace LibXR;
  ApplicationManager appmgr;

  // Auto-generated module instantiations
  static BlinkLED<HardwareContainer> blinkled(hw, appmgr, 250);
  static BMI088<HardwareContainer> bmi088(hw, appmgr, {1.0, 0.0, 0.0, 0.0}, {0.15, 1.0, 0.1, 0.0, 0.3, 1.0, false}, "bmi088_gyro", "bmi088_accl", 45, 512);
  static MadgwickAHRS<HardwareContainer> madgwickahrs(hw, appmgr, 0.033, "bmi088_gyro", "bmi088_accl", "ahrs_quaternion", "ahrs_euler", 512);

  while (true) {
    appmgr.MonitorAll();
    Thread::Sleep(1000);
  }
}

xrobot_create_mod

该工具用于快速创建一个符合 XRobot 模块规范的目录结构,包含头文件、README、CMake 配置等,便于模块开发初始化。
This tool quickly scaffolds a new XRobot module with standard files including header, README, and CMake setup, to accelerate module development.

🚀 使用方法 / Usage

# 创建一个名为 MyModule 的模块
# Create a module named MyModule
xrobot_create_mod MyModule --desc "LED blinker" --hw led button --repo https://github.com/yourorg/MyModule

🎛️ 命令行参数 / Command-Line Arguments

  • module_name
    必填,模块名称,必须与目录名一致。
    Required. Module name, must match folder name.

  • --desc
    模块说明文字。默认值:"No description provided"
    Description text for the module. Default: "No description provided".

  • --hw
    所需硬件逻辑接口名列表。默认空。
    List of required logical hardware interfaces. Default: empty.

  • --repo
    GitHub 仓库地址(可选)。
    GitHub repository URL (optional).

  • --out
    输出路径,默认为 Modules/
    Output folder. Default: Modules/.

📂 生成结构 / Generated Structure

假设模块名为 BlinkLED,会生成以下文件结构:
If the module name is BlinkLED, the following structure will be generated:

Modules/
└── BlinkLED/
    ├── BlinkLED.hpp        # 带 manifest 的头文件 / Header file with manifest
    ├── README.md           # 模块文档 / Module documentation
    └── CMakeLists.txt      # 构建配置 / Build configuration

xrobot_mod_parser

该工具用于解析 XRobot 模块头文件中的 MODULE MANIFEST,提取模块的描述、构造参数、所需硬件等信息,并格式化输出。
This tool parses the MODULE MANIFEST block in XRobot module header files, extracting the module description, constructor arguments, required hardware, and formatting the output.

🚀 使用方法 / Usage

# 解析指定路径下的模块目录或模块集合
# Parse module directory or module collection at the specified path
xrobot_mod_parser --path Modules/BlinkLED
# 解析指定路径下的模块目录或模块集合
# Parse module directory or module collection at the specified path
xrobot_mod_parser --path ./Modules

🎛️ 命令行参数 / Command-Line Arguments

  • --path, -p
    必填,模块目录路径或模块集合路径。
    Required. Path to the module directory or module collection.

📤 输出结果 / Output

  • 输出模块描述、构造参数和所需硬件信息。
    Prints the module description, constructor arguments, and required hardware.

  • 如果模块头文件中的 constructor_args 是字典或列表形式,它会被正确解析并格式化为易读格式。
    If constructor_args in the module header is in dictionary or list format, it is parsed and formatted into a readable structure.

输出示例 / Output Example:

=== Module: BlinkLED ===
Description       : 控制 LED 闪烁的简单模块 / A simple module to control LED blinking
Repository        : https://github.com/xrobot-org/BlinkLED

Constructor Args  :
  - blink_cycle        = 250

Required Hardware : led/LED/led1/LED1

xrobot_setup

该工具用于自动配置 XRobot 环境,生成模块仓库配置、CMake 配置以及主函数代码。它通过调用 xrobot_init_mod 初始化模块,生成 CMake 配置,并根据构造参数自动生成主函数代码。
This tool automates the XRobot setup, generating module repository configuration, CMake configuration, and main function code. It initializes modules via xrobot_init_mod, generates CMake configuration, and automatically generates the main function code based on constructor parameters.

🚀 使用方法 / Usage

# 自动配置并生成主函数代码
# Auto-configure and generate main function code
xrobot_setup

🎛️ 命令行参数 / Command-Line Arguments

  • --config, -c
    可选,指定构造参数配置文件路径,可以是本地文件或远程 URL。
    Optional. Path to constructor configuration file, can be a local file or a URL.

📤 输出结果 / Output

  • 默认配置文件
    如果 Modules/modules.yaml 不存在,脚本会生成一个默认配置文件。
    If Modules/modules.yaml doesn't exist, a default configuration file will be created.

  • 模块初始化
    调用 xrobot_init_mod 命令初始化模块仓库,拉取模块代码。
    Calls xrobot_init_mod to initialize the module repository and clone modules.

  • CMake 配置
    生成 Modules/CMakeLists.txt,用于自动包含所有模块的构建配置。
    Generates Modules/CMakeLists.txt for auto-including build configurations of all modules.

  • 主函数生成
    生成 User/xrobot_main.hpp,包含自动生成的 XRobotMain() 函数代码。
    Generates User/xrobot_main.hpp with the auto-generated XRobotMain() function code.

输出示例 / Output Example:

Starting XRobot auto-configuration

[INFO] Default config created: ./Modules/modules.yaml
Please edit the file and rerun.

[EXEC] xrobot_init_mod --config ./Modules/modules.yaml --dir ./Modules
[INFO] Generated default Modules/CMakeLists.txt at: Modules/CMakeLists.txt

[EXEC] xrobot_gen_main --output ./User/xrobot_main.hpp --config ./User/xrobot.yaml
[INFO] Constructor config generated: ./User/xrobot.yaml
Modify the configuration and rerun to apply changes

[EXEC] xrobot_gen_main --output ./User/xrobot_main.hpp --config ./User/xrobot.yaml
All done! Main function generated at: ./User/xrobot_main.hpp

🧪 快速上手 / Quickstart

# 1. 初始化模块仓库模板
# 1. Initialize the module repository template
$ xrobot_init_mod --config Modules/modules.yaml
[WARN] Configuration file not found, creating template: Modules\modules.yaml
[INFO] Please edit the configuration file and rerun this script.

# 2. 拉取模块仓库
# 2. Pull module repositories
$ xrobot_init_mod --config Modules/modules.yaml
[INFO] Cloning new module: BlinkLED
Cloning into 'Modules\BlinkLED'...
remote: Enumerating objects: 19, done.
remote: Counting objects: 100% (19/19), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 19 (delta 6), reused 19 (delta 6), pack-reused 0 (from 0)
Receiving objects: 100% (19/19), done.
Resolving deltas: 100% (6/6), done.
[SUCCESS] All modules processed

$ mkdir User

# 3. 生成主函数
# 3. Generate main function
$ xrobot_gen_main --output User/xrobot_main.hpp
Discovered modules: BlinkLED
[SUCCESS] Generated entry file: User/xrobot_main.hpp

# 4. 创建模块
# 4. Create a module
$ xrobot_create_mod MySensor --desc "IMU interface module" --hw imu scl sda
[OK] Module MySensor generated at Modules\MySensor

# 5. 查看模块信息
# 5. View module information
$ xrobot_mod_parser --path .\Modules\MySensor\

=== Module: MySensor ===
Description       : IMU interface module

Constructor Args  :
  - name               = your_arg_name_here

Required Hardware : imu scl sda

# 6. 添加模块实例
# 6. Add a module instance
$ xrobot_add_mod MySensor
[SUCCESS] Appended module instance 'MySensor' to User\xrobot.yaml

# 7. 查看模块实例
# 7. View module instances
$ cat .\User\xrobot.yaml
global_settings:
  monitor_sleep_ms: 1000
modules:
- name: BlinkLED
  constructor_args:
    blink_cycle: 250
- name: MySensor
  constructor_args:
    name: your_arg_name_here

# 8. 重新生成主函数
# 8. Regenerate main function
$ xrobot_gen_main --output User/xrobot_main.hpp
Discovered modules: BlinkLED, MySensor
[SUCCESS] Generated entry file: User/xrobot_main.hpp

# 9. 查看主函数
# 9. View main function
$ cat .\User\xrobot_main.hpp
#include "app_framework.hpp"
#include "libxr.hpp"

// Module headers
#include "BlinkLED.hpp"
#include "MySensor.hpp"

template <typename HardwareContainer>
static void XRobotMain(HardwareContainer &hw) {
  using namespace LibXR;
  ApplicationManager appmgr;

  // Auto-generated module instantiations
  static BlinkLED<HardwareContainer> blinkled(hw, appmgr, 250);
  static MySensor<HardwareContainer> mysensor(hw, appmgr, "your_arg_name_here");

  while (true) {
    appmgr.MonitorAll();
    Thread::Sleep(1000);
  }
}

📂 项目结构 / Project Structure

C:\Users\xiao\test
├── Modules/                # 上层功能模块 / High-level functional modules
│   ├── BlinkLED/           # 示例模块:LED 闪烁 / Example module: LED blinking
│   │   ├── BlinkLED.hpp    # 模块定义及 manifest / Module header with manifest
│   │   ├── CMakeLists.txt  # 构建脚本 / Build configuration
│   │   └── README.md       # 模块说明文档 / Module documentation
│   └── modules.yaml        # 模块注册列表 / Module registration list
│
├── User/                   # 用户生成文件 / User-generated files
│   ├── xrobot.yaml         # XRobot 配置文件 / XRobot configuration
│   └── xrobot_main.hpp     # 自动生成主函数 / Auto-generated main entry

LibXR / LibXR_CppCodeGenerator / XRobot Relationship

LibXR、LibXR_CppCodeGenerator 与 XRobot 三者形成了一套完整的嵌入式与机器人软件开发体系,分工明确,协同紧密。
LibXR, LibXR_CppCodeGenerator and XRobot together form a complete software ecosystem for embedded and robotics development, with clear separation of concerns and tight integration.


🧠 LibXR

LibXR 是跨平台的驱动抽象与工具库,支持 STM32、Linux 等平台,包含:
LibXR is a cross-platform driver abstraction and utility library supporting STM32, Linux, and more. It provides:

  • 通用外设接口封装
    Unified peripheral interface abstraction
  • 嵌入式组件(如 Terminal、PowerManager、Database 等)
    Embedded modules like Terminal, PowerManager, Database, etc.
  • FreeRTOS / bare-metal 支持
    FreeRTOS and bare-metal support
  • 机器人运动学与导航
    Kinematics and navigation libraries for robotics
  • 自动代码生成支持
    Code generation support

🔗 Links


🔧 LibXR_CppCodeGenerator

LibXR_CppCodeGenerator 是用于 LibXR 的代码生成工具链,当前支持 STM32 + CubeMX,未来将扩展至 Zephyr、ESP-IDF 等平台。
LibXR_CppCodeGenerator is a code generation toolchain for LibXR. It currently supports STM32 with CubeMX, and is planned to support Zephyr, ESP-IDF, and more.

  • 从不同平台的工程文件生成 .yaml 配置
    Parse project files from different platforms to generate .yaml configurations
  • 基于 .yaml 自动生成 app_main.cpp、中断、CMake 等
    Generate app_main.cpp, interrupt handlers, and CMake integration
  • 支持 XRobot glue 层集成
    Supports optional integration with XRobot framework
  • 支持用户代码保留与多文件结构
    Preserves user code blocks and supports modular output

🔗 Links


🤖 XRobot

XRobot 是一个轻量级的模块化应用管理框架,专为嵌入式设备而设计。它本身不包含任何驱动或业务代码,专注于模块的注册、调度、生命周期管理、事件处理与参数配置。
XRobot is a lightweight modular application management framework designed for embedded systems.
It does not include any drivers or business logic by itself. Instead, it focuses on module registration, scheduling, lifecycle management, event handling, and parameter configuration.

  • 模块注册与生命周期管理
    Module registration and lifecycle management
  • 参数管理 / 配置系统 / 事件系统
    Parameter management, configuration system, and event system
  • ApplicationRunner / ThreadManager 等应用调度器
    ApplicationRunner and ThreadManager for runtime coordination
  • 不直接访问硬件,依赖 LibXR 的 PeripheralManager
    Does not access hardware directly, relies on LibXR's PeripheralManager

✅ Recommended For 推荐使用场景

  • 拥有多个子模块(如传感器、通信、控制器)且希望统一管理初始化、调度与资源依赖
    For projects with multiple submodules (e.g., sensors, communication, controllers) needing unified lifecycle and dependency management.

  • 希望构建平台无关的应用层逻辑,与底层驱动解耦
    For building platform-independent application logic decoupled from hardware drivers.

  • LibXR 结合使用,实现自动注册硬件对象(通过 HardwareContainer
    When used with LibXR, supports automatic hardware registration via HardwareContainer.

  • 支持生成模块入口代码、配置逻辑名与硬件名的映射,便于快速适配不同硬件配置
    Supports generating module entry code and logical-to-physical hardware name mapping for quick adaptation to different platforms.

🔗 Links


📄 License

Apache 2.0 License. © xrobot-org authors.

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

XRobot是一套适用于微控制器、Arm/x86 Linux和模拟器的机器人开发框架,能够让使用者选择所需的模块并快速搭建成完整的机器人系统。 展开 收起
Python
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/x-robot/XRobot.git
git@gitee.com:x-robot/XRobot.git
x-robot
XRobot
XRobot
XRobot2.0

搜索帮助