#!/bin/zsh function rosinit() { local WORKSPACE=~/src/ros local -a ROS_DISTROS ROS_DISTROS=("hydro" "indigo") local ROS_DISTRO=$1 if [[ -z "$ROS_DISTRO" ]]; then for d in "${ROS_DISTROS[@]}"; do [[ -f "/opt/ros/$d/setup.zsh" ]] && ROS_DISTRO=$d done fi if [[ -f "/opt/ros/$ROS_DISTRO/setup.zsh" ]]; then export ROS_OS_OVERRIDE=arch source /opt/ros/$ROS_DISTRO/setup.zsh source $WORKSPACE/devel/setup.zsh export ROS_WORKSPACE=$WORKSPACE roscd else echo "ROS $ROS_DISTRO doesn't seem to be installed." >&2 fi }