[Discourse.ros.org] [ROS Projects] [Experimental] UDP Broadcast transport layer

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Discourse.ros.org] [ROS Projects] [Experimental] UDP Broadcast transport layer

Dirk Thomas via ros-users


Hi all,

I made a proof of concept, meaning still experimental, of the **UDP Broadcast transport layer** and how it could work.

The final aim is to make a multimaster implementation with UDP Broadcast to avoid WiFi struggle.

I would like some advice of what is wrong and how to improve.

**Architecture:**

1. Topic negotiation -  Both the Subscriber/Publisher uses a TCP service to get the publishing port from the `organizer.py`
2. Publisher serialize the packets into a Msg message then broadcast the packets to the port given by the organizer.
3. The subscriber binds to the port, deserialize packets and either send it to the callback or publish it on the local master

**Known limitations:**

* Not secure (publisher ip not checked, not crypted)
* 64k maximum packet size (from IP protocol), tested only for non fragmented packets of less than 1k
* ROS Indigo
* Python 2.7

**Usage:**

```bash
roscore &
rosrun multimaster_udp organizer.py

# in another terminal
rosrun multimaster_udp smallest_subscriber_udp.py
# in another terminal
rosrun multimaster_udp smallest_publisher_udp.py
```

***UDP Subscriber:***
```python
#!/usr/bin/env python
import rospy

from multimaster_udp.transport import UDPSubscriber
from std_msgs.msg import String

def callback(data, topic):
    global counter
    counter += 1
    print data, "\n received",counter, "UDP messages from \n", topic

def main():
    global counter
    counter = 0
    rospy.init_node("smallest_subscriber_udp")
    # if the callback is not defined (None), it will publish locally
    # to the equivalent topic.
    sub = UDPSubscriber("hello", String, callback=None)
    rospy.spin()

if __name__ == '__main__':
    main()
```

***UDP Broadcast Publisher***
```
#!/usr/bin/env python
import rospy

from multimaster_udp.transport import UDPPublisher
from std_msgs.msg import String

def main():
    rospy.init_node("smallest_broadcast_publisher_udp")

    msg = String("World")
    pub = UDPPublisher("hello", String)

    rate = rospy.Rate(100)
    while not rospy.is_shutdown():
        pub.publish(msg)
        rate.sleep()

if __name__ == '__main__':
    main()
```





---
[Visit Topic](https://discourse.ros.org/t/experimental-udp-broadcast-transport-layer/2226/1) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Discourse.ros.org] [ROS Projects] [Experimental] UDP Broadcast transport layer

Dirk Thomas via ros-users


This is pretty cool stuff, and I like your goal of moving towards multi-master. How does it relate to [UDPROS](http://wiki.ros.org/ROS/UDPROS)?





---
[Visit Topic](https://discourse.ros.org/t/experimental-udp-broadcast-transport-layer/2226/2) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Discourse.ros.org] [ROS Projects] [Experimental] UDP Broadcast transport layer

Dirk Thomas via ros-users
In reply to this post by Dirk Thomas via ros-users


It does not relate to UDPROS at all... :confused:

This is mainly a proof of concept to broadcast messages on IP layer instead of the Application layer. This avoid to struggle network on massive multi-robot environnement.





---
[Visit Topic](https://discourse.ros.org/t/experimental-udp-broadcast-transport-layer/2226/3) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Discourse.ros.org] [ROS Projects] [Experimental] UDP Broadcast transport layer

Dirk Thomas via ros-users
In reply to this post by Dirk Thomas via ros-users


[quote="AlexisTM, post:3, topic:2226"]
It does not relate to UDPROS at all :confused:
[/quote]

Then in what ways would you say they currently differ? Does UDPROS not yet support UDP _broadcasting_? For example, does the xmlrpc negotiation of transport layer for UDPROS not currently enable UDP broadcasting when more than one subscribers connect to the same port for the same topic for the same publisher?





---
[Visit Topic](https://discourse.ros.org/t/experimental-udp-broadcast-transport-layer/2226/4) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Discourse.ros.org] [ROS Projects] [Experimental] UDP Broadcast transport layer

Dirk Thomas via ros-users
In reply to this post by Dirk Thomas via ros-users


UDPROS is unicast only:

http://wiki.ros.org/ROS/UDPROS





---
[Visit Topic](https://discourse.ros.org/t/experimental-udp-broadcast-transport-layer/2226/5) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Discourse.ros.org] [ROS Projects] [Experimental] UDP Broadcast transport layer

Dirk Thomas via ros-users
In reply to this post by Dirk Thomas via ros-users


Badly, UDPROS is unicast only. While it reduces the overhead over TCP, due to the unreliable connection, it can be improved to forward general information to a lot of robots. For 50 robots over the WiFi, while UDPROS will send 50 packets, it is possible to send only one broadcasted packet.

Again, this is only a proof of concept, to have a basic communication running. On this base, we can think about the problems encountered and how to tackle them and finally implement it inside ros_comm, for C++ and Python.





---
[Visit Topic](https://discourse.ros.org/t/experimental-udp-broadcast-transport-layer/2226/6) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Discourse.ros.org] [ROS Projects] [Experimental] UDP Broadcast transport layer

Dirk Thomas via ros-users
In reply to this post by Dirk Thomas via ros-users


@AlexisTM: you probably already found it, but just in case: [wiki/ethzasl_message_transport: UDP Multicasting](http://wiki.ros.org/ethzasl_message_transport#UDP_Multicasting).

Old, but trying to address the same limitations, I believe.





---
[Visit Topic](https://discourse.ros.org/t/experimental-udp-broadcast-transport-layer/2226/7) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Loading...