All Projects → rticommunity → rticonnextdds-connector-go

rticommunity / rticonnextdds-connector-go

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

Programming Languages

c
50402 projects - #5 most used programming language
go
31211 projects - #10 most used programming language
Roff
2310 projects
Makefile
30231 projects
lua
6591 projects
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to rticonnextdds-connector-go

Goav
Golang bindings for FFmpeg
Stars: ✭ 1,767 (+9716.67%)
Mutual labels:  golang-bindings
coding-notes
I'm compiling comprehensive coding tutorials for many different languages and frameworks! 🐲
Stars: ✭ 201 (+1016.67%)
Mutual labels:  dds
rtiperftest
RTI Perftest is a command-line application that measures the Latency and Throughput of very configurable scenarios that use RTI Connext DDS middleware to send messages.
Stars: ✭ 38 (+111.11%)
Mutual labels:  dds
Confluent Kafka Go
Confluent's Apache Kafka Golang client
Stars: ✭ 3,047 (+16827.78%)
Mutual labels:  golang-bindings
vscode-ibmi-languages
Syntax highlighting for IBM i languages such as RPG, CL, DDS, MI, and RPGLE fixed/free.
Stars: ✭ 28 (+55.56%)
Mutual labels:  dds
zenoh-plugin-dds
A zenoh plug-in that allows to transparently route DDS data. This plugin can be used by DDS applications, such as ROS2 robotic applications and others, to leverage the zenoh for geographical routing or for better scaling discovery.
Stars: ✭ 60 (+233.33%)
Mutual labels:  dds
go-tree-sitter
Golang bindings for tree-sitter https://github.com/tree-sitter/tree-sitter
Stars: ✭ 137 (+661.11%)
Mutual labels:  golang-bindings
DDS-Router
The DDS Router is an application developed by eProsima that allows, using Fast DDS, to communicate by DDS protocol different networks.
Stars: ✭ 34 (+88.89%)
Mutual labels:  dds
GbxDump
A Microsoft Windows application that displays the contents of the file header of *.Gbx files used by the Nadeo game engine GameBox.
Stars: ✭ 19 (+5.56%)
Mutual labels:  dds
pydds
Python API for DDS
Stars: ✭ 22 (+22.22%)
Mutual labels:  dds
oculante
A minimalistic crossplatform image viewer written in rust
Stars: ✭ 169 (+838.89%)
Mutual labels:  dds
EnvMapTooL
No description or website provided.
Stars: ✭ 25 (+38.89%)
Mutual labels:  dds
zhe
Lighter-than-air, peer-to-peer, bounded, non-blocking, non-threaded, etc., publish-subscribe networking
Stars: ✭ 44 (+144.44%)
Mutual labels:  dds
Go Sciter
Golang bindings of Sciter: the Embeddable HTML/CSS/script engine for modern UI development
Stars: ✭ 2,280 (+12566.67%)
Mutual labels:  golang-bindings
rclshark
Tool for ROS 2 IP Discovery + System Monitoring
Stars: ✭ 32 (+77.78%)
Mutual labels:  dds
goxlsxwriter
Golang bindings for libxlsxwriter for writing XLSX files
Stars: ✭ 18 (+0%)
Mutual labels:  golang-bindings
node-opendds
NodeJS to OpenDDS bridge.
Stars: ✭ 16 (-11.11%)
Mutual labels:  dds
pyopendds
Python Bindings for OpenDDS
Stars: ✭ 29 (+61.11%)
Mutual labels:  dds
Px4 Autopilot
PX4 Autopilot Software
Stars: ✭ 5,090 (+28177.78%)
Mutual labels:  dds
mros2
agent-less and lightweight communication library compatible with rclcpp for embedded devices
Stars: ✭ 72 (+300%)
Mutual labels:  dds

rticonnextdds-connector-go

Coverage Go Report Card

RTI Connector for Connext DDS

RTI Connector for Connext DDS is a quick and easy way to access the power and functionality of RTI Connext DDS. It is based on XML-Based Application Creation and Dynamic Data.

Connector was created by the RTI Research Group to quickly and easily develop demos and proofs of concept. It can be useful for anybody that needs a quick way to develop an application communicating over the Connext DDS Databus. Thanks to the binding with multiple programming languages, you can integrate with many other available technologies.

The Connector library is provided in binary form for select architectures. Language bindings and examples are provided in source format.

Go Connector leverages cgo to call its C library; this detail is hidden in a Go wrapper.

Examples

Simple Reader

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

