2019-11-14 19:35:57 +00:00
|
|
|
exec(open("Modified_data/realtime.py").read())
|
|
|
|
exec(open("Modified_data/vehicleState.dr").read())
|
2016-02-18 22:14:44 +00:00
|
|
|
|
|
|
|
trick.TMM_reduced_checkpoint(0)
|
|
|
|
|
|
|
|
veh_integloop.getIntegrator(trick.Runge_Kutta_4, 8)
|
|
|
|
|
2016-03-03 19:22:37 +00:00
|
|
|
#==========================================
|
|
|
|
# Configure the Vehicle.
|
|
|
|
#==========================================
|
|
|
|
veh.vehicle.position = [0.0, 0.0]
|
|
|
|
veh.vehicle.heading = 0.0
|
2016-02-18 22:14:44 +00:00
|
|
|
|
|
|
|
veh.vehicle.distanceBetweenWheels = 0.183
|
|
|
|
veh.vehicle.wheelRadius = 0.045
|
|
|
|
veh.vehicle.wheelSpeedLimit = 8.880
|
2016-03-03 19:22:37 +00:00
|
|
|
veh.vehicle.headingRateLimit = 3.14159/4
|
2016-02-18 22:14:44 +00:00
|
|
|
|
|
|
|
veh.vehicle.slowDownDistance = 0.5
|
|
|
|
veh.vehicle.arrivalDistance = 0.1
|
|
|
|
|
|
|
|
#==========================================
|
|
|
|
# Add the waypoints to the SIM.
|
|
|
|
#==========================================
|
|
|
|
waypoints_path = "Modified_data/cross.waypoints"
|
|
|
|
fp = open(waypoints_path, "r")
|
|
|
|
for line in fp:
|
2016-03-03 19:22:37 +00:00
|
|
|
fields = line.split(",")
|
2016-02-18 22:14:44 +00:00
|
|
|
veh.vehicle.add_waypoint( float(fields[0]), float(fields[1]))
|
|
|
|
|
|
|
|
#==========================================
|
|
|
|
# Start the display VarServer Client
|
|
|
|
#==========================================
|
|
|
|
varServerPort = trick.var_server_get_port();
|
2016-02-22 17:59:11 +00:00
|
|
|
EVDisplay_path = "models/Graphics/dist/EVDisplay.jar"
|
2016-02-18 22:14:44 +00:00
|
|
|
|
|
|
|
if (os.path.isfile(EVDisplay_path)) :
|
|
|
|
EVDisplay_cmd = "java -jar " \
|
|
|
|
+ EVDisplay_path \
|
2016-03-03 19:22:37 +00:00
|
|
|
+ " -v images/twoWheelRover.png" \
|
2016-02-18 22:14:44 +00:00
|
|
|
+ " -w " + waypoints_path \
|
|
|
|
+ " " + str(varServerPort) + " &" ;
|
|
|
|
print(EVDisplay_cmd)
|
|
|
|
os.system( EVDisplay_cmd);
|
|
|
|
else :
|
2016-03-03 19:22:37 +00:00
|
|
|
print('==================================================================================')
|
|
|
|
print('EVDisplay needs to be built. Please \"cd\" into models/Graphics and type \"make\".')
|
|
|
|
print('==================================================================================')
|
2016-02-18 22:14:44 +00:00
|
|
|
|
|
|
|
trick.stop(100)
|