Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unification and simplification #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 17 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,36 @@ The scripts here assume that you have an account on github (which is free at git

You will need "git" installed on your machine to use these scripts. If "git" is not already
installed on your machine, it can be installed with:
`sudo apt-get --yes --force-yes install git`
> `sudo apt-get --yes --force-yes install git`

---

### Getting the scripts and making them executable
To run these scripts, clone learning_ros_setup_scripts anywhere on your computer by typing the following in any directory:
`git clone https://github.com/wsnewman/learning_ros_setup_scripts.git`
> `git clone https://github.com/wsnewman/learning_ros_setup_scripts.git`

Once you have the files, change the directory to `learning_ros_setup_scripts` by typing:
`cd learning_ros_setup_scripts`
> `cd learning_ros_setup_scripts`

After this, make the scripts executable by typing:
`chmod +x *.sh`
> `chmod +x *.sh`

### ROS Setup
For ROS Melodic use this line: (System needs to be 18.04)
`./install_ros_and_tools_melodic.sh`
(or `bash install_ros_and_tools_melodic.sh`)

For other versions of install script, please refer to the respective folders for the install scripts.
Install ROS and other useful tools
> `./install_ros_and_tools.sh`
>
> or
>
> `bash install_ros_and_tools.sh`

### Workstation Setup
To setup your ROS workspace for ROS Melodic, use the `setup_workspace_learning_ros_melodic.sh` script. You will need to pass your
To setup your ROS workspace, use the `setup_workspace_learning_ros.sh` script. You will need to pass your
github username and email as arguments to the script:
`./setup_workspace_learning_ros_melodic.sh github_username [email protected]`
(or `bash setup_workspace_learning_ros_melodic.sh github_username [email protected]`)
> `./setup_workspace_learning_ros.sh github_username [email protected]`
>
> or
>
> `bash setup_workspace_learning_ros.sh github_username [email protected]`

where github_username is your username on github, and [email protected] is your e-mail address associated with your
github account.

### Setting up STDR simulation for ROS Noetic

First install qt4 and make it default
```
sudo add-apt-repository ppa:rock-core/qt4
sudo apt-get update
sudo apt-get install libqtcore4 qt4-qmake libqt4-dev
export QT_SELECT=4
```
make sure it is the active environment by running
```qtchooser -print-env```
then install the map_server
```sudo apt install ros-noetic-map-server```
Then clone and compile the stdr_simulator package
```
cd ~/ros_ws/src
git clone https://github.com/stdr-simulator-ros-pkg/stdr_simulator.git
cd ..
rosdep install --from-paths src --ignore-src --rosdistro noetic
catkin_make -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4
```
48 changes: 0 additions & 48 deletions indigo/setup_workspace_learning_ros_indigo.sh

This file was deleted.

59 changes: 59 additions & 0 deletions install_ros_and_tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/env bash

# Figure out what Ubuntu this is to get the correct ROS
source /etc/os-release

if [[ $ID != "ubuntu" ]]; then
echo "This script only works for Ubuntu."
exit
elif [[ -z $UBUNTU_CODENAME ]]; then
echo "It appears that there is an problem identifying which Ubuntu this is."
exit
elif [[ $UBUNTU_CODENAME == "focal" ]]; then
ROS_VERS="noetic"
elif [[ $UBUNTU_CODENAME == "bionic" ]]; then
ROS_VERS="melodic"
elif [[ $UBUNTU_CODENAME == "xenial" ]]; then
ROS_VERS="kinetic"
elif [[ $UBUNTU_CODENAME == "trusty" ]]; then
ROS_VERS="indigo"
else
echo "$PRETTY_NAME is currently unsupported"
exit
fi

scripts/install_ros_and_tools_$ROS_VERS.sh $@

source /opt/ros/$ver/setup.bash
echo "source /opt/ros/$ver/setup.bash" >> ~/.bashrc
rosdep update

mkdir -p $CONFIG_WS/src
cd $CONFIG_WS/src

