ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to change the ROS_DISTRO variable?

asked 2017-10-20 11:50:57 -0500

pacifickid9 gravatar image

updated 2017-10-21 11:28:36 -0500

I had hydro installed on my raspberry pi earlier, then i removed it to install kinetic, everything seemed to be fine except the ROS_DISTRO variable. I tried the .bashrc rile there was no mention of hydro so i tried logging in and out but still no luck i also tried the export ROS_DISTRO command that didnt work either. sorry if this is a easy answer im new to ros. any help you could give would be awesome!

Thanks for you reply, I looked through the .bashrc and the only thing there is source /opt/ros/kinetic/setup.bash line.

`# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
case $- in
    *i*) ;;
      *) return;;
esac

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar

# make less more friendly for non-text input files, see lesspipe(1)
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
    # We have color support; assume it's compliant with Ecma-48
    # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
    # a case would tend to support setf rather than setaf.)
    color_prompt=yes
    else
    color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \$\[\033[00m\] '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

# colored GCC warnings and errors ...
(more)
edit retag flag offensive close merge delete

Comments

Did you copy-paste your .bashrc twice?

gvdhoorn gravatar image gvdhoorn  ( 2017-10-21 02:25:21 -0500 )edit

yes i think i did. just fixed it!

pacifickid9 gravatar image pacifickid9  ( 2017-10-21 11:27:17 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-10-20 13:57:36 -0500

gvdhoorn gravatar image

updated 2017-10-21 02:29:14 -0500

It's essentially just an environment variable, so an export ROS_DISTRO=... should work.

But: you shouldn't (need to) change it, as it's automatically set by the setup.bash scripts that are in the root of the ROS install directory.

It would be best if you can try to find out why that variable is being set (ie: by which file).

Looking through your .bashrc is indeed a good idea. Check for lines starting with source /opt/... or source /some/path/in/hour/home_dir. It could also be that you have a line already that sets the variable. Look for export ROS_DISTRO=....

Whatever you do, it's infinitely better to figure out where that variable is getting set than to try and change its value manually.


I had hydro installed on my raspberry pi earlier, then i removed it to install kinetic, everything seemed to be fine except the ROS_DISTRO variable.

Just to make sure:

  • what OS is this (Debian?)
  • you "had hydro" before, now Kinetic: Hydro and Kinetic do not have overlapping install targets: did you upgrade your OS for that?
  • how did you install ROS? Seeing as you have a RPi: from sources? Or .debs?
edit flag offensive delete link more

Comments

cat /etc/os-release gave me VERSION="8 (jessie)" and ID_LIKE=debian so im not sure which im running. maybe that is my problem. and i followed the process in this tutorial to install kinetic: http://wiki.ros.org/ROSberryPi/Instal...

pacifickid9 gravatar image pacifickid9  ( 2017-10-21 11:37:03 -0500 )edit

and i used this tutorial to install hydro http://wiki.ros.org/ROSberryPi/Settin... does this help at all? i dont believe that i upgraded any OS

pacifickid9 gravatar image pacifickid9  ( 2017-10-21 11:37:24 -0500 )edit

So you build from sources both times? Did you reuse the same catkin_ws for that? And did you build everything in a 'clean' terminal (ie: your Hydro workspace was not sourced)?

gvdhoorn gravatar image gvdhoorn  ( 2017-10-21 12:27:31 -0500 )edit

Can you tell us what the value is of ROS_DISTRO in /opt/ros/kinetic/etc/catkin/profile.d/10.ros.sh?

It's set near the top of the file.

gvdhoorn gravatar image gvdhoorn  ( 2017-10-21 12:30:17 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2017-10-20 11:50:57 -0500

Seen: 4,012 times

Last updated: Oct 21 '17