Skip to content

Installing our code base on a robot (OUT OF DATE)

Corrie Van Sice edited this page Jan 19, 2021 · 1 revision

This information is out of date. See the repo README file at https://github.com/utexas-bwi/bwi

If ROS has not been installed on the robot you will have to first reference the instruction in the tutorial: Installing our code-base on a machine .

Version 2

Below is a script outline that can be used to install the code base on the version 2 robot.

#!/bin/bash
   
# Choose a name for for workspace directory

DIR=~/segbot_ws

# Add source statement for ROS distribution to your bashrc file
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
source /opt/ros/kinetic/setup.bash

# Create your workspace directory and cd into it

mkdir -p $DIR/src
cd $DIR/src

# Init the workspace and cmake it to ensure it is working properly

catkin_init_workspace
cd $DIR
catkin_make


# Source the setup.bash in your devel folder created by the cmake command and go into src directory

echo "source $DIR/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
source $DIR/devel/setup.bash
cd $DIR

# Create enviroment variable for ROS_DISTRO

echo "export ROS_DISTRO=kinetic" >> ~/.bashrc
source ~/.bashrc

# Pull code base from git into your workspace src directory

wstool init src "https://raw.githubusercontent.com/utexas-bwi/bwi/master/rosinstall/$ROS_DISTRO.rosinstall"

# Ensure all dependicies are installed for the code base

rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y


# Return to the top level of your workspace and run cmake

cd $DIR
source $DIR/devel/setup.bash
catkin_make

cd $DIR

Version 3

The following enviroment variable must be in your bashrc file to utilize the version 3 robot.

export SEGWAY_INTERFACE_ADDRESS=10.66.171.1
export SEGWAY_IP_ADDRESS=10.66.171.5
export SEGWAY_IP_PORT_NUM=8080
export SEGWAY_BASE_PLATFORM=RMP_210
export SEGWAY_PLATFORM_NAME=RMP_210

Below is a script outline that can be used to install the code base on the version 3 robot.

#!/bin/bash

# Choose a name for for workspace directory

DIR=~/segbot_ws


# Add source statement for ROS distribution to your bashrc file

echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
source /opt/ros/kinetic/setup.bash


# Create your workspace directory and cd into it

mkdir -p $DIR/src
cd $DIR/src


# Init the workspace and cmake it to ensure it is working properly`

catkin_init_workspace
cd $DIR
catkin_make

# Source the setup.bash in your devel folder created by the cmake command and go into src directory

echo "source $DIR/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
source $DIR/devel/setup.bash
cd $DIR


# Create environment variable for ROS_DISTRO

echo "export ROS_DISTRO=kinetic" >> ~/.bashrc
source ~/.bashrc


# Add Segbot v3 Environment Variables for Communicating with the Updated Base`


echo "export SEGWAY_INTERFACE_ADDRESS=10.66.171.1" >> ~/.bashrc
echo "export SEGWAY_IP_ADDRESS=10.66.171.5" >> ~/.bashrc
echo "export SEGWAY_IP_PORT_NUM=8080" >> ~/.bashrc
echo "export SEGWAY_BASE_PLATFORM=RMP_210" >> ~/.bashrc
echo "export SEGWAY_PLATFORM_NAME=RMP_210" >> ~/.bashrc
source ~/.bashrc


# Pull code base from git into your workspace src directory

wstool init src `[`https://raw.githubusercontent.com/utexas-bwi/bwi/master/rosinstall/$ROS_DISTRO.rosinstall`](https://raw.githubusercontent.com/utexas-bwi/bwi/master/rosinstall/$ROS_DISTRO.rosinstall)

# Ensure all dependencies are installed for the code base

rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y

# Return to the top level of your workspace and run cmake

cd $DIR
source $DIR/devel/setup.bash
catkin_make

cd $DIR

Version 4

The V4 base uses slightly different values. It's important to export them into your environment after you source the workspace. Add the convenience function sws to the bottom of your .bashrc.

sws() {
  source ~/catkin_ws/devel/setup.bash
  export SEGWAY_INTERFACE_ADDRESS=10.66.171.1
  export SEGWAY_IP_ADDRESS=10.66.171.5
  export SEGWAY_IP_PORT_NUM=8080
  export SEGWAY_BASE_PLATFORM=RMP_110
  export SEGWAY_PLATFORM_NAME=RMP_110
}
sws
Clone this wiki locally