Other

技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

蓝色机器人系统:BlueOS 技术深度剖析

项目背景与痛点

BlueOS 是一个开源平台,专为无人遥控潜水器(ROV)、无人水面艇(USV)以及各种仪表和机械的控制而设计。在当前的无人潜水和水面操作领域,这些系统普遍需要一个强大、灵活且易于扩展的平台作为基础,来实现复杂任务的管理、数据流通和多系统协同。而 BlueOS 的出现则很好地解决了这一痛点,有效地整合和管理了这些系统,并提供了对第三方设备与应用程序的支持。

核心技术揭秘

BlueOS 的架构设计充分体现了其作为新一代无人系统控制平台的优势。平台采用了模块化的设计理念,每个组件都有独立的功能模块,从而能够轻易地接入更多的设备和插件。此外,BlueOS 还采用了微服务架构,以保证系统的高可用性和易扩展性。

graph TD A[用户指令] --> B[Frontend 用户界面] B --> C[负载均衡器] C --> D[API Gateway] D --> E{"授权服务"} E -->|"认证通过"| F[Service Discovery] F --> G[实际服务] G --> H{"业务逻辑处理"} H -->|"参数校验失败"| I[返回错误] H -->|"参数校验通过"| J[执行业务逻辑] J --> K[持久化数据] K --> L[返回结果] L --> C C --> B

在架构图中可以看出,用户指令首先通过前端用户界面传递给负载均衡器,负载均衡器将请求转发到 API Gateway 进行集中处理,其中涉及到的身份验证与授权通过授权服务进行处理,而后服务发现组件负责定位并指引请求到相应服务,完成业务逻辑的处理和数据持久化。整个过程清晰高效,体现了微服务架构的优势。

功能亮点与差异

相比于市面上的其他竞品,BlueOS 的亮点在于其高可拓展性和开放性。它不仅提供了对标准接口和协议的广泛支持,还允许开发者自由接入第三方应用和服务。这种灵活性在实际业务中,可以让系统轻松适应不同的应用场景,无论是水下流程管理还是水面货物运输,都可以通过扩展 BlueOS 的功能模块来实现。

应用场景与落地建议

在实际的生产环境中使用 BlueOS 时,需要注意几个关键点。首先,系统的性能和稳定性是重中之重,因此在部署初期应当仔细考量硬件配置。其次,BlueOS 作为一个开源项目,社区的支持和反馈是非常重要的资源,合理利用这些资源可以帮助快速排除上线过程中的问题。此外,在进行业务逻辑开发时,应当遵循 BlueOS 所提倡的设计规范和最佳实践,以确保系统的易维护性和扩展性。总的来说,BlueOS 是适合那些需要复杂管理和多系统集成的无人系统的理想平台。

综合评价

优势:

  • 高高可拓展性和模块化设计:支持多系统集成与业务扩展
  • 基于微服务的架构:确保系统的稳定性和快速响应
  • 强大的社区支持:拥有活跃的贡献者和丰富的第三方插件

问题:

  • 对新手来说,系统的学习和集成有些复杂,需要具备一定的开发经验和对微服务的理解
  • 由于是开源项目,依赖于社区的响应,在某些时候可能会影响到体验与问题反馈的速度

总的来说,BlueOS 是一个高度专业并灵活的无人系统操作平台,拥有强大的特性和完善的生态圈,适合专业开发者和具有复杂需求的业务场景。

关于

GitHub 原始描述(英文)

The open source platform for ROV, USV, robotic system operation, development, and expansion.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
797
价值分
300
活跃状态
活跃

语言占比

CSS
Dockerfile
HTML
JavaScript
Lua
Python
Shell
TypeScript
Vue

Release

README

BlueOS

Test, Build and Deploy Images Downloads Discord Crowdin

Latest Stable Date

Latest Beta Date

Docker Pulls Size

BlueOS is a modular, robust, and efficient platform for managing a vehicle or robot from its onboard computer. It is the evolution of the Companion project, which aimed to route a vehicle’s video stream and communications to its control station computer. Recognizing the need for a more sophisticated and scalable system, BlueOS was created from the ground up, embracing modularity to ensure portability, robust updating, and extensibility.

Principles and Goals 📖

The development of BlueOS is driven by the following core principles:

  • An interface that is simple by default but powerful when needed - the user has the power to change anything they desire and customize the full experience
  • Designed to focus on what matters, improving user access to information and controls with a human-friendly UI and UX
  • Make complex tasks simpler and improve ease of use by reusing design patterns from other applications (based on the material UI guidelines)
  • Advanced error handling and detection, making any problems clear to the user and developers, along with how to fix them
  • Simplify development, providing full access to our services API and modular development model
  • Portable and flexible, you should be able to run on a Raspberry Pi 3/4/5 or any SBC with Linux operating system, contributions are welcomed
  • Highly functional with low CPU usage, the entire system is built to run efficiently
  • Developed on solid foundations, critical parts or intensive workforce services are designed using the most advanced languages and features available for stability

