]> git.rmz.io Git - dotfiles.git/blobdiff - zsh/functions/rosinit
nvim: add FPP copyright snippet
[dotfiles.git] / zsh / functions / rosinit
index 4b297d818a846d6c73d5d19905c5bd01a16e6362..5924b3b4b6c3c885fe1dbb7f3e778486fce3f885 100644 (file)
@@ -3,21 +3,25 @@
 function rosinit() {
     local WORKSPACE=~/src/ros
     local -a ROS_DISTROS
 function rosinit() {
     local WORKSPACE=~/src/ros
     local -a ROS_DISTROS
-    ROS_DISTROS=("hydro" "indigo")
+    ROS_DISTROS=("hydro" "indigo" "jade")
 
 
-    local ROS_DISTRO=$1
-    if [[ -z "$ROS_DISTRO" ]]; then
+    local distro=$1
+    if [[ -z "$distro" ]]; then
         for d in "${ROS_DISTROS[@]}"; do
         for d in "${ROS_DISTROS[@]}"; do
-            [[ -f "/opt/ros/$d/setup.zsh" ]] && ROS_DISTRO=$d
+            [[ -f "/opt/ros/$d/setup.zsh" ]] && distro=$d
         done
     fi
         done
     fi
-    if [[ -f "/opt/ros/$ROS_DISTRO/setup.zsh" ]]; then
+    if [[ -f "/opt/ros/$distro/setup.zsh" ]]; then
+        export ROS_DISTRO=$distro
         export ROS_OS_OVERRIDE=arch
         source /opt/ros/$ROS_DISTRO/setup.zsh
         source $WORKSPACE/devel/setup.zsh
         export ROS_WORKSPACE=$WORKSPACE
         export ROS_OS_OVERRIDE=arch
         source /opt/ros/$ROS_DISTRO/setup.zsh
         source $WORKSPACE/devel/setup.zsh
         export ROS_WORKSPACE=$WORKSPACE
+        export ROS_HOME=$XDG_CACHE_HOME/ros
+        export ROS_LOG_DIR=$XDG_CACHE_HOME/ros/log
+        # export ROS_TEST_RESULTS_DIR=$HOME/.ros
         roscd
     else
         roscd
     else
-        echo "ROS $ROS_DISTRO doesn't seem to be installed." >&2
+        echo "ROS $distro doesn't seem to be installed." >&2
     fi
 }
     fi
 }