Skip to content

literally-anything/DDSKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DDSKit

License GitHub Release Date

DDSKit is an inter-process communication library built using FastDDS. DDSKit aims provide a simpler and easier-to-use API in Swift, including asynchronous operations using await and a request-reply model, while still remaining performant. DDSKit enables FastDDS's datasharing, intra-process, and zero-copy delivery methods for faster communication between threads or processes on the same machine.

This does actually run on Linux, even though the SPI says it won't. I haven't gotten around to making a docker container that has FastDDS installed, so it will fail to build on the SPI's Linux builds.

Some use cases for this library are:

  • Robotics/Interfacing with ROS2
  • Distributed systems
  • High data rate communitcation

Supported Platforms

Platform Support
Linux Supported*1*2
MacOS Supported*3*2
Other Apple OSs Supported*3*2
Windows Absolutely no clue, but it might work*2

Example

The following code publishes a message on a topic

import DDSKit

let participant = DDSParticipant()
let publisher = participant.publish(to: "hello/world")
publisher.publish(message)

To recieve this message, the following code subscribers to the topic

import DDSKit

let participant = DDSParticipant()
let subscriber = participant.subscribe(to: "hello/world")
for await message in subscriber.messages {
    print(message)
}

Using DDSKit

If you are on Linux, you need to install FastDDS as well. Apple platforms default to using a prebuilt version. DDSKit is available as a Swift Package Manager package. To use it in a package, add the following dependency in your Package.swift

.package(
    url: "https://github.com/literally-anything/DDSKit.git",
    from: "tag"
),

Replace "tag" with any release number: tags. To use the DDSKit library, add

.product(name: "DDSKit", package: "DDSKit"),

to your target's dependencies.

Footnotes

  1. FastDDS must be installed and it needs to findable using pkg-config for it to work with no exta setup.

  2. Needs tests 2 3 4

  3. Prebuilt dylibs of fastdds and fastcdr are required. This is temporary for MacOS. In the future you should be able to use a global install of FastDDS on MacOS as well. 2