[Documentation] [TitleIndex] [WordIndex

Setup for Local Computer

One_Computer_Local.png

Necessary Hardware

Install ROS Indigo on Robot Computer

Perform these install steps on the computer responsible for robot control.

1. Some assumptions about your Ubuntu Install

These instructions make the following assumptions about your Ubuntu 14.04LTS install. These are not hard and fast rules, however, the instructions assume these things. When asked during the install you should select the following:

  • username : sibot

  • computer name : SIBOT1

  • password : Welcome00

  • The SSH client and server are installed.
    • If not run the following commands:

sudo apt-get update
sudo apt-get install openssh-client
sudo apt-get install openssh-server

2. Setup your ROS sources.list

Setup your computer to accept software from packages.ros.org. ROS Indigo ONLY supports Saucy (13.10) and Trusty (14.04) for debian packages.

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

3. Set up your ROS keys

sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116

4. ROS Installation

Make sure the Debian package is up to date:

sudo apt-get update
sudo apt-get install ros-indigo-desktop-full

5. Initialize rosdep

sudo rosdep init
rosdep update

6. Getting rosinstall

Rosinstall is a frequently used command-line tool in ROS that is distributed separately. It enables you to easily download many source trees for ROS packages with one command.

sudo apt-get install python-rosinstall

Install required packages

Connected to the internet run the following commands:

1. Install useful Linux utilities

These tools are useful for monitoring system processes, setting up networking, and setting up NTPD for the remote computer. They are not necessary but recommended.

sudo apt-get install iperf chrony htop bridge-utils

2. Install required ROS third party packages for segway_v3_robot

These are the packages that RMP V3 depends on:

sudo apt-get install ros-indigo-navigation ros-indigo-gmapping ros-indigo-robot-localization ros-indigo-yocs-cmd-vel-mux ros-indigo-joy ros-indigo-urg-node ros-indigo-lms1xx ros-indigo-pointgrey-camera-driver ros-indigo-cmake-modules ros-indigo-imu-tools daemontools openssh-server libpcap0.8-dev

3. Add yourself to the dialout group

This is necessary if you have serial, or serial-USB devices:

sudo adduser $USER dialout

Environment setup

Edit the local bash environment to add a few useful aliases:

gedit ~/.bashrc

Add the following lines to the end of the file each provides a few shortcuts:

source /opt/ros/indigo/setup.bash
alias sws='source ./devel/setup.bash'
alias clean_backups='find ./ -name '*~' | xargs rm'
alias clean_pyc='find ./ -name '*.pyc' | xargs rm'
alias clean_rosbuild='rm -rf build devel install'
alias segstop='sudo service segway-core stop'
alias segstart='sudo service segway-core start'
alias segchk='sudo tail /var/log/upstart/segway-core.log -n 30'

Close your terminal and open a new one to make the changes effective

Setup Workspace

Create a work space in your home directory.

mkdir -p ~/segway_ws/src
cd ~/segway_ws/src
catkin_init_workspace
cd ..
catkin_make

Download and install ROS software packages

cd ~/segway_ws/src
git clone https://github.com/StanleyInnovation/segway_v3.git
git clone https://github.com/StanleyInnovation/segway_v3_robot.git
git clone https://github.com/StanleyInnovation/segway_v3_desktop.git
git clone https://github.com/StanleyInnovation/segway_v3_network.git
cd ..
catkin_make

Modify Sudo

This modification allows the user sibot to run start / stop service without entering a password.

sudo visudo

Paste this at the bottom of the file below the "#includedir"

sibot   ALL=(ALL) NOPASSWD: /sbin/start segway-core, /sbin/stop segway-core

Save the file

[CTRL-X]
[Y]
[ENTER]

Setup chrony

  • If you are going to be running ROS nodes on a remote computer it is a good idea to setup chrony to synchronize time between the machines
  • The onboard robot PC should ideally run the server
  • Specific directions for setting up chrony can be found online

Additional Steps

You should probably do these regardless, but these steps are really only required PGR Flea3 camera and onboard PC powered from RMP.

1. Open the grub configuration

sudo gedit /etc/default/grub

2. Add this line

Configures the system to not wait at startup if boot fails

# disable getting stuck in menu after fail
GRUB_RECORDFAIL_TIMEOUT=0

3. Update the USB memory buffer to handle USB3

* Locate this line

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

* Change it to this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore usbfs_memory_mb=1000"

4. Save and exit

5. Update Grub

From the terminal

sudo update-grub
sudo modprobe usbcore usbfs_memory_mb=1000

6. Restart the computer

Joystick setup

Install this lightweight joystick tester and run it if you are planning on driving the system around.

sudo apt-get install jstest-gtk
jstest-gtk

You should get a pop-up window with your joystick information. Go ahead and click on the correct one and verify that it works. Write down the /dev/input/jsX number and enter it in the configuration on the next screen.

Robot Customization

1. Edit the setup configuration

gedit ~/segway_ws/src/segway_v3_robot/segway_bringup/env-hooks/50.segway_config.sh

2. Compile from source

cd ~/segway_ws
catkin_make

3. Future Changes

If you need to go back and change something in the configuration you have two choices. Either modify the destination file which is created during the catkin_make:

gedit ~/segway_ws/devel/etc/catkin/profile.d/50.segway_config.sh
cd ~/segway_ws
sws

OR

You can modify the file in "env-hooks" listed above and the run the following commands:

cd ~/segway_ws
clean_rosbuild
catkin_make
sws

If your un-sure about the value of a particular variable a quick way to check is with the echo command like this:

echo $SEGWAY_JOY_DEV

Network Setup

You need to set the network up for the platform and the various Ethernet enabled sensors. This is an outline and is intended to be a guide.

NOTE: The ROBOT_NETWORK environment variable must match the port you use for #1 below. It is possible to create the network with 1 NIC and some modifications, however, The following directions will assume you have 2 NICs.

1. Network Overview

Default Settings Outside world <--> eth0 (10.66.172.4) <--> ROS <--> eth1 (10.66.171.4) <--> platform (10.66.171.5) port 8080

sudo gedit /etc/network/interfaces

1.1. Set the IP of eth1 to the robot and sensor network

auto eth1
iface eth1 inet static
address 10.66.171.4
netmask 255.255.255.0

1.2. Set the IP of eth0 to the ROS Network

   auto eth0
   iface eth0 inet static
   address 10.66.172.4
   netmask 255.255.255.0

1.3. Make sure you setup the networking for all the sensors

1.4. Save the file and exit

1.5. Restart the computer

sudo shutdown -r now

1.6. Check your settings

ifconfig

Test your setup

NOTE: Power the PC from an external power supply until you have finished testing

1. Manual Launch

cd ~/segway_ws
sws
roslaunch segway_bringup stanley_innovation_system.launch

2. Manual launch works, time to install the service

cd ~/segway_ws
sws
rosrun segway_bringup install_segway_core

3. Start the service and make sure it starts up fine

segstart

segchk

4. Save anything you might have open

5. Power off the RMP

6. Power the PC from the RMP

7. Power on the system

If you want to stop the service and restart it, open a terminal:

segstop
segstart

8. Test Visualization

cd ~/segway_ws
sws
roslaunch segway_viz view_robot.launch

9. Test reconfiguration GUI

sws
rosrun rqt_reconfigure rqt_reconfigure

10. See data

sws
rqt

11. Drive the system around

Done !!!


2024-11-23 13:01