MIRΟR - A Middleware Software Tool for Interfacing Mobile Industrial Robots with Optimization Routing Algorithms
This application was developed in order to create a sophisticated testing environment that applies routing optimization algorithms that solve the Travelling Salesman Problem to industial facility layouts, compares the results of the algorithmic outcomes and informs the effective and efficient routing solution. It is integrated with ROS, a robotic framework that provides tools such as Rviz for visualization, Gazebo 3D a simulation physics engine and Google OR an optimization suite that provides build-in algorithms that solve complex problems.
-
Import and test custom algorithms for TSP-Travelling Salesman Problem.
-
Evaluate the efficiency of the algorithms with graphs.
-
Test selected/imported algorithms in any given layout.
- Ubuntu 18.04 LTS
- ROS Melodic
- Turtlebot3
- Kivy v1.9.1
- Config parser
- Install OR Tools
pip install ortools
Creat a ROS workspace for all the corresponding packages: catkin_ws
Clone the latest version into your catkin workspace and compile the package using ROS.
cd catkin_ws/src
git clone https://github.com/EvangelosSyrmos/miror.git
Move the turtlebot3_gazebo
folder provided by MIROR in the catkin_ws/src
.
Make the gui.py executable.
cd catkin_ws/src/miror/scripts
chmod +x gui.py
cd
Build the workspace:
cd catkin_ws
catkin_make
!If errors occur during the execution of catkin_make
install any required packages missing from the ROS installation process.
Start ROS Master node
roscore
Start Gazebo simulation
roslaunch turtlebot3_gazebo tsp_world.launch
Start ROS Navigation launch file
roslaunch miror tsp_navigation.launch
Start MIROR:
roslaunch miror tsp_gui.launch
The following examples use the already provided 3D map in Gazebo.
To insert waypoints in Rviz, the steps are as follows:
- Enter the number of waypoints in the placeholder as shown.
- Press the button Create waypoints and click the Rviz button Publish Point as shown for every point starting from the mobile robot.
- Finally press the button Calculate costs to create a NxN cost matrix for all the possible routes.
To import a custom algorithm and assess the performance in comparison to the provided some conventions must be followed.
- Create the python file in the specific directory
catkin_ws/src/miror/scripts/algorithm/
folder. - The python file name must be identical to the class inside, e.g. abc.py.
- The class must have a route list to store the waypoints, calculation time and route distance.
class Abc:
def __init__(self, distance_matrix):
self.distance_matrix = distance_matrix
self.calculation_time = 4.5 # Float
self._distance = 290 # Float/Int
self.route = [] # [0, 1, 2, 0]
- Type the name of the
python
file in the placeholder as shown. - Press the button Execute to run the custom algorithm and any selected algorithm from the list sequentialy.
To execute any combination of the provided algorithms.
- Select them by clicking on the checkboxes as shown. An indicator for the current selection of algorithms is provided for feedback.
- Press the button Execute to run them sequentialy.
- A window with the results will pop with graphs.
After the results have been shown the best algorithm will be selected based on the smallest route distance. If all the solutions are equal the algorithm with the fastes computation time will selected.
- Press the button Navigate to start the navigation of the mobile robot in the facility layout as shown.
- The mobile robot will start moving with the best solution.
-
The user can execute multiple combinations of algorithms without the need of calculating the cost matrix every time.
-
Selecting different algorithms or importing custom can be done without the need to navigate the mobile robot.
To import a custom map follow the instructions GazeboSim.
-
Use turtlebot3_slam to generate the occupancy grid Turtlebot3_Slam.
-
Save the generated maps.
rosrun map_server map_saver -f map
- Move the generated files
map.pgm
andmap.yaml
tomiror/maps
and rename the old ones.
Local search strategies (Metaheuristics) known as optimizing algorihtms are enabled to run for 5 sec after the first solution has been given located in scripts/algorithms/google.py. Feel free to change the duration or option for large scale problems if needed.
self.search_parameters.local_search_metaheuristic = (routing_enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH)
# self.search_parameters.local_search_metaheuristic = (routing_enums_pb2.LocalSearchMetaheuristic.AUTOMATIC)
# self.search_parameters.local_search_metaheuristic = (routing_enums_pb2.LocalSearchMetaheuristic.GREEDY_DESCENT)
# self.search_parameters.local_search_metaheuristic = (routing_enums_pb2.LocalSearchMetaheuristic.SIMULATED_ANNEALING)
# self.search_parameters.local_search_metaheuristic = (routing_enums_pb2.LocalSearchMetaheuristic.TABU_SEARCH)
# self.search_parameters.local_search_metaheuristic = (routing_enums_pb2.LocalSearchMetaheuristic.OBJECTIVE_TABU_SEARCH)
self.search_parameters.time_limit.seconds = 5
-
Dimitrios Bechtsis
-
Naoum Tsolakis
For support, email me at [email protected]