func main() {
	connector, err := rti.NewConnector("MyParticipantLibrary::Zero", "./ShapeExample.xml")
	if err != nil {
		log.Panic(err)
	}
	defer connector.Delete()
	input, err := connector.GetInput("MySubscriber::MySquareReader")
	if err != nil {
		log.Panic(err)
	}

	for {
		connector.Wait(-1)
		input.Take()
		numOfSamples, _ := input.Samples.GetLength()
		for j := 0; j < numOfSamples; j++ {
			valid, _ := input.Infos.IsValid(j)
			if valid {
				json, err := input.Samples.GetJSON(j)
				if err != nil {
					log.Println(err)
				} else {
					log.Println(string(json))
				}
			}
		}
	}
}

Simple Writer

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

func main() {
	// Create a connector defined in the XML configuration
	connector, err := rti.NewConnector("MyParticipantLibrary::Zero", "./ShapeExample.xml")
	if err != nil {
		log.Panic(err)
	}
	// Delete the connector when this main function returns
	defer connector.Delete()

	// Get an output from the connector
	output, err := connector.GetOutput("MyPublisher::MySquareWriter")
	if err != nil {
		log.Panic(err)
	}

	// Set values to the instance and write the instance
	for i := 0; i < 10; i++ {
		output.Instance.SetInt("x", i)
		output.Instance.SetInt("y", i*2)
		output.Instance.SetInt("shapesize", 30)
		output.Instance.SetString("color", "BLUE")
		output.Write()
		log.Println("Writing...")
		time.Sleep(time.Second * 1)
	}
}

XML Configurations

<dds>
  <!-- Qos Library -->
  <qos_library name="QosLibrary">
    <qos_profile name="DefaultProfile" base_name="BuiltinQosLibExp::Generic.StrictReliable" is_default_qos="true">
      <participant_qos>
        <transport_builtin>
          <mask>UDPV4 | SHMEM</mask>
        </transport_builtin>
      </participant_qos>
    </qos_profile>
  </qos_library>
  <!-- types -->
  <types>
    <struct name="ShapeType" extensibility="extensible">
      <member name="color" stringMaxLength="128" id="0" type="string" key="true"/>
      <member name="x" id="1" type="long"/>
      <member name="y" id="2" type="long"/>
      <member name="shapesize" id="3" type="long"/>
    </struct>
    <enum name="ShapeFillKind" extensibility="extensible">
      <enumerator name="SOLID_FILL" value="0"/>
      <enumerator name="TRANSPARENT_FILL" value="1"/>
      <enumerator name="HORIZONTAL_HATCH_FILL" value="2"/>
      <enumerator name="VERTICAL_HATCH_FILL" value="3"/>
    </enum>
    <struct name="ShapeTypeExtended" baseType="ShapeType" extensibility="extensible">
      <member name="fillKind" id="4" type="nonBasic" nonBasicTypeName="ShapeFillKind"/>
      <member name="angle" id="5" type="float"/>
    </struct>
  </types>
  <!-- Domain Library -->
  <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>
  <!-- Participant 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>

Please see examples for usage details.

Getting started

Using Go Modules

Be sure you have golang installed (we tested with golang v1.17).

Import:

import "github.com/rticommunity/rticonnextdds-connector-go"

Build:

$ go build reader.go

A dependency to the latest stable version of rticonnextdds-connector-go should be automatically added to your go.mod file.

Run:

To run your application, you need to add the Connector C library to your library path.

$ export LD_LIBRARY_PATH=$GOPATH//go/pkg/mod/github.com/rticommunity/rticonnextdds-connector-go\@{version}-{YYYYMMDDHHmm}-{commit_id}/rticonnextdds-connector/lib/linux-x64:$LD_LIBRARY_PATH
$ ./simple_reader

Platform support

Go Connector builds its library for few select architectures. If you need another architecture, please contact your RTI account manager or [email protected].

If you want to check the version of the libraries you can run the following command:

strings ./rticonnextdds-connector/lib/linux-x64/librtiddsconnector.so | grep BUILD

Threading model

The Connector Native API does not yet implement any mechanism for thread safety. Originally, the Connector native code was built to work with RTI Prototyper and Lua. That was a single-threaded loop. RTI then introduced support for JavaScript, Python, and Go. For now, you are responsible for protecting calls to Connector. Thread safety may be implemented in the future.

Support

Connector is an experimental RTI product. If you have questions, please use the RTI Community Forum. If you would like to report a bug or have a feature request, please create an issue.

Documentation

The best way to get started with Connector is to look at the examples; you will see that it is very easy to use.

Contributing

Contributions to the code, examples, documentation are really appreciated. Please follow the steps below for contributions.

  1. Sign the CLA.
  2. Create a fork and make your changes.
  3. Run tests and linters (make test lint).
  4. Push your branch.
  5. Open a new pull request.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].