def __init__(self,ini_file='none.ini'): ''' Constructor ''' self.terrain = None try: CRSService.__init__(self,'ENV',49581,49580) except: print 'CEnvironment - XML-RPC server fail' else: print 'CEnvironment - running'
def __init__(self,local_port,remote_port=49580,ini_file='none.ini'): ''' Constructor ''' if local_port >= 49582 and local_port <= 49600: try: CRSService.__init__(self,'ROBOT',local_port,remote_port) #local_port from 49582 to 49600 except: print '[CRSRobot.__init__] - XML-RPC server fail' else: print '[CRSRobot.__init__] - running' else: print '[CRSRobot.__init__] - running out of ports' self.data = {} self.data['local'] = {} self.data['local']['VR'] = 0.2 self.data['local']['VL'] = 0.42
def __init__(self, local_port, remote_port=49580): """ Constructor """ if local_port >= 49601 and local_port <= 49700: try: CRSService.__init__(self, "DSS", local_port, remote_port) # local_port from 49601 to 49700 except: print "CRSDSS - XML-RPC server fail" else: print "CRSDSS - running" else: print "CRSDSS - running out of ports" """ Properties """ self.data = {} self.data["X0"] = 0 self.data["Y0"] = 0 self.data["O0"] = 0 self.data["VR0"] = 0 self.data["VL0"] = 0 self.data["SR0"] = 0 self.data["SL0"] = 0 self.data["S0"] = 0 self.data["X"] = [] self.data["Y"] = [] self.data["O"] = [] # load initial condition self.data["step_count"] = 1 # first step keep the initial values self.data["X"].append(self.data["X0"]) self.data["Y"].append(self.data["Y0"]) self.data["O"].append(self.data["O0"]) self.data["wheel_radius"] = 0.03 # radios of the wheel in meters self.data["whell_axi_size"] = 0.20 # distance between whells in meters self.data["delta_time"] = 0.01 # delta time in sec. self.data["simulation_time"] = 0 # total simulated time in sec.