# Get Baxter and STDR repositories
if [[ $ROS_VERS == "noetic" ]]; then
git clone -b noetic_devel https://github.com/cwru-eecs-275/stdr_simulator.git
git clone -b noetic_devel https://github.com/cwru-eecs-275/baxter_simulator.git
git clone -b noetic_devel https://github.com/cwru-eecs-275/baxter_interface.git
git clone -b noetic_devel https://github.com/cwru-eecs-275/baxter_tools.git
elif [[$ROS_VERS == 'melodic' ]]; then
git clone -b melodic_devel https://github.com/cwru-eecs-275/stdr_simulator.git
git clone https://github.com/EmaroLab/baxter_simulator.git
git clone https://github.com/cwru-eecs-275/baxter_interface.git
git clone https://github.com/cwru-eecs-275/baxter_tools.git
else
sudo apt-get install -y ros-$ver-stdr-simulator
git clone https://github.com/RethinkRobotics/baxter_simulator.git
git clone https://github.com/RethinkRobotics/baxter_interface.git
git clone https://github.com/RethinkRobotics/baxter_tools.git
fi
git clone https://github.com/RethinkRobotics/baxter_common.git


# Ensure that all dependencies are installed (at least the declared ones).
rosdep install --from-paths src --ignore-src -r -y

cd $CONFIG_WS
catkin_make
sudo -- /bin/bash -c "source /opt/ros/$ver/setup.bash; catkin_make -DCMAKE_INSTALL_PREFIX=/opt/ros/$ver install" >/dev/null
54 changes: 0 additions & 54 deletions kinetic/setup_workspace_learning_ros_kinetic.sh

This file was deleted.

56 changes: 0 additions & 56 deletions melodic/setup_workspace_learning_ros_melodic.sh

This file was deleted.

1 change: 0 additions & 1 deletion rosdep.sh

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
97 changes: 97 additions & 0 deletions setup_workspace_learning_ros.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#!/usr/bin/env bash
# Learning ROS - Workspace setup script
# v 0.50
# Wyatt Newman and Luc Bettaieb
# Updated by Frank (Chude Qian)
# Updated by Greg Lee

function main(){
ros_config

echo "Setting up workspace."

USERNAME=$1
EMAIL=$2

ROS_WS="~/ros_ws"

if [ "$USERNAME" != "" ] || [ "$EMAIL" != "" ];
then
# Setup up GIT globally for the user
git config --global user.name "$USERNAME"
git config --global user.email "$EMAIL"

source /opt/ros/$ver/setup.bash
echo "source /opt/ros/$ver/setup.bash" >> ~/.bashrc
rosdep update

mkdir -p $ROS_WS/src
cd $ROS_WS/src

# Get Learning ROS repositories
if [[ $ROS_VERS == "noetic" ]]; then
git clone -b noetic_devel https://github.com/wsnewman/learning_ros.git
elif [[$ROS_VERS == 'melodic' ]]; then
git clone -b melodic_devel https://github.com/wsnewman/learning_ros.git
else
git clone -melodic_devel https://github.com/wsnewman/learning_ros.git
fi

git clone https://github.com/wsnewman/learning_ros_external_packages.git

# Ensure that all dependencies are installed (at least the declared ones).
rosdep install --from-paths src --ignore-src -r -y

cd $ROS_WS
catkin_make

# Make cs_create_pkg work always
mkdir ~/bin
cp $ROS_WS/src/learning_ros_external_packages/cs_create_pkg.py ~/bin
echo "alias cs_create_pkg='~/bin/cs_create_pkg.py'" >> ~/.bashrc
# This is only used in two places in the Learning ROS packages and that code can be updated to ros::getPath().
echo "export ROS_WORKSPACE='$ROS_WS'" >> ~/.bashrc

else
echo "USAGE: ./setup_workspace_learning_ros your_github_username [email protected]"

fi

echo "[!!!] NB: You must still manually add your ROS_IP to your ~/.bashrc. Do this by checking your IP with hostname -I or ifconfig and then adding export ROS_IP='x.x.x.x' to your ~/.bashrc."
}

function ros_config() {
# Setup ROS
if [ ${#ROS_PACKAGE_PATH} -lt 1 ]; then
ROS_VERS=($(ls /opt/ros))
if [ ${#ROS_VERS[@]} -gt 1 ]
then
# Should remove unsupported versions from the choice
select ver in ${ROS_VERS[@]}; do break; done
source /opt/ros/$ver/setup.bash
elif [ ${#ROS_VERS[@]} -eq 0 ]
then
if [ -d /opt/ros ]
then
echo "The ROS installation is corrupted."
else
echo "ROS has not been installed."
fi
exit
else
ver=$ROS_VERS
source /opt/ros/$ver/setup.bash
fi

if [ ${#ROS_PACKAGE_PATH} -lt 1 ]
then
echo "ROS $ver appears misconfigured. It may not be installed or there may be another issue."
exit
fi
else
ver=$ROS_DISTRO
fi
}


main
Loading