global DR_GROUP_ID global drg try: if DR_GROUP_ID >= 0: DR_GROUP_ID += 1 except NameError: DR_GROUP_ID = 0 drg = [] drg.append(trick.DRAscii("vehicleState")) drg[DR_GROUP_ID].set_freq(trick.DR_Always) drg[DR_GROUP_ID].set_cycle(0.05) drg[DR_GROUP_ID].set_single_prec_only(False) drg[DR_GROUP_ID].add_variable("veh.vehicle.position[0]") drg[DR_GROUP_ID].add_variable("veh.vehicle.position[1]") drg[DR_GROUP_ID].add_variable("veh.vehicle.velocity[0]") drg[DR_GROUP_ID].add_variable("veh.vehicle.velocity[1]") drg[DR_GROUP_ID].add_variable("veh.vehicle.acceleration[0]") drg[DR_GROUP_ID].add_variable("veh.vehicle.acceleration[1]") drg[DR_GROUP_ID].add_variable("veh.vehicle.heading") drg[DR_GROUP_ID].add_variable("veh.vehicle.headingRate") drg[DR_GROUP_ID].add_variable("veh.vehicle.rightMotorSpeed") drg[DR_GROUP_ID].add_variable("veh.vehicle.leftMotorSpeed") trick.add_data_record_group(drg[DR_GROUP_ID], trick.DR_Buffer) drg[DR_GROUP_ID].enable()