def new_world(loc_list): #generates a new world p = person() #generates a person, names it referee and ask the translator about its localtion p.id = str(obj2idx('referee', 'PERSONS')) p.locId = str(obj2idx('referee', 'LOCATIONS')) # 2' p.near = NO p.obj1Id = '-1' p.recognized = NO p.memorized = NO p.askedName = NO p.followed = NO p.found = NO # check! if person = referee, location = robot location i = item() #initializes items in the new world i.id = '-1' i.locId = '-1' #str(obj2idx('sams_table', 'LOCATIONS')) # '-1' i.found = NO i.toBeGrasped = NO i.grasped = NO i.delivered = NO i.pointed = NO r = robot() # puts the robot himself in its world map r.id = '1' r.locId = str(obj2idx('referee', 'LOCATIONS')) r.obj1Id = '-1' r.introduced = NO r.pointedAtLoc = '-1' print r.locId l = [] for loc in loc_list: #adds the locations list to this world nl = location() nl.id = loc nl.pointed_at = NO l.append(nl) w = world() #generates a world and fill it with the objects we already created before. w.item = i w.person = p w.robot = r w.location = l return w #return this world
def __init__(self, name): self._action_name = name self._as = actionlib.SimpleActionServer(name, gpsrSoar.msg.gpsrActionAction, execute_cb=self.execute_cb) self._as.start() self._hasgoal = False self._goalDonei = 0 self._goal = [] self._world = world() if TEST: errorfilepath = roslib.packages.get_pkg_dir("gpsr") + "/config/" error = errorfilepath + "error.txt" self.targfile = open(error, 'w')
def new_world(loc_list): #generates a new world p = person( ) #generates a person, names it referee and ask the translator about its localtion p.id = str(obj2idx('referee', 'PERSONS')) p.locId = str(obj2idx('referee', 'LOCATIONS')) # 2' p.near = NO p.obj1Id = '-1' p.recognized = NO p.memorized = NO p.askedName = NO p.followed = NO p.found = NO # check! if person = referee, location = robot location i = item() #initializes items in the new world i.id = '-1' i.locId = '-1' #str(obj2idx('sams_table', 'LOCATIONS')) # '-1' i.found = NO i.toBeGrasped = NO i.grasped = NO i.delivered = NO i.pointed = NO r = robot() # puts the robot himself in its world map r.id = '1' r.locId = str(obj2idx('referee', 'LOCATIONS')) r.obj1Id = '-1' r.introduced = NO r.pointedAtLoc = '-1' print r.locId l = [] for loc in loc_list: #adds the locations list to this world nl = location() nl.id = loc nl.pointed_at = NO l.append(nl) w = world( ) #generates a world and fill it with the objects we already created before. w.item = i w.person = p w.robot = r w.location = l return w #return this world