Skip to content

sai-aneesh/mrpp

Repository files navigation

mrpp_sumo

Platform to test MRPP algorithms in SUMO via ROS

Dependencies

  • SUMO

  • ROS - Melodic

  • Python Packages

    python3 -m pip install networkx configparser pandas seaborn numpy threading rospkg catkin_pkg
    

Installation

  • Clone into your ros workspace

  • Add the following to your .bashrc script

    export SUMO_HOME=/usr/share/sumo
    export PYTHONPATH=$SUMO_HOME/tools:$PYTHONPATH
    
  • Ensure that the scripts are executable

    chmod -R 755 /path/to/mrpp_sumo/scripts/
    
  • Enjoy!(?)

How to use

The One Sheet

alt text

Adding a graph

  • Create a sumo compatible representation for the required environment with [graph_name].net.xml, [graph_name].nod.xml and [graph_name].edg.xml files and add it to the graph_sumo folder.

  • Create a [graph_name].sumocfg file by copying an existing .sumocfg file and replacing the 'net-file' attribute value with [graph_name].net.xml

  • Create a [graph_name].graphml file by running

    python3 scripts/sumo_to_graphml.py [graph_name]
    

    This file stores the graph information in a networkx compatible format.

Adding an MRPP algorithm

Coming Soon

Pre Process

  • Add a *.yaml file to the /config folder with the required rosparameters (here's a list of required parameters)

    • graph (name of the graph)
    • random_string (simulation id)
    • init_bots (number of bots)
    • use_sim_time: true
    • algo_name
    • sim_length (in secs)
    • init_locations: '' (if empty, locations picked at random)
  • Add a *.graphml file in /graph_ml folder and a *.nod.xml, *.edg.xml, *.net.xml, *.sumocfg in /graph_sumo for the corresponding graphs

  • Create an /outputs folder (if not already)

Running a simulation

  roscd mrpp_sumo
  ./tpbp_new.sh

Post Process

Find the following files in /outputs folder

  • *_command.in Contains the sequence of walks sent by your algo_file. 4 lines per command (time_stamp, bot_name, node_id sequence, time of departure (can be empty))
  • *_visits.in Contains the sequence of visits excuted by the bots. 3 lines per visit (time_stamp, node_ids, bot_ids)
  • *_vehicle.xml Output from SUMO file

To Do

  • Add scripts to generate plots for analysis
  • Lots of other cool stuff

About

Multi Robot Patrolling Problem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages