# Path: semantics/lexical_constants.py
# SEARCH_ACTION = "search"
# 
# GO_ACTION = "go"
# 
# GET_ACTION = "retrieve"
# 
# FOLLOW_ACTION = "follow"
# 
# SEE_ACTION = "see"
# 
# TELL_ACTION = "tell"
# 
# ACTION_ALIASES = {
#                   'appear': GO_ACTION,
#                   'get': GET_ACTION,
#                   'obtain': GET_ACTION,
#                   'meander': GO_ACTION,
#                   'slide': GO_ACTION,
#                   'nonvehicle': GO_ACTION,
#                   'escape': GO_ACTION,
#                   'rummage': SEARCH_ACTION,
#                   'characterize': SEE_ACTION,
#                   'chase': FOLLOW_ACTION,
#                   'lodge': STAY_ACTION,
#                   SEARCH_ACTION: SEARCH_ACTION,
#                   GO_ACTION: GO_ACTION,
#                   GET_ACTION: GET_ACTION,
#                   FOLLOW_ACTION: FOLLOW_ACTION,
#                   SEE_ACTION: SEE_ACTION,
#                   TELL_ACTION: TELL_ACTION,
#                   BEGIN_ACTION: BEGIN_ACTION,
#                   ACTIVATE_ACTION: ACTIVATE_ACTION,
#                   DEACTIVATE_ACTION: DEACTIVATE_ACTION,
#                   AVOID_ACTION: AVOID_ACTION,
#                   PATROL_ACTION: PATROL_ACTION,
#                   CARRY_ACTION: CARRY_ACTION,
#                   STAY_ACTION: STAY_ACTION,
#                   DEFUSE_ACTION: DEFUSE_ACTION,
#                  }


import re
from threading import Lock
from semantics.lexical_constants import (SEARCH_ACTION, GO_ACTION, GET_ACTION, FOLLOW_ACTION, 
                                 SEE_ACTION, TELL_ACTION, ACTION_ALIASES)
from ltlbroom.fsa import Automaton
from ltlbroom.ltlgeneration import LTLGenerator, FOLLOW_PROP, SEARCH_PROP, EXPLORE_PROP, UnrealizableError
from nlproxy import send_ltl_commands
from worldmap import get_adjacent_rooms, adjacency_changed
from subtle_msgs.msg import Fiducial
#!/usr/bin/python
"""Coordinate state between language, automata, and the robot."""



# LTL constants
ACTION_RE = re.compile(r"(?P<action>[a-z]+)(_(?P<target>[a-z0-9]+))?")
DRIVE_COMMAND = "drive_to"
DEFUSE_PROP = "defuse"
COMPLEX_ACTUATORS = {"get": "get_obj"}
SENSOR_MAPPING = {Fiducial.TYPE_BOMB: "bomb",
                  Fiducial.TYPE_HOSTAGE: "hostage",
                  Fiducial.TYPE_BADGUY: "bad_guy",
                  Fiducial.TYPE_USER1: "user_1",
                  Fiducial.TYPE_USER2: "user_2"}

SIMPLE_ACTUATORS = set((SEARCH_PROP, FOLLOW_PROP, DEFUSE_PROP, EXPLORE_PROP))
VALIDATE_TARGET_ACTUATORS = set((DEFUSE_PROP))

# Semantics constants

# Path: semantics/lexical_constants.py
# SEARCH_ACTION = "search"
# 
# GO_ACTION = "go"
# 
# GET_ACTION = "retrieve"
# 
# FOLLOW_ACTION = "follow"
# 
# SEE_ACTION = "see"
# 
# TELL_ACTION = "tell"
# 
# ACTION_ALIASES = {
#                   'appear': GO_ACTION,
#                   'get': GET_ACTION,
#                   'obtain': GET_ACTION,
#                   'meander': GO_ACTION,
#                   'slide': GO_ACTION,
#                   'nonvehicle': GO_ACTION,
#                   'escape': GO_ACTION,
#                   'rummage': SEARCH_ACTION,
#                   'characterize': SEE_ACTION,
#                   'chase': FOLLOW_ACTION,
#                   'lodge': STAY_ACTION,
#                   SEARCH_ACTION: SEARCH_ACTION,
#                   GO_ACTION: GO_ACTION,
#                   GET_ACTION: GET_ACTION,
#                   FOLLOW_ACTION: FOLLOW_ACTION,
#                   SEE_ACTION: SEE_ACTION,
#                   TELL_ACTION: TELL_ACTION,
#                   BEGIN_ACTION: BEGIN_ACTION,
#                   ACTIVATE_ACTION: ACTIVATE_ACTION,
#                   DEACTIVATE_ACTION: DEACTIVATE_ACTION,
#                   AVOID_ACTION: AVOID_ACTION,
#                   PATROL_ACTION: PATROL_ACTION,
#                   CARRY_ACTION: CARRY_ACTION,
#                   STAY_ACTION: STAY_ACTION,
#                   DEFUSE_ACTION: DEFUSE_ACTION,
#                  }


# Path: jr/statemanager.py
import re
from threading import Lock
from semantics.lexical_constants import (SEARCH_ACTION, GO_ACTION, GET_ACTION, FOLLOW_ACTION, 
                                 SEE_ACTION, TELL_ACTION, ACTION_ALIASES)
from ltlbroom.fsa import Automaton
from ltlbroom.ltlgeneration import LTLGenerator, FOLLOW_PROP, SEARCH_PROP, EXPLORE_PROP, UnrealizableError
from nlproxy import send_ltl_commands
from worldmap import get_adjacent_rooms, adjacency_changed
from subtle_msgs.msg import Fiducial

#!/usr/bin/python
"""Coordinate state between language, automata, and the robot."""



# LTL constants
ACTION_RE = re.compile(r"(?P<action>[a-z]+)(_(?P<target>[a-z0-9]+))?")
DRIVE_COMMAND = "drive_to"
DEFUSE_PROP = "defuse"
COMPLEX_ACTUATORS = {"get": "get_obj"}
SENSOR_MAPPING = {Fiducial.TYPE_BOMB: "bomb",
                  Fiducial.TYPE_HOSTAGE: "hostage",
                  Fiducial.TYPE_BADGUY: "bad_guy",
                  Fiducial.TYPE_USER1: "user_1",
                  Fiducial.TYPE_USER2: "user_2"}

SIMPLE_ACTUATORS = set((SEARCH_PROP, FOLLOW_PROP, DEFUSE_PROP, EXPLORE_PROP))
VALIDATE_TARGET_ACTUATORS = set((DEFUSE_PROP))

# Semantics constants

KNOWN_ACTIONS = set((SEARCH_ACTION, GO_ACTION, GET_ACTION, FOLLOW_ACTION, SEE_ACTION, 