Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jsk_topic_tools] Add passthrough_nodelet documentation #1657

Merged
merged 3 commits into from
Dec 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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. Duration 0 means infinite relay.

## Parameters

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

Duration [s] to relay the topic. Duration 0 means infinite relay.

## 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>