ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to write a node in iOS?

asked 2017-10-25 00:12:23 -0500

rozoalex gravatar image

I want to write a iPhone app that's able to publish some message on a ROS topic. I found one implemented with RabbitMQ from here : . However, I would prefer everything happens locally through http and ports. How do I do that? Is there any good resource?


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2017-10-25 02:09:38 -0500

gvdhoorn gravatar image

updated 2018-01-13 05:48:34 -0500

Edit: wesgood/RBManager seems to have been upgraded. New repo: wesgood/RBSManager. From the readme:

A Swift-native library for handling the WebSocket connection to a Robot Operating System (ROS) master running ROSBridge. Control your robots with a mobile phone.

Old answer:

everything happens locally through http and ports

I'm not sure I follow here: what 'ports' are you referring to specifically?

In any case: I'm not an iPhone dev (so I'm not too aware of the limitations that you are faced with) but you could take a look at rosbridge_suite. It essentially provides a JSON interface into a ROS application that you can then communicate with using anything that can work with JSON (which is just about anything these days). There are various implementations of rosbridge clients, but probably not in languages that are interesting when developing on iOS, such as Rosbridge .NET Client and h2r/java_rosbridge, and the 'minimal Python client' that is available as part of rosbridge_library in rosbridge_suite itself.

And there are some projects that implement a plain HTTP REST interface to a ROS application, such as rostful.

All of the above will require a bridge node running in your ROS application, they do not implement a native ROS client library.

If you'd like to avoid the bridging approach, an alternative might be rosnodejs, which is a Node JS based ROS client library that foregoes the JSON serialisation of rosbridge.

If you are not limited to ROS 1, you might be interested in esteve/ros2_objc (Discourse announcement here), which is an Obj-C client library for ROS 2. Using ROS 2 is probably a good idea with mobile devices anyway, due to the fact that they typically use (lossy) wireless networks. Note that I don't know what the status is of ros2_objc, you'd have to ask Esteve.

There have been some efforts in the past to implement Obj-C native client libraries, such as younata/rosobjc and a Obj-C rosbridge client wesgood/RBManager. But afaik those projects are abandoned or no longer compatible.

edit flag offensive delete link more

answered 2018-02-06 12:47:37 -0500

Wes G gravatar image

Hello! This might be an older question but since the previous answer references the library I wrote (RBSManager) I thought I would provide some additional info.

So far in my research using an external ROS Master with ROSBridge seems to be the most effective way for the two to communicate, but this could change with the development of ROS2, which will hopefully support Mac OS. How that will work on iOS I'm not sure about. For building a tablet control panel, for example, ROSBridge would work great (I've built something like that before).

If all you'd like to do is public messages to a specific topic running on a separate master, my library is more than capable of doing that. You would need to define the messages you want and set up a publisher on the specific topic. The demo app in the project repo uses turtlesim to demonstrate everything (like using a publisher, subscriber and service call).

Good luck!

edit flag offensive delete link more


but this could change with the development of ROS2

Esteve has done some work already in that direction: esteve/ros2_ios_examples and esteve/ros2_objc.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-06 13:01:45 -0500 )edit
gvdhoorn gravatar image gvdhoorn  ( 2018-02-06 13:03:25 -0500 )edit

Hey that's interesting, thanks for pointing those out. I'll have to see what it can do a little later.

Wes G gravatar image Wes G  ( 2018-02-06 13:05:50 -0500 )edit

Question Tools

1 follower


Asked: 2017-10-25 00:12:23 -0500

Seen: 4,188 times

Last updated: Feb 06 '18