Skip to content

Commit

Permalink
nimbro_topic_transport: updated example launch files, fixes #3
Browse files Browse the repository at this point in the history
  • Loading branch information
xqms committed Mar 28, 2017
1 parent 3ca2b55 commit 55f477b
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 37 deletions.
9 changes: 6 additions & 3 deletions nimbro_topic_transport/doc/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ roscores, and we will transport some topics from machineA to machineB.
On machineA:

```bash
roslaunch nimbro_topic_transport udp_sender.launch target:=machineB
roslaunch nimbro_topic_transport sender.launch target:=machineB
rostopic pub -r 1.0 /my_first_topic std_msgs/String "Hello World"
```

Expand All @@ -18,9 +18,12 @@ On machineB:

```bash
roslaunch nimbro_topic_transport udp_receiver.launch
rostopic echo /my_first_topic
rostopic echo /recv/my_first_topic
```

You should see the `Hello World` messages arriving.
You should see the `Hello World` messages arriving. Note that the topics
are remapped to a /recv/ prefix, since the topics would conflict if you were
to run both sender and receiver on the same roscore. In an usual application,
this would not be necessary.

For customization, you should copy the launch files into your own package.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<launch>
<!--
This launch file runs a udp_receiver node, which receives topics
This launch file runs a receiver node, which receives topics
over the network on port 17001 and publishes them on the local roscore.
See udp_sender.launch for the sender part.
-->

<node name="udp_receiver" pkg="nimbro_topic_transport" type="udp_receiver" output="screen">
<node name="receiver" pkg="nimbro_topic_transport" type="receiver" output="screen">
<!-- The port to receive packets on -->
<param name="port" value="17001" />

Expand All @@ -15,5 +15,6 @@
-->
<remap from="/my_first_topic" to="/recv/my_first_topic" />
<remap from="/my_second_topic" to="/recv/my_second_topic" />
<remap from="/tcp_topic" to="/recv/tcp_topic" />
</node>
</launch>
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?xml version="1" ?>
<launch>
<!--
This launch file runs a udp_sender node, which sends topics from the local
This launch file runs a sender node, which sends topics from the local
roscore over the network on port 17001.
By default, this launch file sends topics to your local machine for
testing purposes. If you want to send to another machine, use
roslaunch nimbro_topic_transport udp_sender.launch target:=other_host
roslaunch nimbro_topic_transport sender.launch target:=other_host
where other_host can be a host name or IP address.
See udp_receiver.launch for the receiving part.
Expand All @@ -14,11 +15,11 @@
<arg name="target" default="localhost" />

<!-- The UDP sender node -->
<node name="udp_sender" pkg="nimbro_topic_transport" type="udp_sender" output="screen">
<node name="sender" pkg="nimbro_topic_transport" type="sender" output="screen">

<!-- The destination host name or IP address -->
<param name="destination_addr" value="$(arg target)" />
<param name="destination_port" value="17001" />
<param name="port" value="17001" />

<!-- Load the list of topics from a YAML file -->
<rosparam command="load" file="$(find nimbro_topic_transport)/launch/topics.yaml" />
Expand Down
11 changes: 0 additions & 11 deletions nimbro_topic_transport/launch/tcp_receiver.launch

This file was deleted.

14 changes: 0 additions & 14 deletions nimbro_topic_transport/launch/tcp_sender.launch

This file was deleted.

9 changes: 6 additions & 3 deletions nimbro_topic_transport/launch/topics.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
topics:
udp_topics:
- name: "/my_first_topic"
compress: true # enable bz2 compression
rate: 1.0 # rate limit at 1Hz
compress: true # enable zstd compression
rate: 2.0 # rate limit at 1Hz
- name: "/my_second_topic"

tcp_topics:
- name: "/tcp_topic"

0 comments on commit 55f477b

Please sign in to comment.