Skip to content

Instantly share code, notes, and snippets.

@danidask
Last active September 26, 2022 08:28
Show Gist options
  • Select an option

  • Save danidask/4ac330977444b6c0edcbd99a3991cb83 to your computer and use it in GitHub Desktop.

Select an option

Save danidask/4ac330977444b6c0edcbd99a3991cb83 to your computer and use it in GitHub Desktop.

Revisions

  1. danidask revised this gist Aug 24, 2021. 1 changed file with 18 additions and 10 deletions.
    28 changes: 18 additions & 10 deletions ros2_foxy.sh
    Original file line number Diff line number Diff line change
    @@ -15,34 +15,42 @@ fi

    # https://index.ros.org/doc/ros2/Installation/Foxy/Linux-Install-Debians/
    cd ~
    sudo apt update
    sudo apt upgrade -y
    sudo apt install -y locales
    sudo apt-get update
    sudo apt-get upgrade -y
    sudo apt-get install -y locales
    sudo locale-gen en_US en_US.UTF-8
    sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
    export LANG=en_US.UTF-8
    # locale # verify settings
    sudo apt install -y curl gnupg2 lsb-release
    sudo apt-get install -y \
    curl \
    gnupg2 \
    lsb-release
    curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
    sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
    sudo apt update
    sudo apt-get update

    if [ "$VERSION" = "1" ]; then
    sudo apt install -y ros-foxy-desktop
    sudo apt-get install -y ros-foxy-desktop
    else
    sudo apt install -y ros-foxy-ros-base
    sudo apt-get install -y ros-foxy-ros-base
    fi

    # Add source
    source /opt/ros/foxy/setup.bash
    echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc

    sudo apt install -y python3-colcon-common-extensions python3-argcomplete build-essential
    sudo apt-get install -y \
    cmake \
    build-essential \
    python3-pip \
    python3-colcon-common-extensions \
    python3-argcomplete \
    python3-rosdep \
    python3-setuptools \

    # Add colcon_cd to your shell startup script
    source /usr/share/colcon_cd/function/colcon_cd.sh
    export _colcon_cd_root=~/ros2_install
    echo "source /usr/share/colcon_cd/function/colcon_cd.sh" >> ~/.bashrc
    echo "export _colcon_cd_root=~/ros2_install" >> ~/.bashrc


  2. danidask revised this gist Jan 1, 2021. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions ros2_foxy.sh
    Original file line number Diff line number Diff line change
    @@ -38,3 +38,11 @@ source /opt/ros/foxy/setup.bash
    echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc

    sudo apt install -y python3-colcon-common-extensions python3-argcomplete build-essential

    # Add colcon_cd to your shell startup script
    source /usr/share/colcon_cd/function/colcon_cd.sh
    export _colcon_cd_root=~/ros2_install
    echo "source /usr/share/colcon_cd/function/colcon_cd.sh" >> ~/.bashrc
    echo "export _colcon_cd_root=~/ros2_install" >> ~/.bashrc


  3. danidask revised this gist Jan 1, 2021. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions ros2_foxy.sh
    Original file line number Diff line number Diff line change
    @@ -37,6 +37,4 @@ fi
    source /opt/ros/foxy/setup.bash
    echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc

    # Install argcomplete (optional)
    sudo apt install -y python3-pip
    pip3 install -U argcomplete
    sudo apt install -y python3-colcon-common-extensions python3-argcomplete build-essential
  4. danidask revised this gist Jan 1, 2021. 1 changed file with 7 additions and 9 deletions.
    16 changes: 7 additions & 9 deletions ros2_foxy.sh
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,16 @@
    #!/bin/bash

    # wget https://gist.github.com/danidask/4ac330977444b6c0edcbd99a3991cb83/raw -O - | bash
    # wget -O - https://gist.github.com/danidask/4ac330977444b6c0edcbd99a3991cb83/raw | bash

    set -e

    echo 'Choose version:'
    echo '1 - Desktop (Recommended): ROS, RViz, demos, tutorials.'
    echo '2 - Base (Bare Bones): No GUI tools.'
    read VERSION
    if [ $VERSION != "1" ] && [ $VERSION != "2" ];
    then
    echo 'Only 1 or 2 are allowed, not '$VERSION
    exit 1
    if [ "$VERSION" != "1" ] && [ "$VERSION" != "2" ]; then
    echo 'Only 1 or 2 are allowed, not '$VERSION
    exit 1
    fi

    # https://index.ros.org/doc/ros2/Installation/Foxy/Linux-Install-Debians/
    @@ -28,11 +27,10 @@ curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo ap
    sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
    sudo apt update

    if [ $VERSION = "1" ];
    then
    sudo apt install -y ros-foxy-desktop
    if [ "$VERSION" = "1" ]; then
    sudo apt install -y ros-foxy-desktop
    else
    sudo apt install -y ros-foxy-ros-base
    sudo apt install -y ros-foxy-ros-base
    fi

    # Add source
  5. danidask revised this gist Jan 1, 2021. 1 changed file with 41 additions and 2 deletions.
    43 changes: 41 additions & 2 deletions ros2_foxy.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,44 @@
    #!/bin/bash

    # WIP
    # wget https://gist.github.com/danidask/4ac330977444b6c0edcbd99a3991cb83/raw -O - | bash

    echo "hola"
    set -e

    echo 'Choose version:'
    echo '1 - Desktop (Recommended): ROS, RViz, demos, tutorials.'
    echo '2 - Base (Bare Bones): No GUI tools.'
    read VERSION
    if [ $VERSION != "1" ] && [ $VERSION != "2" ];
    then
    echo 'Only 1 or 2 are allowed, not '$VERSION
    exit 1
    fi

    # https://index.ros.org/doc/ros2/Installation/Foxy/Linux-Install-Debians/
    cd ~
    sudo apt update
    sudo apt upgrade -y
    sudo apt install -y locales
    sudo locale-gen en_US en_US.UTF-8
    sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
    export LANG=en_US.UTF-8
    # locale # verify settings
    sudo apt install -y curl gnupg2 lsb-release
    curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
    sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
    sudo apt update

    if [ $VERSION = "1" ];
    then
    sudo apt install -y ros-foxy-desktop
    else
    sudo apt install -y ros-foxy-ros-base
    fi

    # Add source
    source /opt/ros/foxy/setup.bash
    echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc

    # Install argcomplete (optional)
    sudo apt install -y python3-pip
    pip3 install -U argcomplete
  6. danidask revised this gist Jan 1, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions ros2_foxy.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    #!/bin/bash

    # WIP

    echo "hola"
  7. danidask created this gist Jan 1, 2021.
    3 changes: 3 additions & 0 deletions ros2_foxy.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    # WIP

    echo "hola"