Skip to content

Instantly share code, notes, and snippets.

@garaemon
Created January 26, 2015 18:00
Show Gist options
  • Select an option

  • Save garaemon/90b4d98b42c59b42ded4 to your computer and use it in GitHub Desktop.

Select an option

Save garaemon/90b4d98b42c59b42ded4 to your computer and use it in GitHub Desktop.
ROS + percol integration
function rosn() {
if [ "$1" = "" ]; then
topic=$(rosnode list | percol | xargs -n 1 rosnode info | percol | sed -e 's%.* \* \(/[/a-zA-Z0-9_]*\) .*%\1%')
else
topic=$(rosnode info $1 | percol | sed -e 's%.* \* \(/[/a-zA-Z0-9_]*\) .*%\1%')
fi
if [ "$topic" != "" ] ; then
rost $topic
fi
}
function rost() {
if [ "$1" = "" ]; then
node=$(rostopic list | percol | xargs -n 1 rostopic info | percol | sed -e 's%.* \* \(/[/a-zA-Z0-9_]*\) .*%\1%')
else
node=$(rostopic info $1 | percol | sed -e 's%.* \* \(/[/a-zA-Z0-9_]*\) .*%\1%')
fi
if [ "$node" != "" ] ; then
rosn $node
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment