2. Usage

2.1 Running on Robots

System Configuration

Before using this package to drive your robots, you may configure your platform following the steps:
1. All machines (5 robots + 1 laptop) are installed Ubuntu 16.04 and ROS Kinetic
2. All robots (onboard computer, actually) are installed and catkin_make-ed ARIA lib and ROSARIA package
3. All machines need a static IP address and are able to automatically connect to your local WiFi
4. Write the IP and hostname information into /etc/hosts file on all the machines
5. Your commander (laptop) is able to SSH to all robots via public key (instead of password)
6. Onboard computers are able to get access to the microcontroller via serial post (add user to dialout group)

For detailed information regarding how to set up the whole system, please refer to the wiki page.

Moreover, there are two suggestions which is not necessary for this system but may be useful for your development.
- You may install a teamviewer software on your laptop and robots so that you can remote login into your onboard computers.
- For IDE, I recommend RoboWare Studio, which is especially designed for ROS developers. Another alternative is KDevelop, which is a cross-platform IDE.

Package Dependencies

Before git clone this repository, you need to install ARIA lib and git cloneROSARIA package first. After that, catkin_make your ROSARIA package with ARIA library. Then, you can clone this repository by git clone https://github.com/hanzheteng/pioneer_mrs.git and catkin_make this package in your workspace.

Notice:
1. You must catkin_make the ROSARIA package first before you clone and make this package, otherwise it may report errors.
2. Sometimes you need to catkin_make pioneer_mrs_generate_messages first before catkin_make this package, because the compiler may not be able to find the header file of our messages.

Optional package:
- If you want to use VICON motion capture system, you also need to git clone and catkin_makevicon_bridge package.

Sample Usage

Basically there are several steps:
1. launch nodes on all five robots
roslaunch pioneer_mrs multi-robot.launch
2. launch nodes on commander
roslaunch pioneer_mrs commander.launch

2.2 Running on MobileSim Simulator

You also need ROSARIA package to connect to MobileSim simulator. Moreover, you need to install MobileSim on your laptop.

Basically there are several steps:
1. run a MobileSim simulator and spawn five robots
roslaunch pioneer_mrs mobilesim.launch
2. launch nodes on all five robots
roslaunch pioneer_mrs multi-robot.launch machine:=mobilesim
3. launch nodes on commander
roslaunch pioneer_mrs commander.launch

2.3 Running on Gazebo Simulator

You do not need ROSARIA package here, since Gazebo will take charge of publishing odom information and dealing with cmd_vel commands. Gazebo is installed by default along with ROS if choosing desktop-full install. Moreover, for simulations of Pioneer 3-AT robots, you also need models and URDF files supplied by Mobile Robots Inc. by git cloneamr-ros-config meta-package.

Notice: On real robots, movement commands only execute for 600ms because of WatchDog timeout mechanism; but in gazebo simulator, robots will keep moving towards the last direction. You may press space bar (stop command) to stop it.

4. Update Log

V1.1 (Jan 15, 2018) The MRS control framework works well with new features, but the algorithm node need to be updated.

V1.1.4 (Feb 5, 2018) The algorithm node works well on both MobileSim simulator and empirical experiments. The Gazebo simulator still has problems to be resolved.

V1.2 (Feb 18, 2018) The multi-robot system works well on MobileSim simulator, Gazebo simulator and empirical experiments (localization done by either odometry, Vicon system, or Gazebo simulator.)

V1.3 (Mar 17, 2018) Add offset adjestment to the existing formation based on optimal-point algorithm; Launch files may have some problems because of improper launch sequence. (Senior Design project done in this version)

5. Debug FAQ

Most of the time, you can use roswtf command to diagnose your problem.
1. If roslaunch or rosrun cannot autocomplete by Tab key, first check if your search path covers the package by env | grep ROS. If it already exist in the path, try rospack profile or reboot your system.
2. If prompt process has died, exit code -11, you may access data in the code which was not initialized.
3. If prompt The following roslaunch remote processes failed to register: * xxxx (timeout 10.0s), your network may have a problem, including hosts file, ROS_MASTER_URI, env loader, etc. (e.g. the hostname of your laptop was not exactly the same as you set in /etc/hosts file)
4. Launch sequence problem: service servers need to start earlier than clients. (C++ only, python solved this problem by wait_for_service function)
5. If prompt cannot launch node of type [some python file], you need to add execute permission to that python file.
6. Getting input and printing output in the same command line window will result in a kind of shfiting of output lines.

No version for distro indigo. Known supported distros are highlighted in the buttons above.

No version for distro ardent. Known supported distros are highlighted in the buttons above.

No version for distro jade. Known supported distros are highlighted in the buttons above.

No version for distro hydro. Known supported distros are highlighted in the buttons above.