Other

项目介绍

rticommunity/rticonnextdds-connector-go 是一个托管在 GitHub 上的开源项目,主要使用 Go 编写,采用 Other 许可证,目前获得 40 个 Star、17 次 Fork。

仓库全名
rticommunity/rticonnextdds-connector-go
开源许可证
Other
Star 数
40
Fork 数
17
未关闭 Issue
1

README 摘要

RTI Connector for Connext DDS - Go (Experimental) A lightweight, easy-to-use Go binding for RTI Connext DDS that enables rapid development of distributed applications. Experimental Status RTI Connector for Go is currently experimental and intended for evaluation, prototyping, feedback and Not recommended for production use. Use this package to explore Go + DDS integration and help shape the future of Go support in…

完整内容见 GitHub 原始 README 或本页 。

常见问题

rticonnextdds-connector-go 用什么语言开发?

主要使用 Go 编写,采用 Other 许可证,目前有 40 个 Star。

rticonnextdds-connector-go 可以免费商用吗?

仓库标注的许可证为 Other,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 rticonnextdds-connector-go 的源码?

可以直接克隆仓库:git clone https://github.com/rticommunity/rticonnextdds-connector-go.git,默认分支为 master;安装与运行步骤见仓库 README。

rticonnextdds-connector-go 最近还在维护吗?

仓库最近一次更新为 2月18日,当前有 1 个未关闭 Issue;Star 数为 40,可作为社区活跃度的参考。

关于

RTI Connector for Connext DDS is a lightweight technology that enables DDS data to be accessed with Go.

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
83
价值分
29
活跃状态
活跃

README

RTI Connector for Connext DDS - Go (Experimental)

Coverage Go Report Card Build and Test Go Version Go Documentation

A lightweight, easy-to-use Go binding for RTI Connext DDS that enables rapid development of distributed applications.

Experimental Status

RTI Connector for Go is currently experimental and intended for evaluation, prototyping, feedback and Not recommended for production use. Use this package to explore Go + DDS integration and help shape the future of Go support in RTI products.

Do not use Connector for Go in production.

Table of Contents

Overview

RTI Connector for Connext DDS is a lightweight, easy-to-use API that provides access to the power and functionality of RTI Connext DDS. Built on XML-Based Application Creation and Dynamic Data, it enables rapid prototyping and development of distributed applications.

Originally created by the RTI Research Group for demos and proof-of-concepts, RTI Connector is perfect for developers who need to quickly integrate DDS communication into their Go applications without the complexity of the full RTI Connext DDS Professional SDK.

Key Features

✨ Simple API - Easy-to-use Go interface that hides DDS complexity
🚀 Rapid Development - Get up and running with DDS in minutes
🔄 Dynamic Data - No need to generate code from type definitions
📄 XML Configuration - Define data types and QoS policies declaratively in XML
🌐 Cross-Platform - Supports Linux x64, macOS, and Windows x64

Quick Start

Prerequisites

  • Go 1.26.10 or later. Go 1.27 users must use 1.27.3 or later.
  • Supported platform (Linux x64, macOS, Windows x64)

The library downloader and CI use Connector v1.4.0 by default. Use -version to select another release. Intel macOS and 32-bit ARM Linux require -version v1.3.1.

Installation

  1. Create a new project directory and initialize a Go module:
mkdir my-rti-project
cd my-rti-project
go mod init my-rti-project
  1. Get the Go package:
go get github.com/rticommunity/rticonnextdds-connector-go
  1. Download RTI Connector libraries:
go run github.com/rticommunity/rticonnextdds-connector-go/cmd/download-libs@latest
  1. Set library path (for runtime):
# macOS (Apple Silicon/ARM64) - v1.4.0+
export DYLD_LIBRARY_PATH=$(pwd)/rticonnextdds-connector/lib/osx-arm64:$DYLD_LIBRARY_PATH