The design, organization, and future releases of BlueOS are aligned with these principles, striving to provide an optimized and enriched user experience.

Release Types ✨

BlueOS is available in three release types:

  • Stable: Officially tested and validated versions with long-term support. Recommended for most users.
  • Beta: Lightly tested rolling releases with new features, bug fixes, and improvements.
  • Master: Bleeding-edge development releases with almost daily changes. These are the very latest features that may not have been tested yet.

Vehicle Support 🛸

BlueOS has been designed with a focus on vehicle and platform agnosticism. Our aim is to facilitate broad compatibility across a wide spectrum of applications. Currently, BlueOS officially supports the following vehicle types:

Boats (ArduRover)

ArduRover is an open-source, uncrewed boat platform. Whether you are commanding a leisure boat or a research vessel, BlueOS’s compatibility with ArduRover ensures that you can navigate the waters smoothly 🌊.

BlueBoat is supported by default.

Submarines (ArduSub)

ArduSub is the go-to control system for remotely operated underwater vehicles (ROVs) 🐟. BlueOS offers seamless integration with ArduSub, enabling efficient management and operation of underwater vehicles.

BlueROV2 is supported out of the box.

Generic (ArduPilot / PX4)

BlueOS provides generic support for a wide variety of terrestrial, aerial, and marine uncrewed vehicles that use ArduPilot and PX4 autopilots. This extends the range of vehicles that can be managed using our system, from drones to autonomous cars and more.

Note: Specific vehicle configuration may be necessary to ensure optimal performance with BlueOS.

Custom installation

Raspberry Pi and hardware preparation

For installations that need hardware configuration and preparation of the operating system, it’s highly recommended to use the installation script and customize it as necessary to perform the necessary changes for your system.

Running BlueOS

It’s highly recommended to have debian, debian based (like ubuntu) or any linux distribution with similar services and tools to run BlueOS. This is necessary since BlueOS use specific components on the host computer to do software configuration and take control of the system.

Running via Docker Compose (docker compose)
  1. Clone the repository with git
    • git clone --depth=1 --recurse-submodules --shallow-submodules https://github.com/bluerobotics/blueos
  2. Modify core/compose/compose.yml example file.
    • BLUEOS_DISABLE_SERVICES: Comment or remove this line if you want BlueOS to have full access of the system, including wifi and ethernet configuration.
    • BLUEOS_DISABLE_MEMORY_LIMIT: Comment or remove this line if running in a system with 4GB of RAM memory or less.
    • BLUEOS_DISABLE_STARTUP_UPDATE: This environment variable is necessary, “startup update” procedure is only required when bootstrap is running to manage the system (not the case when using docker compose).
    • SSH_USER: Uncomment and update the value for the SSH user, required for BlueOS to run commands and access the host computer if necessary.
    • SSH_PASSWORD: Uncomment and update the value for the SSH user password.
  3. Run docker compose
    • cd core/compose/ && docker compose pull && cd - # Ensure that docker is up-to-date
      docker compose -f core/compose/compose.yml up
      

In the end, your docker compose file should look like this

version: "3.7"
services:
  blueos-core:
    container_name: blueos-core
    image: bluerobotics/blueos-core:master
    privileged: true
    network_mode: host
    pid: host
    restart: unless-stopped
    environment:
      - BLUEOS_DISABLE_MEMORY_LIMIT=true
      - BLUEOS_DISABLE_STARTUP_UPDATE=true
      - SSH_USER=pi
      - SSH_PASSWORD=raspberry
    volumes:
      - ./workspace/.config:/root/.config
      - ./workspace/etc/blueos:/etc/blueos
      - ./workspace/tmp/wpa_playground:/tmp/wpa_playground
      - ./workspace/usr/blueos/bin:/usr/blueos/bin
      - ./workspace/usr/blueos/extensions:/usr/blueos/extensions
      - ./workspace/usr/blueos/userdata:/usr/blueos/userdata
      - ./workspace/var/logs/blueos:/var/logs/blueos
      - /dev:/dev
      - /etc/dhcpcd.conf:/etc/dhcpcd.conf
      - /etc/machine-id:/etc/machine-id:ro
      - /etc/resolv.conf.host:/etc/resolv.conf.host:ro
      - /run/udev:/run/udev:ro
      - /sys:/sys
      - /var/run/dbus:/var/run/dbus
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/run/wpa_supplicant:/var/run/wpa_supplicant
      - /run/log/journal:/run/log/journal:ro
      - /var/log/journal:/var/log/journal:ro
      - $HOME/.ssh:/home/pi/.ssh

The system should be accessible now via 0.0.0.0:80 or via the network using the IP address of the device.

Running via Docker (docker run)

