Setup for Remote Computer

One_Computer_Remote.png

First a note about this configuration

In this mode the computer talks directly to the platform and several directions are unique to this configuration including the ip addresses, wireless config, etc.

  • The default platform IP address is: 10.66.171.5

Necessary Hardware

  • RMP system compatible hardware
    • Must have been purchased from Stanley Innovation an original Segway RMP will not work.
  • Computer with Ubuntu 14.04 LTS (Could be a virtual machine)
    • Minimum 8GB RAM (16 GB prefered)
  • Wireless router attached to the platform
  • Logitech F710 Joystick or equivalent

Install ROS Indigo on Robot Computer

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

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

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'

Set up your ROS keys

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

ROS Installation

Make sure the Debian package is up to date:

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

Initialize rosdep

sudo rosdep init
rosdep update

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:

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

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

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.

Open the grub configuration

sudo gedit /etc/default/grub

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

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"

Save and exit

Update Grub

From the terminal

sudo update-grub
sudo modprobe usbcore usbfs_memory_mb=1000

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

Edit the setup configuration

  • To setup your robot configuration edit the 50.segway_config.sh file:

cd ~/segway_ws/src/segway_v3_robot/segway_bringup/env-hooks
gedit 50.segway_config.sh
  • Changing this file after you've complied will have no affect, see the note below.
  • Review the config file carefully, it allows you to set all the variables needed to customize your platform
  • By default it is setup for an RMP 210 V3 with no sensors
  • Make sure to set SEGWAY_POWERS_PC_ONBOARD=false

  • Make sure ROBOT_NETWORK=eth0

  • To change the platform to another model (available models RMP_210, RMP_220, RMP_440LE, RMP_440SE, RMP_OMNI)
    • Edit the variable SEGWAY_BASE_PLATFORM (This is the platform the RMP is based on)

    • Edit the variable SEGWAY_PLATFORM_NAME (This is the name of the custom robot)

    • SEGWAY_BASE_PLATFORM is generally the same as SEGWAY_PLATFORM_NAME; unless you create a custom platform or buy one from Stanley Innovation

  • Edit the variable export SEGWAY_HAS_ONBOARD_JOY=true so we can control the platform with a joystick.

    • Using the input from the setup above modify these two lines to be correct:
      • export SEGWAY_JOY_DEV=/dev/input/js0 (Could be js2 for virtual machines)
      • export SEGWAY_JOY_MAPPING=xbox360 (Also tested with extreme3D)

  • For all models except the 210 set SEGWAY_HAS_BSA to true

  • SEGWAY_RUNS_IN_BALANCE_MODE should only be set for the 220 if you want to run in Balance mode

    • WARNING!! Do not run navigation in balance mode unless you fully understand the limitations and caveats of balance mode. It is probably best to contact Stanley Innovation and speak with engineering if you have any questions.

Compile from source

cd ~/segway_ws
catkin_make

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
sws

OR

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

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

Don't follow these instructions for anything other than this configuration

Setup Wireless Router

To connect with the platform these instructions assume you will be using a wireless router.

  • For direct platform control the TP-Link routers are really nice and can be powered from a +5V USB phone charging module
  • The specifics of setting up the TP-Link can be found online what you want is the following:
    • Router IP address 10.66.171.1
    • Netmask 255.255.255.0
    • Enable DHCP range 10.66.171.100-150
    • Enable the wireless
    • Turn off the passwords for now

Configure networking on remote computer

  • Connect to the wireless network.
  • DHCP should provide you an address like 10.66.172.100
  • Make sure you can ping the wireless router

ping 10.66.171.1

Manual Launch

  • Ensure the Disable button is not depressed
  • Power the RMP on with the silver button
    • LED Ring should pulse blue
    • The Power LED will blink green
    • The status LED should blink yellow indicating the state
  • In a new terminal

cd ~/segway_ws
sws
roslaunch segway_bringup stanley_innovation_system.launch
  • You should hear 2 beeps when the configuration server is initialized and 2 more when the platform is ready to accept commands
  • The launch is time staged so it takes ~15 seconds to complete

* If you are having issues communicating with the platform:

  • Check the network configuration
  • The wrong platform may be set in the configuration
  • The platform may have the wrong embedded firmware
  • The platform may not be on
  • The kill switch is pressed
  • There are errors on sensors
    • The wrong ones maybe selected or they may not be setup correctly

Manual launch works, time to install the service

  • Kill any ROS nodes that may be running and close all terminals
  • Open a new terminal and install the upstart service

cd ~/segway_ws
sws
rosrun segway_bringup install_segway_core

Start the service and make sure it starts up fine

segstart
  • To make sure everything starts fine you can repeatedly enter the following until the launch is finished

segchk
  • You should hear 2 beeps when the configuration server is initialized and 2 more when the platform is ready to accept commands
  • The launch is time staged so it takes ~15 seconds to complete

Test Visualization

  • Close all the terminals and open a fresh one
  • Start robot visualization:

cd ~/segway_ws
sws
roslaunch segway_viz view_robot.launch
  • You should see your robot model come up and be able to see all the different sensors

Test reconfiguration GUI

  • Open another terminal

sws
rosrun rqt_reconfigure rqt_reconfigure
  • Expand Segway and mouse over the options to get a description
    • Make sure you read the manual and understand what parameters do before changing them

See data

sws
rqt
  • If you are not familiar with RQT just click in the menu and select a few useful ones
    • Robots->Segway_RMP_V3

    • Visualization->RVIZ

    • Topics->Topic Monitor

    • Configuration->Dynamic Reconfigure

  • Experiment, play around with it etc.

Drive the system around

  • Press the 'B' button to enter tractor mode the platform will beep to confirm
  • Hold the deadman switch (left trigger)
  • You should now be able to drive the platform around.
  • See the control mapping in the configuration files

    Joystick Information

Rqt_graph

With the system running:

cd ~/segway_ws
sws
rqt_graph

rqt_graph.png

Done!

Wiki: Robots/RMPv3/indigo/quick_start_one_computer_remote (last edited 2015-07-15 14:28:37 by stanleyinnovation)