# macOS (Intel/x86_64) - requires v1.3.1
# go run github.com/rticommunity/rticonnextdds-connector-go/cmd/download-libs@latest -version v1.3.1
export DYLD_LIBRARY_PATH=$(pwd)/rticonnextdds-connector/lib/osx-x64:$DYLD_LIBRARY_PATH

# Linux  
export LD_LIBRARY_PATH=$(pwd)/rticonnextdds-connector/lib/linux-x64:$LD_LIBRARY_PATH

# Windows (PowerShell)
$env:PATH = "$(pwd)\rticonnextdds-connector\lib\win-x64;$env:PATH"

💡 macOS Users: Use osx-arm64 for Apple Silicon Macs (M1/M2/M3). Intel Mac support (osx-x64) requires v1.3.1. Check your architecture with uname -m (arm64 = Apple Silicon, x86_64 = Intel).

💡 New to RTI Connector Go? Try the go-get-example first - it provides a complete walkthrough of this installation process with a simple working example.

Your First DDS Application

  1. Create an XML configuration file (ShapeExample.xml):
<dds>
  <qos_library name="QosLibrary">
    <qos_profile name="DefaultProfile" base_name="BuiltinQosLibExp::Generic.StrictReliable" is_default_qos="true"/>
  </qos_library>
  
  <types>
    <struct name="ShapeType">
      <member name="color" type="string" key="true" stringMaxLength="128"/>
      <member name="x" type="long"/>
      <member name="y" type="long"/>
      <member name="shapesize" type="long"/>
    </struct>
  </types>
  
  <domain_library name="MyDomainLibrary">
    <domain name="MyDomain" domain_id="0">
      <register_type name="ShapeType" type_ref="ShapeType"/>
      <topic name="Square" register_type_ref="ShapeType"/>
    </domain>
  </domain_library>
  
  <domain_participant_library name="MyParticipantLibrary">
    <domain_participant name="Zero" domain_ref="MyDomainLibrary::MyDomain">
      <publisher name="MyPublisher">
        <data_writer name="MySquareWriter" topic_ref="Square"/>
      </publisher>
      <subscriber name="MySubscriber">
        <data_reader name="MySquareReader" topic_ref="Square"/>
      </subscriber>
    </domain_participant>
  </domain_participant_library>
</dds>
  1. Create a publisher (publisher.go):
package main

import (
    "log"
    "time"
    
    rti "github.com/rticommunity/rticonnextdds-connector-go"
)

func main() {
    // Create connector
    connector, err := rti.NewConnector("MyParticipantLibrary::Zero", "./ShapeExample.xml")
    if err != nil {
        log.Fatal(err)
    }
    defer connector.Delete()

    // Get output (writer)
    output, err := connector.GetOutput("MyPublisher::MySquareWriter")
    if err != nil {
        log.Fatal(err)
    }

    // Publish data
    for i := 0; i < 10; i++ {
        output.Instance.SetString("color", "BLUE")
        output.Instance.SetInt("x", i*10)
        output.Instance.SetInt("y", i*20)
        output.Instance.SetInt("shapesize", 30)
        
        output.Write()
        log.Printf("Published sample %d", i)
        time.Sleep(time.Second)
    }
}
  1. Create a subscriber (subscriber.go):
package main

import (
    "log"
    
    rti "github.com/rticommunity/rticonnextdds-connector-go"
)

func main() {
    // Create connector
    connector, err := rti.NewConnector("MyParticipantLibrary::Zero", "./ShapeExample.xml")
    if err != nil {
        log.Fatal(err)
    }
    defer connector.Delete()

    // Get input (reader)
    input, err := connector.GetInput("MySubscriber::MySquareReader")
    if err != nil {
        log.Fatal(err)
    }

    // Read data
    log.Println("Waiting for data...")
    for {
        connector.Wait(-1) // Wait indefinitely for data
        input.Take()
        
        numSamples, _ := input.Samples.GetLength()
        for i := 0; i < numSamples; i++ {
            if valid, _ := input.Infos.IsValid(i); valid {
                color, _ := input.Samples.GetString(i, "color")
                x, _ := input.Samples.GetInt(i, "x")
                y, _ := input.Samples.GetInt(i, "y")
                shapesize, _ := input.Samples.GetInt(i, "shapesize")
                
                log.Printf("Received: color=%s, x=%d, y=%d, size=%d", color, x, y, shapesize)
            }
        }
    }
}
  1. Run your application:

Make sure you’ve completed the installation steps above (including library download and path setup), then:

# Terminal 1 - Start subscriber
go run subscriber.go

# Terminal 2 - Start publisher  
go run publisher.go

You should see the subscriber receiving data published by the publisher!

Library Management

The installation above uses our automated library download tool. For advanced scenarios, see our comprehensive guides:

Library Download Tool Options

# Download specific version
go run github.com/rticommunity/rticonnextdds-connector-go/cmd/download-libs@latest -version v1.3.1

# Check what's currently installed
go run github.com/rticommunity/rticonnextdds-connector-go/cmd/download-libs@latest -current

# List available versions
go run github.com/rticommunity/rticonnextdds-connector-go/cmd/download-libs@latest -list

Usage Examples

Explore our comprehensive examples to learn different patterns and use cases:

Example Description Key Features
Simple Basic publisher/subscriber Getting started, basic data flow
Go Get Example For go get users Inline XML, library download workflow
Shapes Demo Array data handling Complex data types, arrays
JSON Integration Go struct mapping JSON serialization, struct binding
Request-Reply RPC pattern Synchronous communication
Security Secure communication Authentication, encryption
Multiple Files Modular configuration XML organization, reusability

📁 Browse all examples →

Platform Support

RTI Connector supports the following platforms with automated CI testing:

Platform Architecture CI Status Notes
Linux x86_64 ✅ Tested on Ubuntu 22.04 (ubuntu-latest)
Linux ARM64 ✅ Supported (libraries included)
macOS Apple Silicon (ARM64) ✅ Tested on macos-latest v1.4.0+
macOS Intel (x86_64) ⚠️ Use v1.3.1 Removed in v1.4.0
Windows x86_64 ✅ Tested on Windows Server 2022 (windows-latest)

📝 Note: Starting with v1.4.0, Intel Mac (osx-x64) and 32-bit ARM Linux (linux-arm) support have been removed. If you need these platforms, use v1.3.1: go run github.com/rticommunity/rticonnextdds-connector-go/cmd/download-libs@latest -version v1.3.1

Version Information

To check the version of your installed RTI libraries:

go run github.com/rticommunity/rticonnextdds-connector-go/cmd/download-libs@latest -current

Development

Building and Testing

For contributors and developers working with the source code:

# Clone and setup
git clone https://github.com/rticommunity/rticonnextdds-connector-go.git
cd rticonnextdds-connector-go
make download-libs

# Run all tests with coverage
make test-local

# Run comprehensive test suite with quality checks
./test_improvements.sh

# Build all packages
go build ./...

# Run static analysis
go vet ./...

# Format code
go fmt ./...

Threading Model

⚠️ Important: The Connector Native API does not implement thread safety. You are responsible for protecting calls to Connector in multi-threaded applications.

The native code was originally designed for single-threaded environments (RTI Prototyper and Lua). While we’ve added support for Go, Python, and JavaScript, thread safety remains the developer’s responsibility.

Documentation

Additional Resources

Contributing

We welcome contributions! Here’s how to get started:

  1. 📝 Sign the CLA - Required for all contributions
  2. 🍴 Fork and clone the repository
  3. 🔧 Make your changes with tests
  4. ✅ Run quality checks: make test-local or ./test_improvements.sh
  5. 📤 Submit a pull request

All contributions are automatically tested for quality, including:

  • Build verification across platforms
  • Code linting and formatting
  • Comprehensive test suite validation
  • Coverage analysis

Support

Getting Help


Ready to get started? Check out our Quick Start guide or explore the examples!

评论

暂无评论