Latest 0.0.5
Homepage https://github.com/makeevt/ROSConnector
License MIT
Platforms ios 9.0, requires ARC
Dependencies SocketRocket
Authors

ROSConnector allows you to make your connection to ROSBridge for communication with your robot working on Robot Operating System (ROS).

Using ROSConnector makes your app developing much more easier, because it has functionallity for connecting, sending/recieving messages and making service calls.

Requirements

  • iOS 9.0+
  • Xcode 8

Integration

CocoaPods (iOS 8+)

You can use CocoaPods to install ROSConnectorby adding it to your Podfile:

platform :ios, '9.0'
use_frameworks!

target 'MyApp' do
   pod 'ROSConnector'
end

Note that this requires CocoaPods version 36, and your iOS deployment target to be at least 8.0:

Usage

Initialization

import ROSConnector
let host = "ws://10.10.10.111:9090"
ROSConnector.sharedInstance.delegate = self
ROSConnector.sharedInstance.connect(socketHost: host)

ROSConnectorDelegate Methods

func managerDidConnect(manager: ROSConnector)
func managerDidTimeout(manager: ROSConnector)
func manager(manager: ROSConnector, didFailWithError: NSError)
func manager(manager: ROSConnector, didCloseWithCode: Int, reason: String, wasClean: Bool)

Publish Messages

// Publisher initialization 
var publisher: ROSPublisher?
publisher = ROSConnector.sharedInstance.addPublisher(topic: "/someRobot/someTopic", messageType: "std_msgs/Float64")
publisher?.label = "testPublisher"

// Sending message
let mess = FloatMessage()
mess.data = 10.0
self.publisher?.publish(message: mess)

Subscribe on topic updates

// Subscriber initialization 
var subscriber = ROSSubscriber?
subscriber = ROSConnector.sharedInstance.addSubscriber(topic: "/someRobot/someTopic", delegate: self, messageClass: FloatMessage.self)

// Extension for delegate
extension ViewController: ROSSubscriberDelegate {
    func messageRecieved(message: ROSMessage) {
        if let floatMessage = message as? FloatMessage {
            print(floatMessage.data)
        }
    }
}

Current Availible Message Types

Standart Messages
Geometry Messages
Sensor Messages
ROSCpp

Latest podspec

{
    "name": "ROSConnector",
    "version": "0.0.5",
    "summary": "ROSConnecor is library for ROSBridge that uses WebSockets to communicate with Robot Operating System (ROS)",
    "homepage": "https://github.com/makeevt/ROSConnector",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Timofey Makeev": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/makeevt/ROSConnector.git",
        "tag": "0.0.5"
    },
    "source_files": "ROSConnector/*.{swift}",
    "requires_arc": true,
    "dependencies": {
        "SocketRocket": [
            "~> 0.5"
        ]
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This