diff --git a/jsk_tools/test/sh/rossetip.sh b/jsk_tools/test/sh/rossetip.sh index 0bf57ced9..c7a34b2ef 100755 --- a/jsk_tools/test/sh/rossetip.sh +++ b/jsk_tools/test/sh/rossetip.sh @@ -1,7 +1,12 @@ #!/bin/bash -_THIS_DIR=$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd) -source $_THIS_DIR/../../env-hooks/99.jsk_tools.bash +JSK_TOOLS_PATH=$(rospack find jsk_tools) +if [ "$JSK_TOOLS_PATH" = "/opt/ros/${ROS_DISTRO}/share/jsk_tools" ]; then + source /opt/ros/${ROS_DISTRO}/setup.bash +else + source `catkin locate --shell-verbs` + cd $(rospack find jsk_tools) && source $(catkin locate)/devel/etc/catkin/profile.d/99.jsk-tools.sh +fi ECHO_OUTPUT="$1" ip() { diff --git a/jsk_tools/test/sh/rossetmaster.sh b/jsk_tools/test/sh/rossetmaster.sh index e159275de..6823d910d 100755 --- a/jsk_tools/test/sh/rossetmaster.sh +++ b/jsk_tools/test/sh/rossetmaster.sh @@ -1,7 +1,12 @@ #!/bin/bash -_THIS_DIR=$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd) -source $_THIS_DIR/../../env-hooks/99.jsk_tools.bash +JSK_TOOLS_PATH=$(rospack find jsk_tools) +if [ "$JSK_TOOLS_PATH" = "/opt/ros/${ROS_DISTRO}/share/jsk_tools" ]; then + source /opt/ros/${ROS_DISTRO}/setup.bash +else + source `catkin locate --shell-verbs` + cd $(rospack find jsk_tools) && source $(catkin locate)/devel/etc/catkin/profile.d/99.jsk-tools.sh +fi rossetmaster "$1" "${2-11311}" > /dev/null 2>&1 echo $ROS_MASTER_URI