Skip to content

Commit

Permalink
Add passthrough_nodelet documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
708yamaguchi committed Oct 14, 2020
1 parent ef39480 commit 7392d55
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
54 changes: 54 additions & 0 deletions doc/jsk_topic_tools/lib/passthrough_nodelet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Passthrough

`jsk_topic_tools/Passthrough` is a node/nodelet to relay topics only for specified duration. You can use the service call to turn relay on and off. By default, the topic relay is turned off.

## Subscribing Topics

* `~input` (`AnyMsg`)

Incoming topic to be relayed

## Publishing Topics

* `~output` (`AnyMsg`, same type as `~input`)

Outgoing topic to publish on

## Services

* `~request` (`std_srvs/Empty`)

Start topic relay

* `~stop` (`std_srvs/Empty`)

Stop topic relay

* `~request_duration` (`jsk_topic_tools/PassthroughDuration`)

Perform topic relay for a specified duration

## Parameters

* `~default_duration` (`double`, default: `10.0`)

Duration [s] to relay the topic.

## Usage
```
# Terminal 1
$ roslaunch jsk_topic_tools passthrough_sample.launch
# Terminal 2
$ rostopic pub /passthrough_sample/input std_msgs/String "data: 'hello'" -r10
# Terminal 3
$ rostopic echo /passthrough_sample/input
# Terminal 4
$ rostopic echo /passthrough_sample/output
# Terminal 5
$ rosservice call /passthrough_sample/request
$ rosservice call /passthrough_sample/stop
```
14 changes: 14 additions & 0 deletions jsk_topic_tools/launch/passthrough_sample.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<launch>
<arg name="input" default="input" />
<arg name="output" default="output" />
<arg name="default_duration" default="10" />

<node pkg="jsk_topic_tools" name="passthrough_sample" type="passthrough">
<remap from="~input" to="$(arg input)" />
<remap from="~output" to="$(arg output)" />
<rosparam subst_value="true">
default_duration: $(arg default_duration)
</rosparam>
</node>

</launch>

0 comments on commit 7392d55

Please sign in to comment.