You can update the script to follow your board configuration. Here, we are creating temporary folders for the binds, but it’s highly recommended to create a workspace environment where you can set the binds to be persistent.

# Prepare workspace
mkdir -p /tmp/workspace/var/logs/blueos
mkdir -p /tmp/workspace/.config
mkdir -p /tmp/workspace/tmp/wpa_playground
mkdir -p /tmp/workspace/etc/blueos
mkdir -p /tmp/workspace/usr/blueos/{bin,extensions,userdata}

# Docker command
docker run --privileged --network=host --pid=host --name=blueos-core \
  --mount type=bind,source=/dev/,target=/dev/,readonly=false \  # Required for hardware access
  --mount type=bind,source=/sys/,target=/sys/,readonly=false \  # Required for system access
  --mount type=bind,source=/var/run/wpa_supplicant,target=/var/run/wpa_supplicant,readonly=false \ # Required for wifi control
  --mount type=bind,source=/tmp/workspace/tmp/wpa_playground,target=/tmp/wpa_playground,readonly=false \ # Required for wifi control
  --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock,readonly=false \ # Required for docker control
  --mount type=bind,source=/tmp/workspace/var/logs/blueos,target=/var/logs/blueos,readonly=false \ # Required for BlueOS log files
  --mount type=bind,source=/run/udev,target=/run/udev,readonly=true \ # Required for hardware information
  --mount type=bind,source=$HOME/.ssh,target=/home/pi/.ssh,readonly=false \ # Required for host computer access from BlueOS
  --mount type=bind,source=/tmp/workspace/etc/blueos,target=/etc/blueos,readonly=false \ # Required for bash history and other files
  --mount type=bind,source=/etc/machine-id,target=/etc/machine-id,readonly=true \ # Required for hardware / system information
  --mount type=bind,source=/etc/dhcpcd.conf,target=/etc/dhcpcd.conf,readonly=false \ # Required for ethernet control
  --mount type=bind,source=/tmp/workspace/usr/blueos/userdata,target=/usr/blueos/userdata,readonly=false \ # Required for extension data
  --mount type=bind,source=/tmp/workspace/usr/blueos/extensions,target=/usr/blueos/extensions,readonly=false \ # Required for extension data
  --mount type=bind,source=/tmp/workspace/usr/blueos/bin,target=/usr/blueos/bin,readonly=false \ # Required for custom binaries
  --mount type=bind,source=/etc/resolv.conf.host,target=/etc/resolv.conf.host,readonly=true \ # Required for ethernet configuration
  --mount type=bind,source=/var/run/dbus,target=/var/run/dbus,readonly=false \ # Required for wifi and others services access
  --mount type=bind,source=/tmp/workspace/.config,target=/root/.config,readonly=false \ # Required for persistent BlueOS configuration
  --mount type=bind,source=/run/log/journal,target=/run/log/journal,readonly=true \ # Required for readonly access to systemd logs
  --mount type=bind,source=/var/log/journal,target=/var/log/journal,readonly=true \ # Required for readonly access to systemd logs
  -e BLUEOS_DISABLE_MEMORY_LIMIT=true \
  -e BLUEOS_DISABLE_STARTUP_UPDATE=true \
  -e SSH_USER=pi \
  -e SSH_PASSWORD=raspberry \
  bluerobotics/blueos-core:master

After running BlueOS like this, the system should be accessible now via 0.0.0.0:80 or via the network using the IP address of the device.

Supported Architectures 👨🏻‍💻

BlueOS is designed to perform optimally across a wide range of systems. Our latest releases are automatically built for the following architectures:

  • armv7: This is a common architecture for embedded devices. Covers Raspberry Pi models up to and including the Raspberry Pi 3 and Raspberry Pi 4.

  • armv8/arm64: This is used by more recent, high-performance devices. You can run BlueOS on a Raspberry Pi 4 (not recommended, use the armv7 image for a better experience), Raspberry Pi 5, or in a computer with Apple Silicon.

  • amd64: This is the architecture used by most desktop and laptop computers. A typical example is any modern PC running a 64-bit version of Linux. Not fully supported.

Right now we officially support the Raspberry Pi 3, 4 and 5, but the system should “just work” on all listed architectures with the correct docker binds.

Development Environment

Docker based development environment is available for via the core/compose/compose.yml docker compose file. This will start a development environment with all the required services as well as mount all of the needed directories in this repository for development.

cd core/compose/ && docker compose pull && cd - # Ensure that docker is up-to-date
docker compose -f core/compose/compose.yml up

When restarting the development environment you may need to remove the volumes to ensure that the development environment is clean.

docker compose -f core/compose/compose.yml down

Known issues

Docker compose is not fully compatible with a standard installation of BlueOS.

  • MDNS may not work
    • Access should be done via 0.0.0.0:80
  • Some services are disabled
    • cable_guy, wifi, commander
    • This may result in errors on the frontend

评论

暂无评论