/cse571_project

Project Template for CSE 571 - Artificial Intelligence

Primary LanguagePython

Running the Demo

To start the demo, run the following commands in order:

  1. Run ./env_setup.sh
  2. Run roscore
  3. Run rosrun cse571_project server.py -sub 1 -b 1
  4. Run roslaunch cse571_project maze.launch
  5. Run rosrun cse571_project move_tbot3.py
  6. Run rosrun cse571_project random_walk.py

action_server.py, server.py

Implements action execution and environment updation functions

environment_api.py

Implements an interface to communicate with the server and random_walk.py script

mazeGenerator.py

Environment generation script

move_tbot3.py, pid.py

Handles movement of turtlebot

books.json

Environment information dictionary generated by server.py

action_config.json

Lists all actions and their rewards, probabilities etc. Format:

{
    "<action_name>": { 
            "function": "<function to execute inside action_server.py>",
            "params": [<list of parameters accepted by corresponding function in action_server.py (must be in same order)>],
            "success_reward": <reward if action succeeds>,
            "fail_reward": <reward if action fails>,
            "possibilities": {
                "<action_name>": <probability of execution>, #<action_name> corresponds to an action in the config
                "<action_name>": <probability of execution>,
                .
                .
            }
        },
        .
        .

Sample Action Config explanation:

{
    "pick": { 
        "function": "execute_pick",
        "params": ["book_name"],
        "success_reward": 25,
        "fail_reward": -25,
        "possibilities": {
            "pick": 0.85,
            "noaction": 0.15
        }
    },

The action name is defined as pick. It corresponds to the execute_pick function implemented in action_server.py. The function takes 1 variable parameter i.e. book_name defined in the params key. The reward for successful execution of this action is 25 and reward for a failed execution is -25. The given config defines a stochastic environment where executing this action pick can result in pick being executed with probability 0.85 or a no-op action (defined as noaction) with probability 0.15

Note: To convert this to a deterministic action, we can change the probability of a pick action to 1