[ros-users] rosbash tool share

Stuart Glaser sglaser at willowgarage.com
Fri Mar 11 21:39:25 UTC 2011


Here's a couple of shortcuts that I use:

For quickly finding topics:

alias gtopic='rostopic list | sort -u | grep'


A couple of image_view shortcuts:

imview () { rosrun image_view image_view image:=$1 }
dispview () { rosrun image_view disparity_view image:=$1 }




So I can easily source the same setup.bash when I open new terminals:


abspath()  # Doesn't follow symlinks
{
    echo $(cd $(dirname $1); pwd)/$(basename $1)
}
# Sets a persistant source target
#function
rs() {
  STORAGE=$HOME/.ros_default_source

  if [ -z "$1" ]; then
    if [ ! -e $STORAGE ]; then
      echo "No .rd"
    else
      PREVIOUS=$(cat $STORAGE)

      echo "Sourcing $PREVIOUS"
      source $PREVIOUS
    fi

  else
    RESOLVED=`abspath $1`
    echo "Sourcing $RESOLVED"
    source $RESOLVED

    echo "Saving new source default: $RESOLVED"
    echo "$RESOLVED" > $STORAGE
  fi
}


And finally, my personal favorites (non-ROS):

alias up='cd ..'
alias upp='cd ../..'
alias uppp='cd ../../..'
alias upppp='cd ../../../..'


-- 
Stuart Glaser
sglaser -at- willowgarage -dot- com
www.willowgarage.com



More information about the ros-users mailing list