Commit febb13ae authored by Roque's avatar Roque

[WEB-WORKER] [WIP] Drone simulator refactor

- handle game finish
- handle web worker erros
- update flight log
- cleanup
- move all game logic into one file
- get rid of rescue swarm dependency
- simplify json game parameters
parent b9ba1073
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Rescue Swarm Map" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>medium_map</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Map based on medium size map, use to compare simulated and real drone flights.\n
It has 2 drones: one for that simulates the real flight from a script (DroneAaileFixeAPI - id:0) and one that moves according to the log values (DroneLogAPI id:1)\n
Being run on (WIP) web_page_module/test_drone_simulator_gadget page, the log drone flight will be drawn on the map.</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>compare_map</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Rescue Swarm Map</string> </value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>{\n
"distances": {\n
"communication": 99999,\n
"control": 1500,\n
"information": 5\n
},\n
"drone": {\n
"maxAcceleration": 1,\n
"maxSpeed": 16.666667,\n
"collisionSector": 0.25,\n
"broadcastingTime": 1000,\n
"viewAngle": 60\n
},\n
"meteo": 0.5,\n
"derive": {\n
"speed": 0.1,\n
"direction": {\n
"x": 1,\n
"y": 0.5\n
}\n
},\n
"gameTime": 1800,\n
"goalDiameter": 7,\n
"goalPositionLeftTeam": {\n
"x": 0,\n
"y": 0,\n
"z": 0.6\n
},\n
"goalPositionRightTeam": {\n
"x": 0,\n
"y": 0,\n
"z": 0.6\n
},\n
"latency": {\n
"information": 0,\n
"communication": 0\n
},\n
"mapSize": {\n
"depth": 1000,\n
"height": 100,\n
"width": 1000\n
},\n
"obstacles": [],\n
"spawnPositions": [],\n
"initialHumanAreaPosition": {\n
"x": -400,\n
"y": 400,\n
"z": 0\n
},\n
"randomSpawn": {\n
"leftTeam": {\n
"position": {\n
"x": 0,\n
"y": 0,\n
"z": 20\n
},\n
"dispertion": {\n
"x": 8,\n
"y": 8,\n
"z": 6\n
},\n
"types": [\n
"DroneAaileFixeAPI",\n
"DroneLogAPI",\n
"DroneAPI"\n
]\n
},\n
"rightTeam": {\n
"position": {\n
"x": -400,\n
"y": 400,\n
"z": 0\n
},\n
"dispertion": {\n
"x": 100,\n
"y": 100,\n
"z": 0.1\n
}\n
}\n
},\n
"teamSize": 2\n
}</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Compare map</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1657219036.22</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1002.12601.25029.46114</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1660228730.09</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Rescue Swarm Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>emulate_bounce</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Bounce flight script: https://lab.nexedi.com/lpgeneau/flight-scripts/blob/update_loop/bouncy-flight.js</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>emulate_bounce</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Rescue Swarm Script</string> </value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
const EPSILON = 70,\n
EPSILON_ALTITUDE = 5,\n
EPSILON_YAW = 6,\n
FLIGH_ALTITUDE = 100,\n
PARACHUTE_ALTITUDE = 35,\n
RADIUS = 30.001,\n
TARGET_YAW = 0,\n
checkpoint_list = [\n
{\n
"latitude": 45.641,\n
"longitude": 14.26472,\n
"altitude": 604\n
},\n
{\n
"latitude": 45.6463889,\n
"longitude": 14.2516,\n
"altitude": 642\n
},\n
{\n
"latitude": 45.656,\n
"longitude": 14.2516,\n
"altitude": 596\n
},\n
{\n
"latitude": 45.65916,\n
"longitude": 14.255,\n
"altitude": 634\n
},\n
{\n
"latitude": 45.6527,\n
"longitude": 14.2775,\n
"altitude": 676\n
},\n
{\n
"latitude": 45.6427,\n
"longitude": 14.2519,\n
"altitude": 589\n
},\n
{\n
"latitude": 45.641,\n
"longitude": 14.254,\n
"altitude": 582\n
},\n
{\n
"latitude": 45.6558,\n
"longitude": 14.2775,\n
"altitude": 686\n
},\n
{\n
"latitude": 45.6594,\n
"longitude": 14.271,\n
"altitude": 667\n
},\n
{\n
"latitude": 45.641,\n
"longitude": 14.258,\n
"altitude": 581\n
},\n
{\n
"latitude": 45.653,\n
"longitude": 14.2516,\n
"altitude": 584\n
},\n
{\n
"latitude": 45.6594,\n
"longitude": 14.26194,\n
"altitude": 633\n
},\n
{\n
"latitude": 45.641,\n
"longitude": 14.2716,\n
"altitude": 621\n
},\n
{\n
"latitude": 45.644,\n
"longitude": 14.2775,\n
"altitude": 642\n
},\n
{\n
"latitude": 45.6594,\n
"longitude": 14.26638,\n
"altitude": 660\n
},\n
{\n
"latitude": 45.6508,\n
"longitude": 14.25194,\n
"altitude": 591\n
}\n
];\n
\n
function altitudeReached(altitude, target_altitude) {\n
console.log(`[DEMO] Waiting for altitude... (${altitude} , ${target_altitude})`);\n
return Math.abs(altitude - target_altitude) < EPSILON_ALTITUDE;\n
}\n
\n
function distance(lat1, lon1, lat2, lon2) {\n
const R = 6371e3, // meters\n
la1 = lat1 * Math.PI/180, // la, lo in radians\n
la2 = lat2 * Math.PI/180,\n
lo1 = lon1 * Math.PI/180,\n
lo2 = lon2 * Math.PI/180;\n
\n
//haversine formula\n
const sin_lat = Math.sin((la2 - la1)/2),\n
sin_lon = Math.sin((lo2 - lo1)/2),\n
h = sin_lat*sin_lat + Math.cos(la1)*Math.cos(la2)*sin_lon*sin_lon;\n
return 2*R*Math.asin(Math.sqrt(h));\n
}\n
\n
function exit_on_fail(ret, msg) {\n
if (ret) {\n
console.log(msg);\n
me.exit(1);\n
}\n
}\n
\n
me.onStart = function() {\n
me.direction_set = false;\n
me.init_alt_reached = false;\n
me.landing_alt_reached = false;\n
me.next_checkpoint = 0;\n
me.parachute_triggered = false;\n
me.start_altitude = me.getInitialAltitude() + FLIGH_ALTITUDE;\n
\n
exit_on_fail(\n
me.setAltitude(me.start_altitude + 1),\n
"Failed to set start altitude");\n
};\n
\n
me.onUpdate = function(timestamp) {\n
if (!me.init_alt_reached) {\n
me.init_alt_reached = altitudeReached(me.getAltitudeAbs(), me.start_altitude);\n
return;\n
}\n
\n
if (me.must_wait > 0) {\n
if (!mustWait(timestamp)) {\n
me.must_wait = 0;\n
me.timestamp = 0;\n
}\n
return;\n
}\n
\n
if (!me.direction_set) {\n
if (me.next_checkpoint < checkpoint_list.length) {\n
exit_on_fail(\n
me.setTargetCoordinates(\n
checkpoint_list[me.next_checkpoint].latitude,\n
checkpoint_list[me.next_checkpoint].longitude,\n
checkpoint_list[me.next_checkpoint].altitude + FLIGH_ALTITUDE,\n
RADIUS\n
),\n
"Failed to set checkpoint coordinates");\n
console.log(`[DEMO] Going to Checkpoint ${me.next_checkpoint}\\n`)\n
} else {\n
console.log("[DEMO] Setting landing coordinates...\\n");\n
me.landing_altitude = me.getAltitudeAbs() - me.getCurrentPosition().z + PARACHUTE_ALTITUDE;\n
exit_on_fail(\n
me.setAltitude(me.landing_altitude),\n
"Failed to set landing altitude");\n
}\n
me.direction_set = true;\n
return;\n
}\n
\n
if (me.next_checkpoint < checkpoint_list.length) {\n
me.current_position = me.getCurrentPosition();\n
me.distance = distance(me.current_position.x, me.current_position.y,\n
checkpoint_list[me.next_checkpoint].latitude,\n
checkpoint_list[me.next_checkpoint].longitude);\n
if (me.distance > EPSILON) {\n
console.log(`Waiting for drone to get to destination (${me.distance} m)`);\n
} else {\n
console.log(`[DEMO] Reached Checkpoint ${me.next_checkpoint}\\n`);\n
exit_on_fail(\n
me.setCheckpoint(me.next_checkpoint),\n
"Failed to set checkpoint");\n
me.next_checkpoint += 1;\n
me.direction_set = false;\n
}\n
return;\n
}\n
\n
if (!me.landing_alt_reached) {\n
me.landing_alt_reached = altitudeReached(me.getAltitudeAbs(), me.landing_altitude);\n
return;\n
}\n
\n
if (!me.parachute_triggered) {\n
if (Math.abs(me.getYaw() - TARGET_YAW) < EPSILON_YAW) {\n
console.log("[DEMO] Deploying parachute...");\n
exit_on_fail(me.doParachute(2), "Failed to deploy parachute");\n
me.parachute_triggered = true;\n
} else {\n
return console.log(`[DEMO] Waiting for yaw...`);\n
}\n
}\n
\n
if (me.landed()) {\n
me.exit(0);\n
}\n
};\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>emulate_bounce</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1660315056.56</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1002.23818.59984.50602</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1660839085.05</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Rescue Swarm Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>emulate_loiter</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Loiter demo script: https://lab.nexedi.com/lpgeneau/flight-scripts/blob/update_loop/demo.js</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>emulate_loiter</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Rescue Swarm Script</string> </value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
const ALTITUDE_DIFF = 30,\n
FLIGH_ALTITUDE = 100,\n
PARACHUTE_ALTITUDE = 35,\n
EPSILON = 105,\n
EPSILON_YAW = 6,\n
EPSILON_ALTITUDE = 5,\n
TARGET_YAW = 0,\n
checkpoint_list = [\n
{\n
"latitude": 45.64492790560583,\n
"longitude": 14.25334942966329,\n
"altitude": 585.1806861589965\n
},\n
{\n
"latitude": 45.64316335436476,\n
"longitude": 14.26332880184475,\n
"altitude": 589.8802607573035\n
},\n
{\n
"latitude": 45.64911917196595,\n
"longitude": 14.26214792790128,\n
"altitude": 608.6648153348965\n
},\n
{\n
"latitude": 45.64122685351364,\n
"longitude": 14.26590493128597,\n
"altitude": 606.1448368129072\n
},\n
{\n
"latitude": 45.64543355564817,\n
"longitude": 14.27242391207985,\n
"altitude": 630.0829598206344\n
},\n
{\n
"latitude": 45.6372792927328,\n
"longitude": 14.27533492411138,\n
"altitude": 616.1839898415284\n
},\n
{\n
"latitude": 45.64061299543953,\n
"longitude": 14.26161958465814,\n
"altitude": 598.0603137354178\n
},\n
{\n
"latitude": 45.64032340702919,\n
"longitude": 14.2682896662383,\n
"altitude": 607.1243119862851\n
}\n
],\n
landing_point = [\n
{\n
"latitude": 45.6398451,\n
"longitude": 14.2699217\n
}\n
],\n
LEADER_ID = 0,\n
IS_LEADER = me.id === LEADER_ID;\n
\n
function altitudeReached(altitude, target_altitude) {\n
console.log(`[DEMO] Waiting for altitude... (${altitude} , ${target_altitude})`);\n
return Math.abs(altitude - target_altitude) < EPSILON_ALTITUDE;\n
}\n
\n
function distance(lat1, lon1, lat2, lon2) {\n
const R = 6371e3, // meters\n
la1 = lat1 * Math.PI/180, // la, lo in radians\n
la2 = lat2 * Math.PI/180,\n
lo1 = lon1 * Math.PI/180,\n
lo2 = lon2 * Math.PI/180;\n
\n
//haversine formula\n
const sin_lat = Math.sin((la2 - la1)/2),\n
sin_lon = Math.sin((lo2 - lo1)/2),\n
h = sin_lat*sin_lat + Math.cos(la1)*Math.cos(la2)*sin_lon*sin_lon;\n
return 2*R*Math.asin(Math.sqrt(h));\n
}\n
\n
function exit_on_fail(ret, msg) {\n
if (ret) {\n
console.log(msg);\n
me.exit(1);\n
}\n
}\n
\n
function mustWait(timestamp) {\n
if(me.timestamp === 0) {\n
me.timestamp = timestamp;\n
}\n
return timestamp - me.timestamp < me.must_wait;\n
}\n
\n
me.onStart = function() {\n
me.direction_set = false;\n
me.init_alt_reached = false;\n
me.landing = false;\n
me.landing_alt_reached = false;\n
me.must_wait = 3000;\n
me.next_checkpoint = 0;\n
me.parachute_triggered = false;\n
me.start_altitude = me.getInitialAltitude() + FLIGH_ALTITUDE;\n
me.timestamp = 0;\n
\n
if (!IS_LEADER) {\n
me.follow_leader = true;\n
me.leader_init_alt_reached = false;\n
me.start_altitude += ALTITUDE_DIFF;\n
me.must_wait = 0;\n
}\n
exit_on_fail(\n
me.setAltitude(me.start_altitude + 1),\n
"Failed to set start altitude");\n
};\n
\n
me.onUpdate = function(timestamp) {\n
if (!me.init_alt_reached) {\n
me.init_alt_reached = altitudeReached(me.getAltitudeAbs(), me.start_altitude);\n
return;\n
}\n
\n
if (me.must_wait > 0) {\n
if (!mustWait(timestamp)) {\n
me.must_wait = 0;\n
me.timestamp = 0;\n
}\n
return;\n
}\n
\n
if (!IS_LEADER && me.follow_leader) {\n
if (me.drone_dict[LEADER_ID].altitudeAbs === 0) {\n
return console.log("[DEMO] Waiting for leader to send its altitude");\n
}\n
\n
if (!me.leader_init_alt_reached) {\n
me.leader_init_alt_reached = me.drone_dict[LEADER_ID].altitudeAbs >= me.start_altitude - ALTITUDE_DIFF;\n
return console.log(`[DEMO] Waiting for leader to reach altitude ${me.start_altitude - ALTITUDE_DIFF} (currently ${me.drone_dict[LEADER_ID].altitudeAbs})`);\n
}\n
\n
if (me.drone_dict[LEADER_ID].altitudeRel > PARACHUTE_ALTITUDE) {\n
exit_on_fail(\n
me.setTargetCoordinates(\n
me.drone_dict[LEADER_ID].latitude,\n
me.drone_dict[LEADER_ID].longitude,\n
me.drone_dict[LEADER_ID].altitudeAbs + ALTITUDE_DIFF,\n
30.001\n
),\n
"Failed to follow leader");\n
} else {\n
me.follow_leader = false;\n
me.next_checkpoint = me.drone_dict[LEADER_ID].lastCheckpoint + 1;\n
console.log("[DEMO] Stop following...\\n");\n
}\n
return;\n
}\n
\n
if (!me.direction_set) {\n
if (me.next_checkpoint < checkpoint_list.length) {\n
exit_on_fail(\n
me.setTargetCoordinates(\n
checkpoint_list[me.next_checkpoint].latitude,\n
checkpoint_list[me.next_checkpoint].longitude,\n
checkpoint_list[me.next_checkpoint].altitude + FLIGH_ALTITUDE,\n
100\n
),\n
"Failed to set checkpoint coordinates");\n
console.log(`[DEMO] Going to Checkpoint ${me.next_checkpoint}\\n`)\n
} else {\n
console.log("[DEMO] Setting landing coordinates...\\n");\n
me.landing_altitude = me.getAltitudeAbs() - me.getCurrentPosition().z + PARACHUTE_ALTITUDE;\n
exit_on_fail(\n
/*me.setTargetCoordinates(\n
checkpoint_list[checkpoint_list.length - 1].latitude,\n
checkpoint_list[checkpoint_list.length - 1].longitude,\n
me.landing_altitude,\n
100\n
),*/\n
me.setAltitude(me.landing_altitude),\n
"Failed to set landing coordinates");\n
}\n
me.direction_set = true;\n
return;\n
}\n
\n
if (me.next_checkpoint < checkpoint_list.length) {\n
me.current_position = me.getCurrentPosition();\n
me.distance = distance(me.current_position.x, me.current_position.y,\n
checkpoint_list[me.next_checkpoint].latitude,\n
checkpoint_list[me.next_checkpoint].longitude);\n
if (me.distance > EPSILON) {\n
console.log(`Waiting for drone to get to destination (${me.distance} m)`);\n
} else {\n
console.log(`[DEMO] Reached Checkpoint ${me.next_checkpoint}\\n`);\n
exit_on_fail(\n
me.setCheckpoint(me.next_checkpoint),\n
"Failed to set checkpoint");\n
me.next_checkpoint += 1;\n
me.direction_set = false;\n
me.must_wait = 30000;\n
me.loiter();\n
}\n
return;\n
}\n
\n
if (!me.landing_alt_reached) {\n
me.landing_alt_reached = altitudeReached(me.getAltitudeAbs(), me.landing_altitude);\n
return;\n
}\n
\n
if (!me.landing) {\n
me.current_position = me.getCurrentPosition();\n
me.distance = distance(me.current_position.x, me.current_position.y,\n
landing_point.latitude, landing_point.longitude);\n
if (me.distance > 20) {\n
console.log(`[DEMO] Waiting to reach landing point (current distance is ${me.distance})`);\n
} else {\n
console.log("[DEMO] Landing...\\n");\n
me.landing = true;\n
}\n
return;\n
}\n
\n
if (!me.parachute_triggered) {\n
if (Math.abs(me.getYaw() - TARGET_YAW) < EPSILON_YAW) {\n
console.log("[DEMO] Deploying parachute...");\n
exit_on_fail(me.doParachute(2), "Failed to deploy parachute");\n
me.parachute_triggered = true;\n
} else {\n
return console.log(`[DEMO] Waiting for yaw...`);\n
}\n
}\n
\n
if (me.landed()) {\n
me.exit(0);\n
}\n
};\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>emulate_loiter</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1660314641.15</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1002.29699.24339.25053</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1661272768.61</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Rescue Swarm Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>log_bounce</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Bouncy flight log. Corresponds to the flight for the script https://lab.nexedi.com/lpgeneau/flight-scripts/blob/update_loop/bouncy-flight.js</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>log_bounce</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Rescue Swarm Script</string> </value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>Waiting to discover msystem...\n
Discovered autopilot\n
Subscribing to flight mode...\n
Subscribing to Euler angle...\n
Subscribing to Fixedwing Metrics...\n
Subscribing to raw GPS...\n
Waiting for first telemetry\n
48199989; 45.6411; 14.2658; 595.355; 595.355; 7.22556; 10.5976; 0; 0.850025; 0; -0.00356272\n
MAVSDK started...\n
timestamp; latitude; longitude; AMSL (m); rel altitude (m); pitch (°); roll(°); yaw(°); air speed (m/s); throttle(%); climb rate(m/s)\n
Arming...\n
Taking off...\n
49875358; 45.6411; 14.2658; 595.355; 0; 7.18687; 10.7385; 0; -0.84838; 0; -0.00381378\n
51516302; 45.6411; 14.2658; 595.355; 0; 7.1862; 10.7699; 0; -0.499292; 0; 0.00203574\n
53175035; 45.6411; 14.2658; 595.355; 0; 7.3092; 10.6249; 0; 1.31015; 0; 0.00104045\n
54919034; 45.6411; 14.2658; 595.355; 0; 7.31917; 10.6832; 0; 0.303041; 0; -0.00113967\n
56603868; 45.6411; 14.2658; 595.355; 0; 7.11476; 10.7069; 0; 0.39773; 0; 5.07311e-05\n
58236632; 45.6411; 14.2658; 595.355; 0; 7.09078; 10.6611; 0; -0.350834; 0; 0.000191786\n
59911304; 45.6411; 14.2658; 595.37; 0.0150146; 6.6104; 5.86307; 0; 0.24487; 0.2; 0.0318771\n
61565775; 45.6412; 14.2658; 595.414; 0.05896; 6.59287; -8.42208; 0; -0.544803; 1; -0.0174662\n
63209949; 45.6411; 14.2658; 595.565; 0.209961; 7.81817; -5.79269; 0; 2.96276; 1; 0.264518\n
64875984; 45.6411; 14.2659; 595.92; 0.565002; 5.47531; 7.41876; 0; 6.85778; 1; 0.345894\n
66541691; 45.641; 14.266; 596.372; 1.01697; 2.25757; 3.637; 0; 14.7185; 1; 0.723768\n
68222529; 45.6408; 14.2662; 601.024; 5.66901; 14.9549; 0.874058; 0; 15.8707; 1; 3.92808\n
69878570; 45.6406; 14.2663; 608.04; 12.685; 17.0272; 0.354585; 0; 15.1373; 1; 4.3943\n
71596200; 45.6404; 14.2664; 615.231; 19.876; 15.7339; 10.4305; 0; 14.7009; 1; 3.91033\n
73234115; 45.6403; 14.2664; 621.384; 26.029; 13.8257; 16.4102; 0; 14.9923; 1; 3.60226\n
74870121; 45.6401; 14.2664; 627.364; 32.009; 13.6833; 17.1158; 0; 15.163; 1; 3.56657\n
76551692; 45.6399; 14.2663; 633.61; 38.255; 13.9717; 17.1559; 0; 15.3648; 1; 3.65774\n
78238079; 45.6398; 14.266; 640.063; 44.708; 14.3774; 16.8626; 0; 15.4085; 1; 3.79387\n
79913907; 45.6398; 14.2657; 646.476; 51.121; 14.3625; 16.7883; 0; 15.2824; 1; 3.78625\n
81580663; 45.6398; 14.2655; 652.811; 57.456; 14.4; 16.7988; 0; 15.2644; 1; 3.72985\n
83229129; 45.6399; 14.2652; 659.397; 64.042; 19.2064; -4.21334; 0; 14.8173; 0.8; 4.45395\n
84932596; 45.64; 14.265; 666.86; 71.505; 19.0092; -6.32396; 0; 13.8276; 0.8; 4.20562\n
86532622; 45.6401; 14.2648; 673.487; 78.132; 18.4048; -0.644627; 0; 13.4422; 0.8; 3.99394\n
88168977; 45.6401; 14.2646; 679.931; 84.576; 16.6414; 0.999718; 0; 13.4101; 0.8; 3.74593\n
89827899; 45.6402; 14.2644; 685.794; 90.439; 12.5774; 21.3303; 0; 13.8229; 0.8; 3.32594\n
91502517; 45.6404; 14.2643; 690.1; 94.745; 6.74677; 33.9622; 0; 15.4838; 0.8; 1.87387\n
93244887; 45.6406; 14.2643; 693.534; 98.179; 6.18782; 36.0097; 0; 16.6723; 0.69; 1.96237\n
94891834; 45.6407; 14.2646; 698.25; 102.895; 13.2196; -4.12677; 0; 16.6352; 0.61; 3.64505\n
96572640; 45.6409; 14.2648; 704.308; 108.953; 11.5581; -31.0408; 0; 15.7274; 0.68; 2.94197\n
98166895; 45.641; 14.265; 708.085; 112.73; 7.8721; -35.6; 0; 16.2858; 0.68; 2.041\n
99913843; 45.6413; 14.2649; 712.354; 116.999; 9.18767; -36.0896; 0; 16.6573; 0.71; 2.29843\n
101571380; 45.6414; 14.2647; 717.291; 121.936; 11.4876; -18.8475; 0; 16.364; 0.71; 3.47576\n
103207722; 45.6415; 14.2645; 723.835; 128.48; 14.5856; 1.76765; 0; 15.3546; 0.75; 4.13083\n
104872702; 45.6416; 14.2642; 729.696; 134.341; 11.6993; 0.249727; 0; 15.1928; 0.75; 3.37296\n
106519016; 45.6417; 14.264; 734.997; 139.642; 11.4019; -3.40923; 0; 15.4443; 0.71; 3.24772\n
108212477; 45.6418; 14.2637; 740.582; 145.227; 11.4853; -3.1054; 0; 15.4808; 0.69; 3.30155\n
109830095; 45.6419; 14.2635; 745.816; 150.461; 10.1919; -1.82978; 0; 15.4287; 0.59; 3.17775\n
111476548; 45.642; 14.2632; 750.386; 155.031; 7.43096; -2.04833; 0; 15.6919; 0.38; 2.43653\n
113242498; 45.6421; 14.263; 754.376; 159.021; 5.2848; -2.56734; 0; 16.175; 0.34; 2.1304\n
114809690; 45.6422; 14.2627; 757.443; 162.088; 3.63239; -2.24168; 0; 16.6139; 0.27; 1.87008\n
116517227; 45.6423; 14.2624; 760.251; 164.896; 2.27075; -2.29646; 0; 17.0294; 0.2; 1.44779\n
118162591; 45.6425; 14.2621; 762.347; 166.992; 0.805022; -2.1561; 0; 17.4011; 0.2; 1.14154\n
119870935; 45.6426; 14.2618; 764.057; 168.702; -0.400386; -2.05305; 0; 17.8383; 0.2; 0.907878\n
121567878; 45.6427; 14.2615; 765.353; 169.998; -1.27166; -2.01634; 0; 18.2438; 0.2; 0.631022\n
123209428; 45.6428; 14.2612; 766.199; 170.844; -2.19227; -1.98548; 0; 18.5418; 0.2; 0.430307\n
124881637; 45.6429; 14.2609; 766.675; 171.32; -2.98153; -1.69631; 0; 18.8187; 0.2; 0.223551\n
126523765; 45.6431; 14.2606; 766.798; 171.443; -3.69315; -1.74179; 0; 19.1412; 0.2; -0.00914227\n
128227555; 45.6432; 14.2603; 766.67; 171.315; -4.44126; -1.87262; 0; 19.3194; 0.2; -0.110746\n
129894813; 45.6433; 14.2599; 766.322; 170.967; -4.94231; -1.67774; 0; 19.4359; 0.2; -0.233203\n
131584402; 45.6434; 14.2596; 765.708; 170.353; -5.3967; -1.6242; 0; 19.6149; 0.2; -0.409852\n
133199470; 45.6436; 14.2593; 764.767; 169.412; -6.17245; -1.69377; 0; 19.814; 0.2; -0.646294\n
134833525; 45.6437; 14.2589; 763.504; 168.149; -6.60777; -1.92379; 0; 19.9661; 0.2; -0.767861\n
136597200; 45.6438; 14.2586; 762.081; 166.726; -6.55855; -1.72005; 0; 20.1008; 0.2; -0.742774\n
138231641; 45.644; 14.2582; 760.802; 165.447; -6.49795; -1.65233; 0; 20.1282; 0.2; -0.727149\n
139851498; 45.6441; 14.2579; 759.559; 164.204; -6.62035; -1.7905; 0; 20.12; 0.2; -0.723309\n
141575195; 45.6442; 14.2575; 758.293; 162.938; -6.57307; -1.74405; 0; 20.1359; 0.2; -0.696977\n
143215019; 45.6444; 14.2572; 757.079; 161.724; -6.40791; -1.75595; 0; 20.0858; 0.2; -0.711641\n
144882966; 45.6445; 14.2569; 755.849; 160.494; -6.24496; -1.63279; 0; 20.1306; 0.2; -0.696926\n
146537631; 45.6446; 14.2565; 754.679; 159.324; -6.03117; -1.77583; 0; 20.106; 0.2; -0.653539\n
148217434; 45.6447; 14.2562; 753.583; 158.228; -5.8993; -1.72244; 0; 20.0421; 0.2; -0.599262\n
149885350; 45.6449; 14.2558; 752.597; 157.242; -5.68439; -1.56798; 0; 20.0442; 0.2; -0.557124\n
151530142; 45.645; 14.2555; 751.696; 156.341; -5.46501; -1.34135; 0; 19.9756; 0.2; -0.537287\n
153213208; 45.6451; 14.2552; 750.825; 155.47; -5.36455; -1.66157; 0; 19.8948; 0.2; -0.483925\n
154898904; 45.6452; 14.2548; 750.099; 154.744; -5.11174; -1.61973; 0; 19.8483; 0.2; -0.412222\n
156546366; 45.6454; 14.2545; 749.444; 154.089; -4.91365; -1.64232; 0; 19.7764; 0.2; -0.38794\n
158214663; 45.6455; 14.2541; 748.814; 153.459; -4.70592; -1.49298; 0; 19.7643; 0.2; -0.337072\n
159898654; 45.6456; 14.2538; 748.328; 152.973; -4.49151; -1.56272; 0; 19.7136; 0.2; -0.256878\n
161566395; 45.6457; 14.2535; 747.915; 152.56; -4.33458; -1.70458; 0; 19.6411; 0.2; -0.243145\n
163151841; 45.6459; 14.2531; 747.554; 152.199; -4.29561; -1.97476; 0; 19.6281; 0.2; -0.201835\n
164912730; 45.646; 14.2528; 747.294; 151.939; -4.14312; -1.78823; 0; 19.5494; 0.2; -0.120037\n
166544543; 45.6461; 14.2525; 747.13; 151.775; -4.01851; -2.09801; 0; 19.5041; 0.2; -0.083002\n
168176528; 45.6462; 14.2521; 746.892; 151.537; -4.14877; -26.9265; 0; 19.4475; 0.2; -0.272013\n
169823223; 45.6463; 14.2518; 746.229; 150.874; -4.89968; 19.4541; 0; 19.6092; 0.2; -0.244855\n
171581116; 45.6464; 14.2514; 744.535; 149.18; -8.54854; 34.1025; 0; 20.1066; 0.2; -1.71637\n
173225770; 45.6466; 14.2512; 741.389; 146.034; -9.41625; 30.9593; 0; 20.7574; 0.2; -2.14159\n
174927199; 45.6469; 14.2512; 739.181; 143.826; -6.67552; 2.55321; 0; 20.7299; 0.2; -0.995733\n
176546587; 45.6472; 14.2512; 737.458; 142.103; -8.28208; -2.42241; 0; 20.5087; 0.2; -1.33235\n
178222816; 45.6475; 14.2512; 734.592; 139.237; -9.43219; -0.917105; 0; 20.8121; 0.2; -1.71124\n
179882937; 45.6477; 14.2512; 731.558; 136.203; -9.31604; -1.46045; 0; 21.008; 0.2; -1.73299\n
181557651; 45.648; 14.2513; 728.545; 133.19; -9.3035; -2.07347; 0; 21.0407; 0.2; -1.67463\n
183214507; 45.6483; 14.2513; 725.66; 130.305; -9.22062; -2.29226; 0; 21.0024; 0.2; -1.64327\n
184873760; 45.6486; 14.2513; 722.765; 127.41; -9.20547; -2.08862; 0; 21.0137; 0.2; -1.65136\n
186551770; 45.6489; 14.2513; 719.82; 124.465; -9.24807; -2.04597; 0; 21.0645; 0.2; -1.67292\n
188180973; 45.6491; 14.2513; 717.083; 121.728; -8.79608; -1.93302; 0; 21.0155; 0.2; -1.52138\n
189851566; 45.6494; 14.2514; 714.541; 119.186; -8.49284; -1.74762; 0; 20.8959; 0.2; -1.3932\n
191491880; 45.6497; 14.2514; 712.244; 116.889; -8.05677; -1.67892; 0; 20.7681; 0.2; -1.26823\n
193254012; 45.65; 14.2514; 709.918; 114.563; -7.57655; -1.62697; 0; 20.7338; 0.2; -1.18161\n
194900797; 45.6503; 14.2514; 707.984; 112.629; -7.25087; -1.33134; 0; 20.6085; 0.2; -1.03478\n
196582779; 45.6506; 14.2514; 706.288; 110.933; -6.80441; -1.44338; 0; 20.4394; 0.2; -0.842089\n
198225541; 45.6508; 14.2514; 704.848; 109.493; -6.52879; -1.49739; 0; 20.347; 0.2; -0.731891\n
199871398; 45.6511; 14.2515; 703.585; 108.23; -6.0932; -1.8507; 0; 20.2517; 0.2; -0.643214\n
201543824; 45.6514; 14.2515; 702.468; 107.113; -5.8626; -1.66795; 0; 20.1108; 0.2; -0.52014\n
203172390; 45.6516; 14.2515; 701.572; 106.217; -5.44285; -1.31615; 0; 20.0112; 0.2; -0.411115\n
204924915; 45.6519; 14.2515; 700.754; 105.399; -5.13201; -1.33199; 0; 19.9171; 0.2; -0.372776\n
206544667; 45.6522; 14.2515; 700.099; 104.744; -4.83368; -1.67843; 0; 19.8748; 0.2; -0.283565\n
208196824; 45.6524; 14.2515; 699.561; 104.206; -4.44598; -1.93838; 0; 19.8068; 0.2; -0.218445\n
209870602; 45.6527; 14.2515; 699.142; 103.787; -4.23763; -1.90832; 0; 19.7362; 0.2; -0.13332\n
211553305; 45.653; 14.2515; 698.842; 103.487; -3.99258; -1.95928; 0; 19.6222; 0.2; -0.077138\n
213227183; 45.6532; 14.2516; 698.619; 103.264; -3.78513; -1.80629; 0; 19.5373; 0.2; -0.0146916\n
214927661; 45.6535; 14.2516; 698.511; 103.156; -3.60123; -1.73115; 0; 19.5178; 0.2; 0.0461141\n
216482811; 45.6538; 14.2516; 698.495; 103.14; -3.52684; -1.59514; 0; 19.4768; 0.2; 0.107719\n
218153590; 45.654; 14.2516; 698.538; 103.183; -3.30339; -1.86438; 0; 19.3999; 0.2; 0.118429\n
219936439; 45.6543; 14.2516; 698.586; 103.231; -3.14556; -1.90982; 0; 19.3876; 0.2; 0.106117\n
221577007; 45.6545; 14.2516; 698.675; 103.32; -3.0302; -1.93981; 0; 19.3869; 0.2; 0.169572\n
223209467; 45.6548; 14.2516; 698.844; 103.489; -2.99187; -2.06195; 0; 19.3267; 0.2; 0.213223\n
224861179; 45.6551; 14.2516; 699.056; 103.701; -2.96689; -2.01503; 0; 19.3121; 0.2; 0.230088\n
226511473; 45.6553; 14.2516; 699.298; 103.943; -2.91764; -2.15922; 0; 19.3022; 0.2; 0.235764\n
228159491; 45.6556; 14.2516; 699.486; 104.131; -3.06718; -25.308; 0; 19.2698; 0.2; 0.0893105\n
229891585; 45.6558; 14.2515; 699.416; 104.061; -2.1535; 18.5274; 0; 19.3364; 0.2; 0.289549\n
231544470; 45.6561; 14.2515; 699.699; 104.344; -3.22328; 33.2838; 0; 19.3437; 0.35; -0.0945171\n
233223882; 45.6563; 14.2517; 700.535; 105.18; 1.68181; 6.69335; 0; 19.2767; 0.46; 1.3552\n
234881045; 45.6565; 14.2519; 704.207; 108.852; 4.92636; -3.8096; 0; 18.3576; 0.58; 2.561\n
236521810; 45.6567; 14.2522; 707.952; 112.597; 4.84764; -1.9049; 0; 17.8169; 0.69; 2.51741\n
238265680; 45.6569; 14.2524; 712.1; 116.745; 5.70899; -1.09752; 0; 17.6107; 0.77; 2.6651\n
239895841; 45.6571; 14.2526; 716.351; 120.996; 6.74524; -2.1224; 0; 17.4676; 0.8; 2.84658\n
241543349; 45.6572; 14.2528; 720.966; 125.611; 7.47894; -2.8757; 0; 17.1117; 0.8; 2.98831\n
243181267; 45.6574; 14.253; 725.449; 130.094; 6.34117; -2.87805; 0; 17.1025; 0.8; 2.67833\n
244840498; 45.6576; 14.2532; 729.334; 133.979; 4.95481; -2.72771; 0; 17.1711; 0.7; 2.29853\n
246565102; 45.6577; 14.2535; 732.762; 137.407; 3.88434; -2.84621; 0; 17.3974; 0.55; 1.91782\n
248216537; 45.6579; 14.2537; 735.603; 140.248; 2.77666; -2.53736; 0; 17.5688; 0.41; 1.7265\n
249822628; 45.6581; 14.2539; 738.018; 142.663; 1.72318; -2.59647; 0; 17.6758; 0.3; 1.52021\n
251575928; 45.6583; 14.2541; 740.236; 144.881; 0.995379; -2.66994; 0; 17.9186; 0.24; 1.25479\n
253213754; 45.6585; 14.2543; 741.966; 146.611; 0.186859; -2.68126; 0; 18.0192; 0.2; 1.04836\n
254836215; 45.6587; 14.2545; 743.326; 147.971; -0.511754; -2.87405; 0; 18.2739; 0.2; 0.873698\n
256600941; 45.6589; 14.2548; 744.398; 149.043; -1.64376; 29.0999; 0; 18.5306; 0.2; 0.293711\n
258252602; 45.659; 14.2551; 744.222; 148.867; -2.51913; 33.5898; 0; 19.0915; 0.2; -0.165521\n
259861166; 45.6589; 14.2554; 745.571; 150.216; 3.79858; 5.5334; 0; 18.8436; 0.22; 1.53605\n
261545117; 45.6588; 14.2558; 749.535; 154.18; 5.70398; -3.48447; 0; 17.4871; 0.33; 2.56109\n
263244787; 45.6587; 14.2561; 753.241; 157.886; 4.94556; -1.76337; 0; 17.1769; 0.38; 2.34856\n
264897984; 45.6586; 14.2564; 756.859; 161.504; 5.57604; -1.60298; 0; 17.0845; 0.44; 2.43082\n
266571494; 45.6585; 14.2567; 760.819; 165.464; 6.35129; -2.57552; 0; 16.9528; 0.52; 2.65129\n
268214032; 45.6584; 14.257; 765.01; 169.655; 7.07186; -2.96864; 0; 16.7923; 0.58; 2.76338\n
269877254; 45.6583; 14.2572; 769.508; 174.153; 7.4536; -2.7414; 0; 16.6695; 0.6; 2.87911\n
271570708; 45.6583; 14.2575; 773.846; 178.491; 5.98903; -2.59118; 0; 16.5649; 0.45; 2.40779\n
273216371; 45.6582; 14.2578; 777.231; 181.876; 4.20262; -2.6447; 0; 16.7746; 0.3; 1.97663\n
274863872; 45.6581; 14.2581; 780.019; 184.664; 2.93028; -2.4993; 0; 17.0112; 0.2; 1.66713\n
276594884; 45.658; 14.2584; 782.51; 187.155; 2.09738; -2.32984; 0; 17.3973; 0.2; 1.40963\n
278226427; 45.6579; 14.2587; 784.612; 189.257; 1.33115; -2.30263; 0; 17.6497; 0.2; 1.28244\n
279927309; 45.6578; 14.2591; 786.506; 191.151; 0.433215; -2.28212; 0; 17.8006; 0.2; 1.10174\n
281505025; 45.6577; 14.2594; 787.979; 192.624; -0.122544; -2.47951; 0; 18.183; 0.2; 0.876037\n
283247285; 45.6576; 14.2597; 789.269; 193.914; -0.822508; -2.31864; 0; 18.3508; 0.2; 0.709367\n
284875270; 45.6575; 14.26; 790.192; 194.837; -1.50047; -2.50053; 0; 18.5876; 0.2; 0.563629\n
286572390; 45.6574; 14.2604; 790.94; 195.585; -1.98632; -2.45191; 0; 18.7907; 0.2; 0.407227\n
288195352; 45.6573; 14.2607; 791.435; 196.08; -2.51475; -2.28164; 0; 18.8656; 0.2; 0.271679\n
289926110; 45.6572; 14.261; 791.731; 196.376; -2.99221; -2.21328; 0; 19.0583; 0.2; 0.162587\n
291585065; 45.6571; 14.2614; 791.843; 196.488; -3.28228; -2.14126; 0; 19.1977; 0.2; 0.0423608\n
293231374; 45.657; 14.2617; 791.791; 196.436; -3.67285; -1.99657; 0; 19.2894; 0.2; -0.0509952\n
294885620; 45.6569; 14.2621; 791.603; 196.248; -3.94018; -1.9427; 0; 19.3898; 0.2; -0.113932\n
296496648; 45.6568; 14.2624; 791.32; 195.965; -4.13253; -1.92886; 0; 19.4712; 0.2; -0.200255\n
298262541; 45.6567; 14.2628; 790.9; 195.545; -4.36857; -2.19455; 0; 19.503; 0.2; -0.246053\n
299894904; 45.6566; 14.2631; 790.471; 195.116; -4.55544; -2.15357; 0; 19.5464; 0.2; -0.239632\n
301567910; 45.6565; 14.2635; 789.988; 194.633; -4.69072; -2.07836; 0; 19.6032; 0.2; -0.288622\n
303233035; 45.6564; 14.2638; 789.442; 194.087; -4.79498; -1.98899; 0; 19.6692; 0.2; -0.327183\n
304897538; 45.6563; 14.2642; 788.87; 193.515; -4.78051; -2.04548; 0; 19.6595; 0.2; -0.333207\n
306565662; 45.6562; 14.2645; 788.284; 192.929; -4.84894; -1.86122; 0; 19.719; 0.2; -0.336686\n
308224832; 45.6561; 14.2649; 787.716; 192.361; -4.83925; -1.96375; 0; 19.7018; 0.2; -0.332522\n
309885804; 45.656; 14.2652; 787.144; 191.789; -4.74338; -2.14098; 0; 19.6945; 0.2; -0.340265\n
311573402; 45.6559; 14.2656; 786.511; 191.156; -4.72494; -2.1735; 0; 19.7035; 0.2; -0.364898\n
313229433; 45.6558; 14.2659; 785.939; 190.584; -4.58703; -2.22293; 0; 19.7186; 0.2; -0.32085\n
314912627; 45.6557; 14.2663; 785.388; 190.033; -4.51309; -2.03718; 0; 19.6932; 0.2; -0.317896\n
316539872; 45.6556; 14.2666; 784.871; 189.516; -4.402; -2.01746; 0; 19.688; 0.2; -0.285816\n
318192650; 45.6555; 14.267; 784.4; 189.045; -4.38199; -2.25029; 0; 19.6733; 0.2; -0.246738\n
319851924; 45.6554; 14.2673; 783.976; 188.621; -4.29742; -2.23866; 0; 19.6354; 0.2; -0.240374\n
321546454; 45.6553; 14.2677; 783.595; 188.24; -4.20112; -2.05042; 0; 19.5842; 0.2; -0.197641\n
323164813; 45.6552; 14.268; 783.257; 187.902; -4.11679; -1.9228; 0; 19.5531; 0.2; -0.183624\n
324910393; 45.6551; 14.2684; 782.942; 187.587; -4.01578; -1.87934; 0; 19.5285; 0.2; -0.160737\n
326524046; 45.655; 14.2688; 782.698; 187.343; -3.97676; -1.96522; 0; 19.5503; 0.2; -0.120482\n
328219900; 45.6549; 14.2691; 782.512; 187.157; -3.94552; -1.95238; 0; 19.4866; 0.2; -0.0785947\n
329890511; 45.6548; 14.2695; 782.361; 187.006; -3.85785; -1.83273; 0; 19.4466; 0.2; -0.0753843\n
331563375; 45.6547; 14.2698; 782.174; 186.819; -3.80132; -1.93208; 0; 19.5052; 0.2; -0.0928175\n
333182775; 45.6546; 14.2702; 782.038; 186.683; -3.69343; -1.92377; 0; 19.4259; 0.2; -0.0530631\n
334854869; 45.6545; 14.2705; 781.924; 186.569; -3.62841; -2.02939; 0; 19.4494; 0.2; -0.0447712\n
336581363; 45.6544; 14.2709; 781.831; 186.476; -3.54657; -2.08891; 0; 19.444; 0.2; -0.0276387\n
338218506; 45.6543; 14.2712; 781.748; 186.393; -3.46686; -2.25472; 0; 19.4131; 0.2; -0.0281872\n
339935013; 45.6542; 14.2716; 781.675; 186.32; -3.45278; -2.38717; 0; 19.3833; 0.2; -0.0257137\n
341548012; 45.6541; 14.2719; 781.657; 186.302; -3.43772; -2.36459; 0; 19.362; 0.2; 0.0150339\n
343167380; 45.654; 14.2722; 781.686; 186.331; -3.43794; -2.46404; 0; 19.3765; 0.2; 0.0332936\n
344889929; 45.6539; 14.2726; 781.727; 186.372; -3.41241; -2.38648; 0; 19.307; 0.2; 0.0361484\n
346552067; 45.6538; 14.273; 781.769; 186.414; -3.40063; -2.28894; 0; 19.3035; 0.2; 0.0270062\n
348168736; 45.6537; 14.2733; 781.776; 186.421; -3.37608; -2.2354; 0; 19.3793; 0.2; 0.0148963\n
349901381; 45.6536; 14.2737; 781.796; 186.441; -3.25843; -2.24201; 0; 19.3842; 0.2; 0.012385\n
351522377; 45.6535; 14.274; 781.828; 186.473; -3.2836; -2.23024; 0; 19.3505; 0.2; 0.0391743\n
353259889; 45.6535; 14.2744; 781.902; 186.547; -3.30356; -2.28348; 0; 19.3471; 0.2; 0.0566743\n
354860489; 45.6534; 14.2747; 781.987; 186.632; -3.31783; -2.43822; 0; 19.3273; 0.2; 0.0570984\n
356574197; 45.6533; 14.2751; 782.026; 186.671; -3.27879; -2.52278; 0; 19.352; 0.2; 0.0177171\n
358228058; 45.6532; 14.2754; 782.028; 186.673; -3.21508; -2.55816; 0; 19.3696; 0.2; 0.00494097\n
359897153; 45.6531; 14.2758; 782.025; 186.67; -3.24221; -2.14614; 0; 19.3468; 0.2; 0.00790323\n
361539955; 45.653; 14.2761; 782.072; 186.717; -3.19884; -2.42136; 0; 19.2998; 0.2; 0.0481081\n
363262372; 45.6529; 14.2765; 782.13; 186.775; -3.2011; -2.85518; 0; 19.3356; 0.2; 0.0406296\n
364881449; 45.6528; 14.2768; 782.172; 186.817; -3.2763; -15.8974; 0; 19.344; 0.2; 0.0334191\n
366549553; 45.6528; 14.2772; 781.969; 186.614; -4.3755; 21.7171; 0; 19.3776; 0.2; -0.386368\n
368232931; 45.6526; 14.2775; 779.869; 184.514; -8.49508; 34.5252; 0; 20.1008; 0.2; -1.90541\n
369873650; 45.6524; 14.2777; 776.666; 181.311; -8.51415; 34.9005; 0; 20.7689; 0.2; -2.18445\n
371593172; 45.6521; 14.2776; 773.625; 178.27; -8.36521; 34.8616; 0; 20.8994; 0.2; -2.04914\n
373255465; 45.6519; 14.2773; 770.642; 175.287; -8.0856; 15.6379; 0; 21.0068; 0.2; -1.80908\n
374880789; 45.6518; 14.2769; 768.504; 173.149; -7.84259; -1.32785; 0; 20.7883; 0.2; -1.26117\n
376593879; 45.6516; 14.2766; 765.56; 170.205; -9.27252; -1.48407; 0; 20.9229; 0.2; -1.80884\n
378228266; 45.6515; 14.2762; 762.484; 167.129; -9.37002; -1.33158; 0; 21.0851; 0.2; -1.82882\n
379895867; 45.6514; 14.2758; 759.464; 164.109; -9.29824; -2.15109; 0; 21.0744; 0.2; -1.79232\n
381564300; 45.6513; 14.2755; 756.528; 161.173; -9.23499; -2.38108; 0; 21.0241; 0.2; -1.78183\n
383223868; 45.6511; 14.2751; 753.609; 158.254; -9.2483; -2.3047; 0; 21.0049; 0.2; -1.8001\n
384896629; 45.651; 14.2748; 750.646; 155.291; -9.24042; -2.21493; 0; 21.0355; 0.2; -1.80151\n
386567812; 45.6509; 14.2744; 747.705; 152.35; -9.23222; -2.15602; 0; 21.0044; 0.2; -1.79315\n
388222537; 45.6508; 14.274; 744.789; 149.434; -9.23641; -1.93811; 0; 21.0214; 0.2; -1.80998\n
389904422; 45.6506; 14.2737; 741.805; 146.45; -9.25037; -1.96319; 0; 21.0385; 0.2; -1.81755\n
391560108; 45.6505; 14.2733; 738.881; 143.526; -9.291; -1.83615; 0; 21.0212; 0.2; -1.79829\n
393236457; 45.6504; 14.2729; 735.982; 140.627; -9.18716; -1.9133; 0; 21.0149; 0.2; -1.7934\n
394915231; 45.6503; 14.2726; 733.04; 137.685; -9.2265; -1.82994; 0; 21.0379; 0.2; -1.80296\n
396556410; 45.6501; 14.2722; 730.128; 134.773; -9.28219; -1.87146; 0; 21.0739; 0.2; -1.80643\n
398226899; 45.65; 14.2719; 727.211; 131.856; -9.27785; -1.96444; 0; 21.009; 0.2; -1.76647\n
399839050; 45.6499; 14.2715; 724.466; 129.111; -9.24974; -2.09445; 0; 20.9937; 0.2; -1.76609\n
401562102; 45.6498; 14.2711; 721.475; 126.12; -9.19722; -2.05794; 0; 21.0228; 0.2; -1.80029\n
403204769; 45.6496; 14.2708; 718.627; 123.272; -9.12173; -2.01889; 0; 20.9845; 0.2; -1.78249\n
404926540; 45.6495; 14.2704; 715.697; 120.342; -8.8937; -2.27523; 0; 21.0283; 0.2; -1.75172\n
406542954; 45.6494; 14.27; 713.033; 117.678; -8.59399; -2.25003; 0; 21.0059; 0.2; -1.69151\n
408251581; 45.6493; 14.2697; 710.343; 114.988; -8.2714; -2.05412; 0; 20.9223; 0.2; -1.6107\n
409883569; 45.6491; 14.2693; 707.984; 112.629; -8.02095; -2.16785; 0; 20.881; 0.2; -1.45587\n
411573115; 45.649; 14.269; 705.82; 110.465; -7.76863; -2.10447; 0; 20.6609; 0.2; -1.33861\n
413173839; 45.6489; 14.2686; 703.882; 108.527; -7.41983; -2.33201; 0; 20.6433; 0.2; -1.26941\n
414816208; 45.6488; 14.2683; 702.025; 106.67; -6.97292; -2.31161; 0; 20.5724; 0.2; -1.17743\n
416500269; 45.6486; 14.2679; 700.291; 104.936; -6.62225; -2.2687; 0; 20.4581; 0.2; -1.04258\n
418247828; 45.6485; 14.2675; 698.693; 103.338; -6.06318; -2.35972; 0; 20.3746; 0.2; -0.931581\n
419911552; 45.6484; 14.2672; 697.315; 101.96; -5.62595; -2.07193; 0; 20.308; 0.2; -0.861084\n
421573520; 45.6483; 14.2668; 696.146; 100.791; -5.2788; -2.08059; 0; 20.1996; 0.2; -0.6962\n
423226423; 45.6481; 14.2665; 695.19; 99.835; -4.92807; -2.09758; 0; 20.0733; 0.2; -0.575857\n
424882349; 45.648; 14.2662; 694.361; 99.006; -4.62708; -1.99305; 0; 19.9471; 0.2; -0.546499\n
426558553; 45.6479; 14.2658; 693.678; 98.323; -4.35768; -2.15891; 0; 19.8913; 0.2; -0.399\n
428233842; 45.6478; 14.2655; 693.173; 97.818; -4.1787; -2.0233; 0; 19.7862; 0.2; -0.338459\n
429922696; 45.6477; 14.2651; 692.797; 97.442; -3.91593; -2.2024; 0; 19.7354; 0.2; -0.263095\n
431595668; 45.6475; 14.2648; 692.548; 97.193; -3.74633; -2.32304; 0; 19.6304; 0.2; -0.168734\n
433220845; 45.6474; 14.2645; 692.415; 97.06; -3.55594; -2.2349; 0; 19.5684; 0.2; -0.110952\n
434828439; 45.6473; 14.2641; 692.34; 96.985; -3.35167; -2.17618; 0; 19.5308; 0.2; -0.0986899\n
436550155; 45.6472; 14.2638; 692.275; 96.92; -3.21061; -2.34254; 0; 19.5342; 0.2; -0.0756004\n
438166942; 45.6471; 14.2635; 692.288; 96.933; -3.08432; -2.60529; 0; 19.4462; 0.2; -0.0215696\n
439891528; 45.647; 14.2631; 692.405; 97.05; -3.09292; -2.06484; 0; 19.3992; 0.2; 0.0269946\n
441557445; 45.6468; 14.2628; 692.614; 97.259; -3.03229; -2.15699; 0; 19.3412; 0.2; 0.0615335\n
443173931; 45.6467; 14.2625; 692.809; 97.454; -2.98752; -2.27392; 0; 19.3298; 0.2; 0.0390473\n
444926984; 45.6466; 14.2621; 692.983; 97.628; -2.89676; -2.22168; 0; 19.3437; 0.2; 0.0232798\n
446563450; 45.6465; 14.2618; 693.145; 97.79; -2.85954; -2.16231; 0; 19.3529; 0.2; 0.0390121\n
448175505; 45.6464; 14.2615; 693.361; 98.006; -2.83737; -2.07105; 0; 19.2877; 0.2; 0.0839041\n
449880212; 45.6462; 14.2611; 693.653; 98.298; -2.93304; -2.26001; 0; 19.3067; 0.2; 0.114274\n
451558191; 45.6461; 14.2608; 693.957; 98.602; -2.99026; -2.35759; 0; 19.2277; 0.2; 0.110785\n
453267203; 45.646; 14.2605; 694.242; 98.887; -3.01258; -2.17586; 0; 19.2743; 0.2; 0.0848343\n
454895308; 45.6459; 14.2601; 694.459; 99.104; -3.01618; -2.50063; 0; 19.2576; 0.2; 0.049315\n
456515662; 45.6458; 14.2598; 694.646; 99.291; -2.94238; -2.64471; 0; 19.3147; 0.2; 0.0260053\n
458262623; 45.6456; 14.2595; 694.802; 99.447; -2.94906; -2.57836; 0; 19.3446; 0.2; 0.0040902\n
459879389; 45.6455; 14.2591; 694.932; 99.577; -2.92663; -2.32787; 0; 19.3268; 0.2; 0.00364638\n
461502796; 45.6454; 14.2588; 695.072; 99.717; -2.90288; -2.30008; 0; 19.3165; 0.2; 0.0107653\n
463227517; 45.6453; 14.2585; 695.203; 99.848; -2.92502; -2.55097; 0; 19.3934; 0.2; -0.0015424\n
464839533; 45.6452; 14.2582; 695.333; 99.978; -2.90084; -2.46323; 0; 19.3552; 0.2; 0.0145489\n
466544716; 45.645; 14.2578; 695.454; 100.099; -2.92469; -2.32331; 0; 19.3958; 0.2; -0.0277817\n
468258078; 45.6449; 14.2575; 695.547; 100.192; -2.94882; -2.24472; 0; 19.3722; 0.2; -0.0105431\n
469880578; 45.6448; 14.2572; 695.62; 100.265; -3.01657; -2.36446; 0; 19.4147; 0.2; -0.0373467\n
471583911; 45.6447; 14.2568; 695.721; 100.366; -3.09999; -2.4592; 0; 19.3584; 0.2; -0.00239289\n
473185506; 45.6445; 14.2565; 695.844; 100.489; -3.07298; -2.43816; 0; 19.389; 0.2; -0.011842\n
474911520; 45.6444; 14.2562; 695.924; 100.569; -3.19821; -2.57834; 0; 19.3875; 0.2; -0.038281\n
476552161; 45.6443; 14.2558; 695.992; 100.637; -3.11396; -2.76298; 0; 19.4101; 0.2; -0.0526454\n
478264302; 45.6442; 14.2555; 696.027; 100.672; -3.15658; -2.9353; 0; 19.4298; 0.2; -0.0602664\n
479880945; 45.6441; 14.2552; 696.037; 100.682; -3.14919; -2.82193; 0; 19.431; 0.2; -0.0778798\n
481545964; 45.6439; 14.2549; 696.034; 100.679; -3.19561; -2.63126; 0; 19.4319; 0.2; -0.0803543\n
483190297; 45.6438; 14.2545; 696.058; 100.703; -3.15873; -2.47983; 0; 19.4217; 0.2; -0.0628066\n
484915816; 45.6437; 14.2542; 696.061; 100.706; -3.22613; -2.7227; 0; 19.3905; 0.2; -0.0773068\n
486589695; 45.6435; 14.2539; 696.072; 100.717; -3.20729; -2.63435; 0; 19.4182; 0.2; -0.0671071\n
488249922; 45.6434; 14.2535; 696.074; 100.719; -3.27102; -2.67436; 0; 19.439; 0.2; -0.0847304\n
489928346; 45.6433; 14.2532; 696.096; 100.741; -3.35734; -2.69696; 0; 19.4574; 0.2; -0.0503394\n
491572381; 45.6431; 14.2529; 696.133; 100.778; -3.33187; -2.72604; 0; 19.3981; 0.2; -0.0763777\n
493225379; 45.643; 14.2526; 696.104; 100.749; -3.3652; -2.64328; 0; 19.4058; 0.2; -0.102427\n
494882103; 45.6429; 14.2523; 695.641; 100.286; -5.16727; -32.497; 0; 19.4695; 0.2; -0.621418\n
496506918; 45.6426; 14.2521; 693.588; 98.233; -7.36382; -35.1643; 0; 20.2763; 0.2; -1.73956\n
498263825; 45.6423; 14.2521; 691.4; 96.045; -6.34169; -34.924; 0; 20.4827; 0.2; -1.33072\n
499904105; 45.6421; 14.2523; 690.482; 95.127; -3.95996; -11.9811; 0; 20.2216; 0.2; -0.333091\n
501512576; 45.6419; 14.2526; 690.771; 95.416; -3.50644; -2.0297; 0; 19.6146; 0.2; 0.18063\n
503260770; 45.6417; 14.2529; 690.586; 95.231; -4.33589; -2.38753; 0; 19.5675; 0.2; -0.185616\n
504912389; 45.6416; 14.2531; 690.206; 94.851; -4.05303; -2.32316; 0; 19.6316; 0.2; -0.268876\n
506562558; 45.6414; 14.2534; 689.825; 94.47; -3.83781; -1.96548; 0; 19.6718; 0.2; -0.278924\n
508229360; 45.6412; 14.2537; 689.185; 93.83; -4.13413; -32.3607; 0; 19.7284; 0.2; -0.686053\n
509887530; 45.6412; 14.2541; 688.158; 92.803; -3.26669; -35.0858; 0; 19.986; 0.2; -0.668968\n
511512266; 45.6413; 14.2544; 688.483; 93.128; -0.337084; -20.6342; 0; 19.5406; 0.39; 0.9326\n
513182025; 45.6414; 14.2547; 691.531; 96.176; 4.19247; -1.52718; 0; 18.5803; 0.49; 2.3431\n
514867533; 45.6416; 14.255; 695.126; 99.771; 4.2542; -1.67708; 0; 18.0266; 0.58; 2.19461\n
516537667; 45.6417; 14.2552; 698.57; 103.215; 5.02832; -2.69105; 0; 17.9063; 0.7; 2.26657\n
518238653; 45.6419; 14.2555; 702.658; 107.303; 6.37549; -2.04882; 0; 17.6683; 0.76; 2.55533\n
519896527; 45.6421; 14.2557; 707.113; 111.758; 7.49584; -1.55597; 0; 17.4046; 0.8; 2.74847\n
521569363; 45.6422; 14.256; 711.803; 116.448; 8.26598; -1.79554; 0; 17.145; 0.8; 2.83853\n
523245996; 45.6423; 14.2562; 716.704; 121.349; 9.12211; -2.19292; 0; 16.9353; 0.8; 2.92377\n
524892275; 45.6425; 14.2565; 721.595; 126.24; 9.61548; -2.68704; 0; 16.7296; 0.8; 2.99836\n
526532165; 45.6426; 14.2567; 726.659; 131.304; 10.0737; -2.68944; 0; 16.4434; 0.8; 3.14092\n
528171943; 45.6428; 14.2569; 731.851; 136.496; 10.4842; -2.80356; 0; 16.2483; 0.8; 3.20946\n
529893862; 45.6429; 14.2572; 737.461; 142.106; 10.8862; -2.85557; 0; 16.0569; 0.8; 3.26386\n
531529690; 45.643; 14.2574; 742.816; 147.461; 11.2048; -2.99636; 0; 15.8814; 0.8; 3.2551\n
533164944; 45.6432; 14.2576; 748.139; 152.784; 11.5106; -2.97513; 0; 15.8684; 0.8; 3.28161\n
534893121; 45.6433; 14.2579; 753.854; 158.499; 11.7942; -3.08484; 0; 15.8153; 0.8; 3.34231\n
536558477; 45.6434; 14.2581; 759.443; 164.088; 12.0072; -2.88991; 0; 15.6752; 0.8; 3.38674\n
538239633; 45.6436; 14.2583; 765.107; 169.752; 12.0608; -2.91343; 0; 15.6059; 0.8; 3.40214\n
539899876; 45.6437; 14.2586; 770.705; 175.35; 12.0631; -3.07192; 0; 15.5001; 0.8; 3.38327\n
541514903; 45.6438; 14.2588; 776.149; 180.794; 12.318; -3.16949; 0; 15.4915; 0.8; 3.41922\n
543166020; 45.6439; 14.259; 781.618; 186.263; 11.0702; -2.98717; 0; 15.5153; 0.79; 3.16527\n
544852254; 45.6441; 14.2592; 786.488; 191.133; 8.92901; -3.09507; 0; 15.8171; 0.61; 2.76269\n
546574587; 45.6442; 14.2595; 790.739; 195.384; 7.16672; -3.05143; 0; 16.1455; 0.34; 2.29378\n
548235544; 45.6444; 14.2597; 794.201; 198.846; 5.12374; -3.11763; 0; 16.4405; 0.29; 1.9401\n
549857129; 45.6445; 14.26; 797.093; 201.738; 3.73493; -2.97173; 0; 16.7882; 0.24; 1.70242\n
551510013; 45.6446; 14.2602; 799.598; 204.243; 2.39321; -2.93906; 0; 17.1899; 0.2; 1.30943\n
553242005; 45.6448; 14.2605; 801.713; 206.358; 1.30364; -2.61955; 0; 17.5698; 0.2; 1.09462\n
554921531; 45.645; 14.2607; 803.367; 208.012; 0.347707; -2.50457; 0; 17.7864; 0.2; 0.886802\n
556511785; 45.6451; 14.261; 804.565; 209.21; -0.482601; -2.36224; 0; 18.2339; 0.2; 0.603561\n
558162014; 45.6453; 14.2612; 805.486; 210.131; -1.26936; -2.41944; 0; 18.5149; 0.2; 0.447366\n
559916974; 45.6455; 14.2615; 806.165; 210.81; -2.16309; -2.36527; 0; 18.7049; 0.2; 0.31261\n
561590633; 45.6456; 14.2618; 806.604; 211.249; -2.80166; -2.383; 0; 18.9501; 0.2; 0.169175\n
563241450; 45.6458; 14.2621; 806.763; 211.408; -3.40644; -2.28248; 0; 19.0499; 0.2; 0.000683301\n
564895567; 45.646; 14.2624; 806.62; 211.265; -3.89021; -2.41564; 0; 19.2435; 0.2; -0.154566\n
566512951; 45.6461; 14.2626; 806.286; 210.931; -4.17463; -2.52456; 0; 19.4357; 0.2; -0.286056\n
568250362; 45.6463; 14.2629; 805.724; 210.369; -4.36966; -2.30158; 0; 19.6022; 0.2; -0.374668\n
569887256; 45.6465; 14.2632; 805.022; 209.667; -4.56476; -2.62191; 0; 19.7314; 0.2; -0.454897\n
571567889; 45.6467; 14.2635; 804.197; 208.842; -4.77466; -2.55253; 0; 19.8144; 0.2; -0.483516\n
573237548; 45.6468; 14.2638; 803.351; 207.996; -4.8004; -2.41103; 0; 19.8176; 0.2; -0.492448\n
574836824; 45.647; 14.2641; 802.506; 207.151; -4.98561; -2.36042; 0; 19.8446; 0.2; -0.500878\n
576582759; 45.6472; 14.2644; 801.565; 206.21; -5.0677; -2.47075; 0; 19.8602; 0.2; -0.516336\n
578246526; 45.6474; 14.2647; 800.651; 205.296; -5.08397; -2.31746; 0; 19.8679; 0.2; -0.516603\n
579886000; 45.6476; 14.2649; 799.757; 204.402; -5.07086; -2.40723; 0; 19.9098; 0.2; -0.513481\n
581568669; 45.6477; 14.2652; 798.862; 203.507; -4.95236; -2.26684; 0; 19.9102; 0.2; -0.493869\n
583233901; 45.6479; 14.2655; 797.979; 202.624; -4.8982; -2.2432; 0; 19.8511; 0.2; -0.479627\n
584888728; 45.6481; 14.2658; 797.17; 201.815; -4.85397; -2.13608; 0; 19.8398; 0.2; -0.419112\n
586547231; 45.6483; 14.2661; 796.45; 201.095; -4.8398; -2.19912; 0; 19.8401; 0.2; -0.369304\n
588238560; 45.6485; 14.2664; 795.772; 200.417; -4.72545; -2.16265; 0; 19.7942; 0.2; -0.359577\n
589896650; 45.6486; 14.2667; 795.119; 199.764; -4.62565; -2.1652; 0; 19.8107; 0.2; -0.341214\n
591558113; 45.6488; 14.2669; 794.532; 199.177; -4.58588; -2.11579; 0; 19.7087; 0.2; -0.288165\n
593235579; 45.649; 14.2672; 794.03; 198.675; -4.39371; -2.07274; 0; 19.6858; 0.2; -0.243153\n
594850277; 45.6492; 14.2675; 793.568; 198.213; -4.34492; -2.24416; 0; 19.6736; 0.2; -0.219997\n
596592405; 45.6494; 14.2678; 793.123; 197.768; -4.14754; -2.46295; 0; 19.5885; 0.2; -0.205899\n
598243797; 45.6495; 14.2681; 792.685; 197.33; -4.0439; -2.5647; 0; 19.643; 0.2; -0.200996\n
599887583; 45.6497; 14.2683; 792.326; 196.971; -3.9168; -2.25704; 0; 19.5811; 0.2; -0.135565\n
601571354; 45.6499; 14.2686; 792.077; 196.722; -3.84868; -2.26569; 0; 19.5354; 0.2; -0.0605588\n
603198249; 45.6501; 14.2689; 791.866; 196.511; -3.76259; -2.23882; 0; 19.4817; 0.2; -0.0731269\n
604902949; 45.6502; 14.2692; 791.67; 196.315; -3.75632; -2.31031; 0; 19.5221; 0.2; -0.0325629\n
606554596; 45.6504; 14.2695; 791.582; 196.227; -3.69863; -2.28083; 0; 19.3931; 0.2; 0.0166809\n
608205777; 45.6506; 14.2697; 791.52; 196.165; -3.69975; -2.35604; 0; 19.4247; 0.2; 0.0330284\n
609867689; 45.6508; 14.27; 791.471; 196.116; -3.62593; -2.47183; 0; 19.3461; 0.2; 0.0175834\n
611506586; 45.6509; 14.2703; 791.405; 196.05; -3.5311; -2.32932; 0; 19.371; 0.2; 0.0245876\n
613255267; 45.6511; 14.2706; 791.342; 195.987; -3.43944; -2.27682; 0; 19.4113; 0.2; 0.0286782\n
614895602; 45.6513; 14.2709; 791.284; 195.929; -3.35762; -2.22679; 0; 19.3902; 0.2; 0.0270802\n
616567076; 45.6515; 14.2711; 791.26; 195.905; -3.26908; -2.28762; 0; 19.3728; 0.2; 0.0771681\n
618242451; 45.6517; 14.2714; 791.255; 195.9; -3.26569; -2.48575; 0; 19.3823; 0.2; 0.0694316\n
619857381; 45.6518; 14.2717; 791.28; 195.925; -3.24168; -2.1451; 0; 19.3526; 0.2; 0.100856\n
621512673; 45.652; 14.2719; 791.341; 195.986; -3.22177; -2.14126; 0; 19.3275; 0.2; 0.105636\n
623174759; 45.6522; 14.2722; 791.385; 196.03; -3.20684; -2.21662; 0; 19.3395; 0.2; 0.0927982\n
624895590; 45.6524; 14.2725; 791.453; 196.098; -3.13261; -2.39592; 0; 19.3257; 0.2; 0.118116\n
626581891; 45.6525; 14.2728; 791.507; 196.152; -3.18057; -2.35701; 0; 19.3268; 0.2; 0.0807256\n
628242291; 45.6527; 14.2731; 791.554; 196.199; -3.16945; -2.38298; 0; 19.3145; 0.2; 0.103584\n
629902424; 45.6529; 14.2733; 791.625; 196.27; -3.13973; -2.30399; 0; 19.3164; 0.2; 0.106257\n
631558463; 45.6531; 14.2736; 791.685; 196.33; -3.08441; -2.26722; 0; 19.3082; 0.2; 0.102156\n
633166646; 45.6533; 14.2739; 791.709; 196.354; -3.14824; -2.42146; 0; 19.3286; 0.2; 0.091824\n
634914554; 45.6534; 14.2741; 791.767; 196.412; -3.05714; -2.28635; 0; 19.3325; 0.2; 0.124037\n
636565625; 45.6536; 14.2744; 791.817; 196.462; -3.14648; -2.35671; 0; 19.3168; 0.2; 0.114006\n
638234937; 45.6538; 14.2747; 791.888; 196.533; -3.07777; -2.50409; 0; 19.3237; 0.2; 0.109377\n
639857119; 45.654; 14.2749; 791.926; 196.571; -3.07521; -2.39902; 0; 19.3011; 0.2; 0.0963342\n
641598840; 45.6542; 14.2752; 791.961; 196.606; -3.06108; -2.41629; 0; 19.2984; 0.2; 0.0796048\n
643264948; 45.6544; 14.2755; 791.982; 196.627; -2.98304; -2.39112; 0; 19.3097; 0.2; 0.0760497\n
644886346; 45.6545; 14.2758; 791.99; 196.635; -3.05229; -2.79585; 0; 19.3666; 0.2; 0.0746441\n
646572354; 45.6547; 14.276; 792.022; 196.667; -2.95722; -2.83701; 0; 19.3215; 0.2; 0.0976423\n
648239596; 45.6549; 14.2763; 792.043; 196.688; -3.03382; -2.73307; 0; 19.3254; 0.2; 0.0804697\n
649857814; 45.6551; 14.2766; 792.07; 196.715; -3.00043; -2.72201; 0; 19.3217; 0.2; 0.10144\n
651534024; 45.6553; 14.2768; 792.132; 196.777; -3.07773; -2.68836; 0; 19.2681; 0.2; 0.126678\n
653191093; 45.6555; 14.2771; 792.197; 196.842; -3.12552; -20.8528; 0; 19.292; 0.2; 0.0720503\n
654928193; 45.6557; 14.2773; 791.214; 195.859; -5.83826; -34.6372; 0; 19.5998; 0.2; -0.817874\n
656594638; 45.656; 14.2772; 789.199; 193.844; -7.20874; -35.1964; 0; 20.1969; 0.2; -1.36929\n
658172138; 45.6562; 14.2771; 787.325; 191.97; -7.32269; -20.8623; 0; 20.3611; 0.2; -1.13589\n
659825514; 45.6564; 14.2768; 786.149; 190.794; -7.2594; -2.66203; 0; 20.1484; 0.2; -0.566228\n
661580925; 45.6565; 14.2764; 784.333; 188.978; -8.21421; -1.93833; 0; 20.3155; 0.2; -1.06035\n
663243708; 45.6567; 14.2761; 782.464; 187.109; -7.36971; -2.41614; 0; 20.3919; 0.2; -1.02557\n
664909797; 45.6569; 14.2758; 780.691; 185.336; -6.6853; -1.56576; 0; 20.3951; 0.2; -1.01079\n
666581437; 45.657; 14.2755; 779.029; 183.674; -6.32555; -1.34641; 0; 20.3284; 0.2; -0.911484\n
668248851; 45.6572; 14.2752; 777.59; 182.235; -5.94311; -1.4128; 0; 20.253; 0.2; -0.780997\n
669916905; 45.6574; 14.2749; 776.335; 180.98; -5.69929; -1.76985; 0; 20.1752; 0.2; -0.686662\n
671563183; 45.6575; 14.2746; 775.217; 179.862; -5.41969; -1.90092; 0; 20.0642; 0.2; -0.596393\n
673171024; 45.6577; 14.2743; 774.274; 178.919; -4.99834; -2.32516; 0; 19.9863; 0.2; -0.514568\n
674914470; 45.6579; 14.274; 773.325; 177.97; -4.80663; -2.33439; 0; 19.9553; 0.2; -0.48014\n
676512744; 45.658; 14.2737; 772.62; 177.265; -4.52874; -2.34908; 0; 19.8828; 0.2; -0.332765\n
678202248; 45.6582; 14.2734; 772.057; 176.702; -4.29321; -2.08365; 0; 19.7418; 0.2; -0.252615\n
679858947; 45.6584; 14.2731; 771.611; 176.256; -4.05161; -2.07036; 0; 19.6785; 0.2; -0.207998\n
681539677; 45.6585; 14.2728; 771.215; 175.86; -3.84092; -2.36027; 0; 19.6259; 0.2; -0.192275\n
683170323; 45.6587; 14.2725; 770.873; 175.518; -3.51995; -2.22765; 0; 19.6122; 0.2; -0.154225\n
684924966; 45.6588; 14.2721; 770.585; 175.23; -3.32287; -1.91602; 0; 19.565; 0.2; -0.100694\n
686574805; 45.659; 14.2718; 770.429; 175.074; -3.2042; -2.12893; 0; 19.5044; 0.2; -0.0207259\n
688247158; 45.6592; 14.2715; 770.324; 174.969; -3.02373; -20.2689; 0; 19.4439; 0.2; -0.0381336\n
689913604; 45.6592; 14.2712; 769.331; 173.976; -5.55235; -34.5426; 0; 19.6494; 0.2; -0.880781\n
691575195; 45.6592; 14.2708; 767.37; 172.015; -6.75461; -35.1515; 0; 20.2583; 0.2; -1.40358\n
693250451; 45.659; 14.2705; 765.401; 170.046; -7.16213; -24.7159; 0; 20.3923; 0.2; -1.24805\n
694900526; 45.6588; 14.2703; 764.193; 168.838; -6.70142; -3.65403; 0; 20.245; 0.2; -0.538852\n
696552954; 45.6586; 14.2701; 762.54; 167.185; -8.48816; -1.73817; 0; 20.2972; 0.2; -1.26537\n
698184222; 45.6583; 14.27; 759.892; 164.537; -9.35312; -1.97313; 0; 20.6665; 0.2; -1.75781\n
699846291; 45.6581; 14.2698; 756.811; 161.456; -9.32014; -1.46818; 0; 20.9524; 0.2; -1.8702\n
701509170; 45.6578; 14.2696; 753.707; 158.352; -9.20492; -1.35123; 0; 21.0862; 0.2; -1.89658\n
703169003; 45.6576; 14.2694; 750.611; 155.256; -9.197; -1.4313; 0; 21.1042; 0.2; -1.8892\n
704891152; 45.6573; 14.2692; 747.362; 152.007; -9.13073; -1.79704; 0; 21.094; 0.2; -1.89704\n
706526901; 45.657; 14.2691; 744.244; 148.889; -9.06573; -2.12841; 0; 21.1966; 0.2; -1.94168\n
708238918; 45.6568; 14.2689; 740.935; 145.58; -9.12535; -2.21351; 0; 21.1667; 0.2; -1.95582\n
709887512; 45.6565; 14.2687; 737.786; 142.431; -9.17426; -2.23312; 0; 21.1561; 0.2; -1.92182\n
711521723; 45.6563; 14.2685; 734.732; 139.377; -9.12885; -2.29336; 0; 21.1147; 0.2; -1.88435\n
713240111; 45.656; 14.2683; 731.55; 136.195; -9.1728; -2.12568; 0; 21.1301; 0.2; -1.86803\n
714883764; 45.6558; 14.2681; 728.544; 133.189; -9.2; -2.20636; 0; 21.1028; 0.2; -1.82951\n
716490322; 45.6555; 14.268; 725.659; 130.304; -9.23288; -2.26577; 0; 21.1033; 0.2; -1.80982\n
718238806; 45.6553; 14.2678; 722.492; 127.137; -9.14454; -2.16331; 0; 21.1312; 0.2; -1.84402\n
719847279; 45.655; 14.2676; 719.536; 124.181; -9.12172; -2.1423; 0; 21.1188; 0.2; -1.86724\n
721570076; 45.6548; 14.2674; 716.361; 121.006; -9.08358; -2.26494; 0; 21.1146; 0.2; -1.88777\n
723238767; 45.6545; 14.2672; 713.272; 117.917; -9.10819; -2.45608; 0; 21.1429; 0.2; -1.87342\n
724862458; 45.6543; 14.267; 710.355; 115; -8.94148; -2.43467; 0; 21.1176; 0.2; -1.80455\n
726505948; 45.654; 14.2668; 707.511; 112.156; -8.80085; -2.51597; 0; 21.0655; 0.2; -1.73346\n
728179067; 45.6538; 14.2667; 704.711; 109.356; -8.57402; -2.37108; 0; 20.9796; 0.2; -1.69891\n
729913983; 45.6535; 14.2665; 701.952; 106.597; -8.18759; -2.50808; 0; 20.9636; 0.2; -1.59191\n
731574048; 45.6532; 14.2663; 699.51; 104.155; -7.93475; -2.27565; 0; 20.818; 0.2; -1.42952\n
733250648; 45.653; 14.2661; 697.296; 101.941; -7.48648; -2.29566; 0; 20.7391; 0.2; -1.31103\n
734840282; 45.6528; 14.2659; 695.336; 99.981; -7.10914; -2.2467; 0; 20.6839; 0.2; -1.22608\n
736576736; 45.6525; 14.2658; 693.426; 98.071; -6.67487; -2.21795; 0; 20.5086; 0.2; -1.08212\n
738242546; 45.6523; 14.2656; 691.719; 96.364; -6.29169; -2.12028; 0; 20.4887; 0.2; -0.999269\n
739894384; 45.652; 14.2654; 690.252; 94.897; -5.83622; -2.05067; 0; 20.3805; 0.2; -0.853422\n
741505047; 45.6518; 14.2652; 689.034; 93.679; -5.5798; -2.11922; 0; 20.252; 0.2; -0.716055\n
743163115; 45.6515; 14.2651; 687.979; 92.624; -5.28179; -1.98475; 0; 20.1208; 0.2; -0.620349\n
744902540; 45.6513; 14.2649; 687.046; 91.691; -4.97359; -2.12359; 0; 20.0586; 0.2; -0.522665\n
746572542; 45.651; 14.2647; 686.302; 90.947; -4.72626; -2.14783; 0; 19.9414; 0.2; -0.42047\n
748192790; 45.6508; 14.2645; 685.72; 90.365; -4.47901; -2.04678; 0; 19.8154; 0.2; -0.360079\n
749890115; 45.6506; 14.2644; 685.247; 89.892; -4.14658; -2.19419; 0; 19.7976; 0.2; -0.284907\n
751494195; 45.6503; 14.2642; 684.882; 89.527; -3.98666; -2.18436; 0; 19.7212; 0.2; -0.233135\n
753265102; 45.6501; 14.264; 684.574; 89.219; -3.70698; -2.292; 0; 19.6839; 0.2; -0.181468\n
754882061; 45.6498; 14.2639; 684.367; 89.012; -3.42307; -2.3912; 0; 19.6283; 0.2; -0.142349\n
756543912; 45.6496; 14.2637; 684.227; 88.872; -3.31282; -2.18271; 0; 19.5531; 0.2; -0.0730049\n
758212374; 45.6494; 14.2635; 684.216; 88.861; -3.20114; -2.2193; 0; 19.4921; 0.2; -0.0185745\n
759824090; 45.6491; 14.2634; 684.289; 88.934; -3.07066; -2.31547; 0; 19.4467; 0.2; 0.0265759\n
761534973; 45.6489; 14.2632; 684.385; 89.03; -3.06251; -2.38912; 0; 19.3386; 0.2; 0.0249946\n
763200733; 45.6487; 14.263; 684.507; 89.152; -2.83946; -2.29396; 0; 19.3779; 0.2; 0.0429491\n
764910031; 45.6484; 14.2629; 684.62; 89.265; -2.78617; -2.35121; 0; 19.3701; 0.2; 0.0379465\n
766576603; 45.6482; 14.2627; 684.779; 89.424; -2.69567; -2.48849; 0; 19.3266; 0.2; 0.0877829\n
768249067; 45.648; 14.2625; 684.999; 89.644; -2.71506; -2.51314; 0; 19.3487; 0.2; 0.11391\n
769846561; 45.6477; 14.2624; 685.253; 89.898; -2.77069; -2.54499; 0; 19.3361; 0.2; 0.143206\n
771505766; 45.6475; 14.2622; 685.537; 90.182; -2.80271; -2.56122; 0; 19.3018; 0.2; 0.141411\n
773246646; 45.6473; 14.262; 685.836; 90.481; -2.93508; -2.50896; 0; 19.268; 0.2; 0.151015\n
774895208; 45.647; 14.2619; 686.116; 90.761; -2.89103; -2.43557; 0; 19.3153; 0.2; 0.126062\n
776507408; 45.6468; 14.2617; 686.331; 90.976; -2.88505; -2.49917; 0; 19.3111; 0.2; 0.0802058\n
778252463; 45.6466; 14.2616; 686.528; 91.173; -2.80584; -2.56538; 0; 19.3157; 0.2; 0.0704883\n
779913944; 45.6463; 14.2614; 686.69; 91.335; -2.75444; -2.52901; 0; 19.3173; 0.2; 0.0527545\n
781570898; 45.6461; 14.2612; 686.828; 91.473; -2.74307; -2.55827; 0; 19.3808; 0.2; 0.0519848\n
783198968; 45.6459; 14.2611; 686.983; 91.628; -2.82719; -2.55426; 0; 19.3289; 0.2; 0.0611364\n
784837571; 45.6456; 14.2609; 687.164; 91.809; -2.87786; -2.48136; 0; 19.2954; 0.2; 0.0816204\n
786569052; 45.6454; 14.2608; 687.375; 92.02; -3.00381; -2.53245; 0; 19.3353; 0.2; 0.0799338\n
788197009; 45.6452; 14.2606; 687.559; 92.204; -3.10642; -2.56719; 0; 19.325; 0.2; 0.0576703\n
789903638; 45.6449; 14.2604; 687.703; 92.348; -3.15394; -2.36231; 0; 19.3597; 0.2; 0.0255585\n
791567146; 45.6447; 14.2603; 687.791; 92.436; -3.04307; -2.46182; 0; 19.399; 0.2; -0.0200747\n
793173621; 45.6445; 14.2601; 687.83; 92.475; -3.06043; -2.48168; 0; 19.4251; 0.2; -0.0293241\n
794923528; 45.6442; 14.26; 687.879; 92.524; -3.01197; -2.24718; 0; 19.4211; 0.2; -0.0278946\n
796587792; 45.644; 14.2598; 687.911; 92.556; -2.98694; -2.39854; 0; 19.4397; 0.2; -0.0546201\n
798192564; 45.6437; 14.2597; 687.88; 92.525; -2.98192; -2.712; 0; 19.4782; 0.2; -0.0889444\n
799828030; 45.6435; 14.2595; 687.871; 92.516; -2.99611; -2.774; 0; 19.4111; 0.2; -0.0424791\n
801581812; 45.6432; 14.2593; 687.93; 92.575; -2.99014; -2.65535; 0; 19.4364; 0.2; -0.0123369\n
803186156; 45.643; 14.2592; 687.969; 92.614; -3.09456; -2.76951; 0; 19.376; 0.2; -0.0280747\n
804832306; 45.6428; 14.259; 688.009; 92.654; -3.13825; -2.76265; 0; 19.4123; 0.2; -0.0318584\n
806576923; 45.6425; 14.2589; 688.063; 92.708; -3.1141; -2.82754; 0; 19.4244; 0.2; -0.0291984\n
808215046; 45.6423; 14.2587; 688.054; 92.699; -3.15474; -2.78739; 0; 19.4713; 0.2; -0.0701307\n
809831800; 45.6421; 14.2586; 688.046; 92.691; -3.05948; -2.92166; 0; 19.453; 0.2; -0.0629023\n
811565357; 45.6418; 14.2584; 688.013; 92.658; -3.09904; -2.95063; 0; 19.5075; 0.2; -0.0691426\n
813182624; 45.6416; 14.2583; 688.001; 92.646; -3.17575; -3.314; 0; 19.4784; 0.2; -0.0612207\n
814918028; 45.6413; 14.2581; 687.915; 92.56; -3.91131; 30.9616; 0; 19.4247; 0.2; -0.256054\n
816517344; 45.6412; 14.2578; 686.689; 91.334; -5.3435; 34.7708; 0; 19.94; 0.2; -1.18427\n
818251306; 45.6412; 14.2574; 685.482; 90.127; -3.89103; 34.9978; 0; 20.0608; 0.2; -0.856857\n
819927766; 45.6413; 14.2571; 684.944; 89.589; -3.01803; 28.6695; 0; 19.8947; 0.2; -0.528585\n
821488393; 45.6416; 14.257; 685.63; 90.275; 0.309416; 4.03937; 0; 19.2297; 0.2; 1.05622\n
823254140; 45.6418; 14.2569; 687.299; 91.944; -0.644239; -2.5396; 0; 18.7311; 0.2; 0.920217\n
824912640; 45.6421; 14.2568; 688.21; 92.855; -1.62726; -1.22579; 0; 18.7677; 0.2; 0.617587\n
826568996; 45.6423; 14.2567; 688.944; 93.589; -1.80173; -1.75227; 0; 18.8736; 0.2; 0.473419\n
828255822; 45.6426; 14.2566; 689.664; 94.309; -1.9499; -2.77428; 0; 18.9113; 0.2; 0.428504\n
829930149; 45.6428; 14.2565; 690.307; 94.952; -2.14459; -2.88481; 0; 18.9698; 0.2; 0.350433\n
831535445; 45.643; 14.2564; 690.839; 95.484; -2.32974; -2.77733; 0; 19.021; 0.2; 0.285565\n
833202212; 45.6433; 14.2563; 691.313; 95.958; -2.52788; -2.66366; 0; 19.0509; 0.2; 0.233555\n
834839457; 45.6435; 14.2561; 691.712; 96.357; -2.62109; -2.3923; 0; 19.0988; 0.2; 0.199085\n
836574199; 45.6438; 14.256; 691.973; 96.618; -2.85972; -2.39506; 0; 19.1864; 0.2; 0.126122\n
838245199; 45.644; 14.2559; 692.239; 96.884; -2.97331; -2.49555; 0; 19.2336; 0.2; 0.154048\n
839917812; 45.6443; 14.2558; 692.479; 97.124; -3.25466; -2.5107; 0; 19.2054; 0.2; 0.117619\n
841583162; 45.6445; 14.2557; 692.645; 97.29; -3.32706; -2.53113; 0; 19.2601; 0.2; 0.0616596\n
843260311; 45.6448; 14.2556; 692.676; 97.321; -3.29074; -2.53629; 0; 19.3171; 0.2; -0.0144285\n
844879827; 45.645; 14.2555; 692.607; 97.252; -3.34519; -2.54003; 0; 19.4221; 0.2; -0.0571266\n
846555841; 45.6453; 14.2554; 692.576; 97.221; -3.40832; -2.51298; 0; 19.4044; 0.2; -0.00870967\n
848180069; 45.6455; 14.2553; 692.574; 97.219; -3.60976; -2.61458; 0; 19.3995; 0.2; -0.02562\n
849924027; 45.6458; 14.2552; 692.558; 97.203; -3.68551; -2.33373; 0; 19.4183; 0.2; -0.0267843\n
851581448; 45.646; 14.2551; 692.489; 97.134; -3.65462; -2.31988; 0; 19.4828; 0.2; -0.066928\n
853258585; 45.6463; 14.2549; 692.361; 97.006; -3.74066; -2.38883; 0; 19.4632; 0.2; -0.0894442\n
854916963; 45.6465; 14.2548; 692.216; 96.861; -3.76065; -2.2714; 0; 19.4636; 0.2; -0.0929284\n
856542330; 45.6468; 14.2547; 692.073; 96.718; -3.64204; -2.32449; 0; 19.5419; 0.2; -0.100885\n
858190275; 45.647; 14.2546; 691.938; 96.583; -3.66108; -2.19585; 0; 19.5118; 0.2; -0.0868645\n
859870710; 45.6473; 14.2545; 691.786; 96.431; -3.63354; -2.16973; 0; 19.4828; 0.2; -0.118611\n
861530148; 45.6475; 14.2544; 691.63; 96.275; -3.56962; -2.15853; 0; 19.5625; 0.2; -0.103457\n
863187848; 45.6478; 14.2543; 691.498; 96.143; -3.6138; -2.16222; 0; 19.5142; 0.2; -0.078032\n
864873064; 45.648; 14.2541; 691.361; 96.006; -3.60154; -2.41402; 0; 19.4773; 0.2; -0.0956892\n
866557776; 45.6483; 14.254; 691.204; 95.849; -3.58957; -2.51455; 0; 19.5547; 0.2; -0.0807616\n
868222309; 45.6485; 14.2539; 691.09; 95.735; -3.55058; -2.41373; 0; 19.4777; 0.2; -0.0621828\n
869896521; 45.6488; 14.2538; 690.978; 95.623; -3.49825; -2.4262; 0; 19.4967; 0.2; -0.0750901\n
871493559; 45.649; 14.2537; 690.879; 95.524; -3.53679; -2.41665; 0; 19.492; 0.2; -0.0426863\n
873199065; 45.6493; 14.2535; 690.812; 95.457; -3.48989; -2.38042; 0; 19.5189; 0.2; -0.0461149\n
874889505; 45.6495; 14.2534; 690.718; 95.363; -3.44146; -2.43355; 0; 19.4718; 0.2; -0.0635381\n
876539563; 45.6498; 14.2533; 690.638; 95.283; -3.43472; -2.4032; 0; 19.4477; 0.2; -0.0473084\n
878181035; 45.65; 14.2532; 690.55; 95.195; -3.31573; -2.41846; 0; 19.4557; 0.2; -0.0820423\n
879869205; 45.6503; 14.2531; 690.441; 95.086; -3.322; -2.39154; 0; 19.4558; 0.2; -0.0740243\n
881520177; 45.6505; 14.2529; 690.346; 94.991; -3.27038; -2.49212; 0; 19.4431; 0.2; -0.0563935\n
883218339; 45.6508; 14.2528; 690.283; 94.928; -3.15041; -2.46847; 0; 19.4232; 0.2; -0.046539\n
884901752; 45.651; 14.2527; 690.212; 94.857; -3.10626; -2.47013; 0; 19.4589; 0.2; -0.0660303\n
886579518; 45.6513; 14.2526; 690.124; 94.769; -2.99223; -2.66858; 0; 19.4612; 0.2; -0.0502952\n
888255759; 45.6515; 14.2524; 690.085; 94.73; -3.04782; -2.63733; 0; 19.4383; 0.2; -0.012296\n
889896762; 45.6518; 14.2523; 690.098; 94.743; -3.05281; -2.4052; 0; 19.4449; 0.2; 0.00228112\n
891567278; 45.652; 14.2522; 690.191; 94.836; -3.13629; -2.44033; 0; 19.3784; 0.2; 0.061827\n
893212426; 45.6522; 14.2521; 690.314; 94.959; -3.32476; -2.64425; 0; 19.3697; 0.2; 0.0759542\n
894858208; 45.6525; 14.2519; 690.449; 95.094; -3.34555; -2.59915; 0; 19.3693; 0.2; 0.0870114\n
896520939; 45.6527; 14.2518; 690.429; 95.074; -3.81723; 28.7062; 0; 19.4016; 0.2; -0.321363\n
898183275; 45.653; 14.2519; 689.422; 94.067; -4.05502; 33.276; 0; 19.7891; 0.25; -0.728298\n
899872731; 45.6532; 14.2521; 690.059; 94.704; 2.87921; 3.65172; 0; 19.6235; 0.38; 1.04186\n
901560586; 45.6534; 14.2524; 693.625; 98.27; 4.91855; -4.31152; 0; 18.2743; 0.54; 2.27882\n
903149036; 45.6535; 14.2526; 696.981; 101.626; 4.83712; -1.59536; 0; 17.8387; 0.62; 2.23537\n
904925722; 45.6537; 14.2529; 700.866; 105.511; 5.80595; -1.38072; 0; 17.6653; 0.71; 2.37095\n
906551028; 45.6538; 14.2531; 704.934; 109.579; 6.8742; -2.40311; 0; 17.4708; 0.79; 2.67558\n
908202292; 45.654; 14.2534; 709.403; 114.048; 7.78852; -3.08818; 0; 17.1579; 0.8; 2.87656\n
909885072; 45.6541; 14.2536; 714.221; 118.866; 8.29075; -2.98103; 0; 16.9511; 0.8; 2.96046\n
911536995; 45.6542; 14.2539; 719.122; 123.767; 8.87863; -3.05121; 0; 16.641; 0.8; 3.07455\n
913199694; 45.6544; 14.2541; 724.019; 128.664; 8.08829; -3.03213; 0; 16.5598; 0.8; 2.85929\n
914857412; 45.6545; 14.2544; 728.245; 132.89; 6.43635; -3.22044; 0; 16.8529; 0.73; 2.48313\n
916561079; 45.6547; 14.2546; 732.073; 136.718; 5.38478; -3.06352; 0; 17.1489; 0.56; 2.15203\n
918175696; 45.6548; 14.2549; 735.237; 139.882; 4.1379; -2.74785; 0; 17.2782; 0.39; 1.89245\n
919904935; 45.655; 14.2551; 738.108; 142.753; 2.63113; -2.78758; 0; 17.3806; 0.3; 1.57776\n
921570898; 45.6551; 14.2554; 740.375; 145.02; 1.82991; -2.52895; 0; 17.669; 0.24; 1.28501\n
923213161; 45.6553; 14.2556; 742.27; 146.915; 0.839857; -2.44115; 0; 17.8511; 0.2; 1.06698\n
924896359; 45.6555; 14.2559; 743.881; 148.526; 0.0718722; -2.63373; 0; 18.098; 0.2; 0.896894\n
926549141; 45.6556; 14.2562; 745.198; 149.843; -0.537448; -2.55399; 0; 18.3589; 0.2; 0.718072\n
928255774; 45.6558; 14.2564; 746.257; 150.902; -1.18081; -2.27724; 0; 18.5275; 0.2; 0.563575\n
929910213; 45.656; 14.2567; 747.024; 151.669; -1.74423; -2.61273; 0; 18.6879; 0.2; 0.457575\n
931570131; 45.6561; 14.257; 747.619; 152.264; -2.17421; -2.60633; 0; 18.9156; 0.2; 0.332334\n
933182821; 45.6563; 14.2572; 748.011; 152.656; -2.72609; -2.6089; 0; 19.0399; 0.2; 0.228431\n
934935504; 45.6565; 14.2575; 748.22; 152.865; -3.0847; -2.70277; 0; 19.1422; 0.2; 0.110306\n
936575337; 45.6566; 14.2578; 748.229; 152.874; -3.38592; -2.63607; 0; 19.316; 0.2; -0.0090245\n
938214375; 45.6568; 14.2581; 748.104; 152.749; -3.61514; -2.94828; 0; 19.4018; 0.2; -0.0816938\n
939930540; 45.657; 14.2584; 747.839; 152.484; -3.855; -2.73071; 0; 19.4668; 0.2; -0.155804\n
941583658; 45.6572; 14.2586; 747.482; 152.127; -3.98904; -2.59837; 0; 19.6091; 0.2; -0.210777\n
943256490; 45.6573; 14.2589; 747.053; 151.698; -4.16838; -2.45654; 0; 19.6515; 0.2; -0.221633\n
944915892; 45.6575; 14.2592; 746.591; 151.236; -4.34757; -2.25857; 0; 19.619; 0.2; -0.258316\n
946594216; 45.6577; 14.2595; 746.075; 150.72; -4.37259; -2.26928; 0; 19.6591; 0.2; -0.293375\n
948257094; 45.6579; 14.2598; 745.53; 150.175; -4.45822; -2.44002; 0; 19.7165; 0.2; -0.293652\n
949926097; 45.6581; 14.26; 745; 149.645; -4.44108; -2.4534; 0; 19.7171; 0.2; -0.288865\n
951586416; 45.6583; 14.2603; 744.449; 149.094; -4.49692; -2.46126; 0; 19.7308; 0.2; -0.296356\n
953255337; 45.6584; 14.2606; 743.874; 148.519; -4.46793; -2.44108; 0; 19.7458; 0.2; -0.305649\n
954931229; 45.6586; 14.2609; 743.287; 147.932; -4.34552; -2.72281; 0; 19.6976; 0.2; -0.302695\n
956598420; 45.6588; 14.2611; 742.731; 147.376; -4.318; -2.85751; 0; 19.7398; 0.2; -0.274472\n
958261350; 45.659; 14.2614; 742.25; 146.895; -4.25854; -2.95446; 0; 19.7148; 0.2; -0.22921\n
959925005; 45.6592; 14.2617; 741.494; 146.139; -6.19353; 29.7124; 0; 19.7004; 0.2; -0.575289\n
961501724; 45.6593; 14.262; 738.712; 143.357; -9.04296; 34.8301; 0; 20.6809; 0.2; -2.30752\n
963171698; 45.6592; 14.2624; 735.149; 139.794; -8.58884; 34.9366; 0; 21.0538; 0.2; -2.32385\n
964831732; 45.659; 14.2627; 732.504; 137.149; -6.14925; 16.3562; 0; 21.0188; 0.2; -1.63009\n
966485314; 45.6587; 14.2628; 731.845; 136.49; -4.06065; -0.673057; 0; 20.1508; 0.2; -0.132888\n
968258450; 45.6584; 14.263; 731.234; 135.879; -5.24334; -1.48807; 0; 19.8989; 0.2; -0.345732\n
969896706; 45.6582; 14.2631; 730.402; 135.047; -5.28155; -1.08885; 0; 19.8945; 0.2; -0.423631\n
971565815; 45.6579; 14.2632; 729.654; 134.299; -5.11375; -1.9261; 0; 19.8505; 0.2; -0.385228\n
973254882; 45.6577; 14.2633; 729.007; 133.652; -4.82657; -2.61627; 0; 19.7724; 0.2; -0.36176\n
974897171; 45.6574; 14.2634; 728.414; 133.059; -4.64751; -2.7638; 0; 19.7956; 0.2; -0.366362\n
976560954; 45.6572; 14.2635; 727.908; 132.553; -4.31374; -2.43412; 0; 19.7273; 0.2; -0.30882\n
978223878; 45.6569; 14.2636; 727.437; 132.082; -4.25083; -2.44928; 0; 19.7226; 0.2; -0.308457\n
979881901; 45.6567; 14.2638; 727.032; 131.677; -4.01518; -2.40222; 0; 19.6557; 0.2; -0.249615\n
981565390; 45.6564; 14.2639; 726.705; 131.35; -3.89837; -2.23188; 0; 19.5778; 0.2; -0.176123\n
983222409; 45.6562; 14.264; 726.467; 131.112; -3.71722; -2.37495; 0; 19.5636; 0.2; -0.142082\n
984914011; 45.6559; 14.2641; 726.257; 130.902; -3.69635; -2.16876; 0; 19.5393; 0.2; -0.102546\n
986576627; 45.6557; 14.2642; 726.126; 130.771; -3.61746; -2.19833; 0; 19.4967; 0.2; -0.0650287\n
988187209; 45.6554; 14.2643; 726.051; 130.696; -3.56104; -2.25021; 0; 19.4507; 0.2; -0.0294154\n
989814244; 45.6552; 14.2644; 726.015; 130.66; -3.54535; -2.32498; 0; 19.3994; 0.2; -0.000125166\n
991591071; 45.6549; 14.2646; 726.016; 130.661; -3.39213; -2.32493; 0; 19.4171; 0.2; 0.0121668\n
993230327; 45.6547; 14.2647; 726.002; 130.647; -3.34511; -2.3952; 0; 19.4025; 0.2; -0.0153847\n
994926719; 45.6544; 14.2648; 726.017; 130.662; -3.22846; -2.2951; 0; 19.3939; 0.2; 0.0175865\n
996527068; 45.6542; 14.2649; 726.086; 130.731; -3.23494; -2.33559; 0; 19.3932; 0.2; 0.0400677\n
998197224; 45.6539; 14.265; 726.16; 130.805; -3.1658; -2.32811; 0; 19.3534; 0.2; 0.0140279\n
999894230; 45.6537; 14.2651; 726.195; 130.84; -3.0972; -2.33597; 0; 19.3842; 0.2; 0.0231305\n
1001546946; 45.6534; 14.2653; 726.225; 130.87; -3.04328; -2.41145; 0; 19.3608; 0.2; 0.0191423\n
1003182497; 45.6532; 14.2654; 726.273; 130.918; -2.95285; -2.33438; 0; 19.4449; 0.2; 0.0309833\n
1004902292; 45.6529; 14.2655; 726.373; 131.018; -3.01371; -2.36944; 0; 19.3349; 0.2; 0.0780229\n
1006585703; 45.6527; 14.2656; 726.518; 131.163; -2.98935; -2.38351; 0; 19.3311; 0.2; 0.0718234\n
1008223114; 45.6524; 14.2657; 726.626; 131.271; -2.94607; -2.52615; 0; 19.3201; 0.2; 0.0591873\n
1009840328; 45.6522; 14.2658; 726.725; 131.37; -2.9683; -2.31125; 0; 19.3265; 0.2; 0.0615244\n
1011584527; 45.6519; 14.266; 726.841; 131.486; -2.94199; -2.2921; 0; 19.3609; 0.2; 0.0494935\n
1013233253; 45.6517; 14.2661; 726.937; 131.582; -3.02341; -2.38539; 0; 19.3064; 0.2; 0.066989\n
1014873508; 45.6514; 14.2662; 727.083; 131.728; -3.10079; -2.43715; 0; 19.345; 0.2; 0.090668\n
1016598940; 45.6512; 14.2663; 727.241; 131.886; -3.08285; -2.56804; 0; 19.3164; 0.2; 0.0661484\n
1018216281; 45.6509; 14.2664; 727.348; 131.993; -3.13918; -2.49748; 0; 19.3498; 0.2; 0.0498661\n
1019842209; 45.6507; 14.2665; 727.431; 132.076; -3.09351; -2.59765; 0; 19.3551; 0.2; 0.048792\n
1021584174; 45.6504; 14.2667; 727.503; 132.148; -3.08838; -2.71574; 0; 19.374; 0.2; 0.0136109\n
1023234310; 45.6502; 14.2668; 727.525; 132.17; -3.00179; -2.57701; 0; 19.395; 0.2; -0.0127944\n
1024854237; 45.6499; 14.2669; 727.526; 132.171; -3.07564; -2.9418; 0; 19.4091; 0.2; 0.00432178\n
1026580109; 45.6497; 14.267; 727.586; 132.231; -3.07626; -2.89513; 0; 19.4198; 0.2; 0.0341861\n
1028201880; 45.6494; 14.2671; 727.662; 132.307; -3.19377; -2.75544; 0; 19.3463; 0.2; 0.0244262\n
1029916174; 45.6492; 14.2672; 727.736; 132.381; -3.31132; -2.5836; 0; 19.3254; 0.2; 0.0217886\n
1031476132; 45.649; 14.2674; 727.799; 132.444; -3.24739; -2.85777; 0; 19.3766; 0.2; 0.00777151\n
1033227633; 45.6487; 14.2675; 727.797; 132.442; -3.26191; -2.85296; 0; 19.352; 0.2; -0.0353033\n
1034864913; 45.6484; 14.2676; 727.782; 132.427; -3.18518; -2.58885; 0; 19.4065; 0.2; -0.0135488\n
1036594314; 45.6482; 14.2677; 727.77; 132.415; -3.25823; -2.54093; 0; 19.4055; 0.2; -0.0206039\n
1038219419; 45.648; 14.2678; 727.793; 132.438; -3.26775; -2.84447; 0; 19.4042; 0.2; 0.00360121\n
1039898276; 45.6477; 14.268; 727.838; 132.483; -3.23446; -2.565; 0; 19.3404; 0.2; 0.0217008\n
1041560229; 45.6475; 14.2681; 727.849; 132.494; -3.33703; -2.43403; 0; 19.3862; 0.2; -0.0165165\n
1043222876; 45.6472; 14.2682; 727.839; 132.484; -3.18917; -2.49152; 0; 19.4577; 0.2; -0.0194033\n
1044850048; 45.647; 14.2683; 727.8; 132.445; -3.14223; -2.36099; 0; 19.4592; 0.2; -0.038676\n
1046587509; 45.6467; 14.2685; 727.759; 132.404; -3.21079; -2.44032; 0; 19.4141; 0.2; -0.0299657\n
1048200522; 45.6465; 14.2686; 727.746; 132.391; -3.19913; -2.30319; 0; 19.4332; 0.2; -0.0133497\n
1049922890; 45.6462; 14.2687; 727.74; 132.385; -3.16991; -2.30076; 0; 19.3814; 0.2; -0.0155178\n
1051593415; 45.646; 14.2688; 727.726; 132.371; -3.15074; -2.28232; 0; 19.4377; 0.2; -0.0157015\n
1053229417; 45.6457; 14.269; 727.734; 132.379; -3.19098; -2.31867; 0; 19.4019; 0.2; -0.00422965\n
1054889319; 45.6455; 14.2691; 727.727; 132.372; -3.20251; -2.40909; 0; 19.4358; 0.2; -0.0269134\n
1056528143; 45.6452; 14.2692; 727.728; 132.373; -3.20829; -2.58357; 0; 19.4033; 0.2; -0.00196733\n
1058260407; 45.645; 14.2693; 727.749; 132.394; -3.23929; -2.65943; 0; 19.4109; 0.2; -0.0045706\n
1059883002; 45.6447; 14.2695; 727.758; 132.403; -3.20868; -2.69064; 0; 19.4413; 0.2; -0.00463615\n
1061521812; 45.6445; 14.2696; 727.776; 132.421; -3.30353; -2.67023; 0; 19.3828; 0.2; -0.00651893\n
1063179337; 45.6443; 14.2697; 727.806; 132.451; -3.21168; -2.48508; 0; 19.389; 0.2; -0.0061238\n
1064902901; 45.644; 14.2699; 727.784; 132.429; -3.3122; -2.52198; 0; 19.3944; 0.2; -0.0490673\n
1066543444; 45.6438; 14.27; 727.78; 132.425; -3.14985; -2.56212; 0; 19.3995; 0.2; -0.0389169\n
1068176556; 45.6435; 14.2701; 727.719; 132.364; -3.11279; -2.63944; 0; 19.4338; 0.2; -0.0847826\n
1069884147; 45.6433; 14.2703; 727.652; 132.297; -3.03688; -2.79566; 0; 19.4713; 0.2; -0.0622132\n
1071539389; 45.643; 14.2704; 727.643; 132.288; -3.0409; -2.99853; 0; 19.4562; 0.2; -0.0104605\n
1073265210; 45.6428; 14.2705; 727.646; 132.291; -3.11753; -2.90354; 0; 19.4292; 0.2; -0.0375278\n
1074857917; 45.6425; 14.2707; 727.637; 132.282; -3.12618; -2.8434; 0; 19.415; 0.2; -0.0389539\n
1076586018; 45.6423; 14.2708; 727.644; 132.289; -3.09253; -2.88935; 0; 19.3769; 0.2; -0.0262977\n
1078266563; 45.642; 14.2709; 727.656; 132.301; -3.13986; -2.91273; 0; 19.401; 0.2; -0.0247866\n
1079887175; 45.6418; 14.2711; 727.675; 132.32; -3.13638; -3.00255; 0; 19.4152; 0.2; -0.0194354\n
1081516465; 45.6416; 14.2712; 727.693; 132.338; -3.14543; -3.14124; 0; 19.4555; 0.2; -0.0110702\n
1083265272; 45.6413; 14.2714; 727.514; 132.159; -3.40077; -31.9374; 0; 19.4787; 0.2; -0.340866\n
1084921230; 45.6412; 14.2717; 727.021; 131.666; -2.85541; -35.0501; 0; 19.5892; 0.24; -0.412153\n
1086485527; 45.6412; 14.2721; 727.494; 132.139; -0.673952; -34.469; 0; 19.4092; 0.44; 0.507001\n
1088259515; 45.6413; 14.2724; 729.929; 134.574; 3.79972; -9.79683; 0; 18.7908; 0.53; 2.08839\n
1089911211; 45.6414; 14.2727; 734.032; 138.677; 5.01137; -0.317882; 0; 17.8575; 0.56; 2.70113\n
1091601088; 45.6416; 14.273; 737.254; 141.899; 2.895; -2.19364; 0; 17.6608; 0.43; 1.70842\n
1093259466; 45.6417; 14.2732; 739.596; 144.241; 2.1064; -3.04844; 0; 17.8688; 0.35; 1.42942\n
1094926337; 45.6418; 14.2735; 741.709; 146.354; 1.56287; -2.15765; 0; 17.993; 0.25; 1.28102\n
1096579582; 45.642; 14.2738; 743.614; 148.259; 0.933591; -1.8512; 0; 17.9869; 0.2; 1.06463\n
1098234212; 45.6421; 14.2741; 745.234; 149.879; 0.380311; -1.97833; 0; 18.1281; 0.2; 0.918375\n
1099883910; 45.6423; 14.2743; 746.653; 151.298; -0.051586; -2.40599; 0; 18.2708; 0.2; 0.80973\n
1101573751; 45.6424; 14.2746; 747.953; 152.598; -0.319097; -2.51846; 0; 18.4204; 0.2; 0.714903\n
1103225185; 45.6426; 14.2749; 749.034; 153.679; -0.709375; -2.54135; 0; 18.5522; 0.2; 0.591349\n
1104854165; 45.6427; 14.2752; 749.915; 154.56; -1.14779; -2.54352; 0; 18.6503; 0.2; 0.50126\n
1106537361; 45.6429; 14.2755; 750.709; 155.354; -1.44401; -2.40514; 0; 18.8181; 0.2; 0.441202\n
1108239349; 45.643; 14.2758; 751.39; 156.035; -1.80736; -2.52475; 0; 18.8639; 0.2; 0.377251\n
1109866619; 45.6432; 14.2761; 751.907; 156.552; -2.15755; -2.64764; 0; 18.921; 0.2; 0.31868\n
1111523808; 45.6433; 14.2764; 752.309; 156.954; -2.40535; -2.73099; 0; 19.0885; 0.2; 0.205952\n
1113260738; 45.6435; 14.2767; 752.57; 157.215; -2.6434; -2.91236; 0; 19.1509; 0.2; 0.139922\n
1114913000; 45.6437; 14.277; 752.736; 157.381; -2.92464; -10.7637; 0; 19.2299; 0.2; 0.107515\n
1116582624; 45.6439; 14.2772; 752.32; 156.965; -3.90531; -33.3003; 0; 19.4793; 0.2; -0.570853\n
1118260753; 45.6441; 14.2773; 751.706; 156.351; -2.95523; -33.8791; 0; 19.6259; 0.2; -0.325116\n
1119867956; 45.6444; 14.2772; 752.9; 157.545; 1.80162; -8.59437; 0; 19.1399; 0.24; 1.19498\n
1121510249; 45.6446; 14.277; 756.175; 160.82; 3.31512; -0.417001; 0; 17.9244; 0.33; 2.1474\n
1123175489; 45.6448; 14.2769; 758.974; 163.619; 1.48597; -2.32836; 0; 17.6659; 0.23; 1.52529\n
1124879541; 45.645; 14.2767; 760.912; 165.557; 0.490006; -3.03851; 0; 17.8499; 0.2; 1.11173\n
1126544191; 45.6452; 14.2766; 762.497; 167.142; 0.269388; -2.43148; 0; 18.1517; 0.2; 0.948238\n
1128199819; 45.6455; 14.2764; 763.962; 168.607; -0.0111614; -1.90913; 0; 18.2115; 0.2; 0.841526\n
1129837441; 45.6457; 14.2763; 765.244; 169.889; -0.295475; -2.3221; 0; 18.3787; 0.2; 0.756094\n
1131589899; 45.6459; 14.2761; 766.431; 171.076; -0.659082; -2.40801; 0; 18.5238; 0.2; 0.63448\n
1133212394; 45.6461; 14.276; 767.386; 172.031; -0.987321; -2.29108; 0; 18.6493; 0.2; 0.571853\n
1134849788; 45.6464; 14.2758; 768.212; 172.857; -1.3213; -2.41122; 0; 18.7325; 0.2; 0.494766\n
1136510516; 45.6466; 14.2757; 768.879; 173.524; -1.62598; -2.54384; 0; 18.8475; 0.2; 0.374318\n
1138262404; 45.6468; 14.2755; 769.426; 174.071; -1.95662; -2.77097; 0; 18.9782; 0.2; 0.317872\n
1139929883; 45.6471; 14.2754; 769.858; 174.503; -2.2863; -2.65486; 0; 19.0339; 0.2; 0.274477\n
1141497880; 45.6473; 14.2752; 770.196; 174.841; -2.53606; -2.59542; 0; 19.0743; 0.2; 0.212088\n
1143264603; 45.6475; 14.275; 770.458; 175.103; -2.79516; -2.50521; 0; 19.1273; 0.2; 0.145334\n
1144915218; 45.6478; 14.2749; 770.578; 175.223; -2.99026; -2.55316; 0; 19.2047; 0.2; 0.0751699\n
1146520912; 45.648; 14.2747; 770.62; 175.265; -3.1669; -2.55088; 0; 19.3112; 0.2; 0.0205376\n
1148265286; 45.6482; 14.2746; 770.598; 175.243; -3.29788; -2.52237; 0; 19.3383; 0.2; -0.00189901\n
1149915250; 45.6485; 14.2744; 770.503; 175.148; -3.37728; -2.37922; 0; 19.3694; 0.2; -0.0458991\n
1151500617; 45.6487; 14.2743; 770.366; 175.011; -3.49453; -2.29869; 0; 19.4016; 0.2; -0.0875344\n
1153162241; 45.6489; 14.2741; 770.186; 174.831; -3.65489; -2.40426; 0; 19.4845; 0.2; -0.0909843\n
1154914152; 45.6492; 14.2739; 769.964; 174.609; -3.5844; -2.39008; 0; 19.4952; 0.2; -0.112595\n
1156597290; 45.6494; 14.2738; 769.699; 174.344; -3.66626; -2.23886; 0; 19.5116; 0.2; -0.149025\n
1158231888; 45.6497; 14.2736; 769.434; 174.079; -3.68764; -2.48682; 0; 19.5226; 0.2; -0.141201\n
1159875270; 45.6499; 14.2734; 769.191; 173.836; -3.69395; -2.46474; 0; 19.4926; 0.2; -0.117805\n
1161524260; 45.6501; 14.2733; 768.96; 173.605; -3.73754; -2.45106; 0; 19.5218; 0.2; -0.1302\n
1163189517; 45.6504; 14.2731; 768.704; 173.349; -3.73395; -2.20143; 0; 19.5076; 0.2; -0.157759\n
1164922747; 45.6506; 14.2729; 768.41; 173.055; -3.63298; -2.32969; 0; 19.5246; 0.2; -0.164787\n
1166550595; 45.6508; 14.2728; 768.128; 172.773; -3.57946; -2.55594; 0; 19.5123; 0.2; -0.162722\n
1168168111; 45.6511; 14.2726; 767.862; 172.507; -3.57916; -2.57778; 0; 19.5581; 0.2; -0.127815\n
1169847144; 45.6513; 14.2724; 767.667; 172.312; -3.6504; -2.35498; 0; 19.4998; 0.2; -0.0782104\n
1171499307; 45.6516; 14.2723; 767.511; 172.156; -3.64372; -2.20991; 0; 19.466; 0.2; -0.0686898\n
1173199292; 45.6518; 14.2721; 767.365; 172.01; -3.62719; -2.28904; 0; 19.4473; 0.2; -0.0568297\n
1174936579; 45.652; 14.2719; 767.184; 171.829; -3.63799; -2.30041; 0; 19.4822; 0.2; -0.0860328\n
1176497029; 45.6523; 14.2718; 767.018; 171.663; -3.54199; -2.2907; 0; 19.4728; 0.2; -0.0614034\n
1178168210; 45.6525; 14.2716; 766.866; 171.511; -3.51335; -2.30291; 0; 19.4671; 0.2; -0.0566964\n
1179924148; 45.6527; 14.2714; 766.716; 171.361; -3.49481; -2.31855; 0; 19.4327; 0.2; -0.0399915\n
1181562228; 45.653; 14.2713; 766.59; 171.235; -3.4491; -2.28131; 0; 19.4745; 0.2; -0.0575688\n
1183215624; 45.6532; 14.2711; 766.494; 171.139; -3.40883; -2.48007; 0; 19.399; 0.2; -0.000401163\n
1184880755; 45.6534; 14.2709; 766.435; 171.08; -3.33043; -2.49991; 0; 19.4211; 0.2; -0.0162459\n
1186563049; 45.6537; 14.2708; 766.327; 170.972; -3.30034; -2.27862; 0; 19.3667; 0.2; -0.0376835\n
1188194397; 45.6539; 14.2706; 766.199; 170.844; -3.26846; -2.3675; 0; 19.4325; 0.2; -0.0439343\n
1189827303; 45.6541; 14.2704; 766.136; 170.781; -3.25437; -2.48121; 0; 19.403; 0.2; 0.0198613\n
1191590918; 45.6544; 14.2703; 766.146; 170.791; -3.24981; -2.39655; 0; 19.3581; 0.2; 0.0526896\n
1193261513; 45.6546; 14.2701; 766.153; 170.798; -3.2599; -2.31537; 0; 19.3965; 0.2; 0.029834\n
1194817402; 45.6548; 14.2699; 766.163; 170.808; -3.32557; -2.38289; 0; 19.362; 0.2; 0.0436715\n
1196568350; 45.6551; 14.2697; 766.199; 170.844; -3.34891; -2.56092; 0; 19.3388; 0.2; 0.0380656\n
1198211949; 45.6553; 14.2696; 766.236; 170.881; -3.42485; -2.6164; 0; 19.3273; 0.2; 0.0588936\n
1199867177; 45.6556; 14.2694; 766.268; 170.913; -3.35474; -2.49377; 0; 19.318; 0.2; 0.0366908\n
1201496228; 45.6558; 14.2692; 766.252; 170.897; -3.23115; -2.53255; 0; 19.3112; 0.2; 0.0111591\n
1203186690; 45.656; 14.2691; 766.201; 170.846; -3.25598; -2.46571; 0; 19.3805; 0.2; -0.0140098\n
1204884851; 45.6563; 14.2689; 766.19; 170.835; -3.15618; -2.48632; 0; 19.3545; 0.2; 0.0231776\n
1206595536; 45.6565; 14.2687; 766.187; 170.832; -3.15018; -2.41144; 0; 19.3712; 0.2; 0.0159741\n
1208167876; 45.6567; 14.2686; 766.168; 170.813; -3.17782; -2.41783; 0; 19.3708; 0.2; 0.0149608\n
1209926320; 45.657; 14.2684; 766.16; 170.805; -3.18964; -2.36876; 0; 19.355; 0.2; 0.0288047\n
1211599724; 45.6572; 14.2682; 766.196; 170.841; -3.11061; -2.41477; 0; 19.3649; 0.2; 0.0504199\n
1213267172; 45.6574; 14.268; 766.188; 170.833; -3.16437; -2.58293; 0; 19.3805; 0.2; 0.0200727\n
1214901954; 45.6576; 14.2678; 766.171; 170.816; -3.07142; -2.44787; 0; 19.3583; 0.2; 0.0248945\n
1216569896; 45.6579; 14.2677; 766.146; 170.791; -3.00288; -2.46343; 0; 19.3744; 0.2; 0.0212085\n
1218243089; 45.6581; 14.2675; 766.141; 170.786; -3.15327; -2.40647; 0; 19.3823; 0.2; 0.0482852\n
1219886847; 45.6583; 14.2673; 766.206; 170.851; -3.18806; -2.35789; 0; 19.3609; 0.2; 0.0825879\n
1221499177; 45.6586; 14.2671; 766.287; 170.932; -3.23383; -2.38269; 0; 19.3068; 0.2; 0.0856681\n
1223202946; 45.6588; 14.2669; 766.36; 171.005; -3.22371; -2.6636; 0; 19.3311; 0.2; 0.0751725\n
1224841300; 45.659; 14.2667; 766.391; 171.036; -3.19669; -20.2921; 0; 19.344; 0.2; 0.0561753\n
1226501946; 45.6592; 14.2665; 765.534; 170.179; -5.64777; -34.2137; 0; 19.6761; 0.2; -1.07358\n
1228165750; 45.6593; 14.2661; 763.505; 168.15; -7.29568; -35.1988; 0; 20.2473; 0.2; -1.46368\n
1229918115; 45.6592; 14.2657; 761.183; 165.828; -7.77266; -25.6457; 0; 20.4756; 0.2; -1.44622\n
1231529598; 45.6591; 14.2654; 759.684; 164.329; -7.03666; -5.76353; 0; 20.3323; 0.2; -0.656843\n
1233212131; 45.6589; 14.2651; 757.886; 162.531; -8.98628; -1.50962; 0; 20.3822; 0.2; -1.31129\n
1234862724; 45.6587; 14.2648; 755.097; 159.742; -9.3392; -1.96582; 0; 20.7457; 0.2; -1.77679\n
1236566632; 45.6585; 14.2645; 751.929; 156.574; -9.21642; -1.73001; 0; 20.9958; 0.2; -1.93317\n
1238162918; 45.6583; 14.2642; 748.897; 153.542; -9.1438; -1.49799; 0; 21.0946; 0.2; -1.97175\n
1239914797; 45.6581; 14.2639; 745.51; 150.155; -9.13681; -1.75912; 0; 21.1296; 0.2; -1.97497\n
1241582397; 45.658; 14.2636; 742.286; 146.931; -9.01917; -2.07396; 0; 21.1096; 0.2; -1.98997\n
1243216831; 45.6578; 14.2633; 739.086; 143.731; -9.02425; -1.94514; 0; 21.1974; 0.2; -2.00954\n
1244852374; 45.6576; 14.263; 735.863; 140.508; -9.05656; -2.01949; 0; 21.2478; 0.2; -1.99555\n
1246586501; 45.6574; 14.2627; 732.473; 137.118; -9.06667; -2.0186; 0; 21.1938; 0.2; -1.97489\n
1248211662; 45.6572; 14.2624; 729.333; 133.978; -9.1132; -2.10296; 0; 21.1863; 0.2; -1.95636\n
1249862681; 45.657; 14.262; 726.188; 130.833; -9.13718; -2.06732; 0; 21.211; 0.2; -1.91261\n
1251514134; 45.6569; 14.2617; 723.106; 127.751; -9.07346; -2.16737; 0; 21.1578; 0.2; -1.88209\n
1253216287; 45.6567; 14.2614; 719.988; 124.633; -8.95169; -2.08938; 0; 21.1283; 0.2; -1.86876\n
1254881718; 45.6565; 14.2611; 716.987; 121.632; -8.63458; -2.21444; 0; 21.1025; 0.2; -1.81933\n
1256562649; 45.6563; 14.2608; 714.112; 118.757; -8.41693; -2.29636; 0; 21.0193; 0.2; -1.70712\n
1258192503; 45.6561; 14.2605; 711.525; 116.17; -8.03334; -2.23978; 0; 20.9814; 0.2; -1.58235\n
1259842642; 45.6559; 14.2602; 709.094; 113.739; -7.66535; -2.28796; 0; 20.8715; 0.2; -1.47556\n
1261492064; 45.6558; 14.2599; 706.857; 111.502; -7.3585; -2.39896; 0; 20.7435; 0.2; -1.32775\n
1263236021; 45.6556; 14.2596; 704.749; 109.394; -6.97469; -2.21692; 0; 20.6246; 0.2; -1.17581\n
1264898289; 45.6554; 14.2593; 702.961; 107.606; -6.55757; -2.23221; 0; 20.5365; 0.2; -1.04484\n
1266535971; 45.6552; 14.259; 701.416; 106.061; -6.24953; -2.12572; 0; 20.4249; 0.2; -0.900005\n
1268192177; 45.655; 14.2587; 700.01; 104.655; -5.8477; -2.15931; 0; 20.3145; 0.2; -0.822765\n
1269925408; 45.6549; 14.2584; 698.712; 103.357; -5.43903; -2.35616; 0; 20.2455; 0.2; -0.721243\n
1271594119; 45.6547; 14.2581; 697.633; 102.278; -5.07137; -2.41031; 0; 20.1471; 0.2; -0.601623\n
1273238790; 45.6545; 14.2578; 696.718; 101.363; -4.81083; -2.24014; 0; 20.0463; 0.2; -0.536406\n
1274901651; 45.6543; 14.2575; 695.973; 100.618; -4.40907; -2.32656; 0; 19.9579; 0.2; -0.437538\n
1276538432; 45.6542; 14.2572; 695.382; 100.027; -4.09115; -2.62778; 0; 19.8497; 0.2; -0.324934\n
1278172377; 45.654; 14.2569; 694.942; 99.587; -3.80098; -2.47434; 0; 19.7764; 0.2; -0.259474\n
1279862843; 45.6538; 14.2566; 694.587; 99.232; -3.66172; -2.20626; 0; 19.7225; 0.2; -0.175888\n
1281601515; 45.6536; 14.2563; 694.375; 99.02; -3.46898; -2.28636; 0; 19.6165; 0.2; -0.108859\n
1283233720; 45.6535; 14.2561; 694.228; 98.873; -3.34188; -2.6405; 0; 19.5832; 0.2; -0.0833882\n
1284850539; 45.6533; 14.2558; 694.199; 98.844; -3.1719; -2.5672; 0; 19.5279; 0.2; -0.00178834\n
1286574588; 45.6531; 14.2555; 694.261; 98.906; -3.17585; -2.60476; 0; 19.4616; 0.2; 0.056014\n
1288194542; 45.6529; 14.2552; 694.357; 99.002; -3.02011; -2.90899; 0; 19.4032; 0.2; 0.0347869\n
1289923548; 45.6528; 14.2549; 694.444; 99.089; -2.98819; -2.92291; 0; 19.3896; 0.2; 0.0464676\n
1291591878; 45.6526; 14.2546; 694.621; 99.266; -2.88274; -2.95251; 0; 19.3639; 0.2; 0.102096\n
1293220126; 45.6524; 14.2544; 694.826; 99.471; -2.87925; -3.02312; 0; 19.3067; 0.2; 0.109395\n
1294856365; 45.6523; 14.2541; 695.02; 99.665; -2.77119; -2.77962; 0; 19.2932; 0.2; 0.0858315\n
1296598624; 45.6521; 14.2538; 695.185; 99.83; -2.64997; -2.79389; 0; 19.363; 0.2; 0.0533544\n
1298237905; 45.6519; 14.2535; 695.305; 99.95; -2.58205; -2.77988; 0; 19.34; 0.2; 0.0484991\n
1299833988; 45.6517; 14.2533; 695.473; 100.118; -2.47385; -2.92868; 0; 19.3204; 0.2; 0.0924637\n
1301569790; 45.6515; 14.253; 695.693; 100.338; -2.46322; -2.87234; 0; 19.3261; 0.2; 0.101427\n
1303200841; 45.6514; 14.2527; 695.896; 100.541; -2.50879; -3.13163; 0; 19.3422; 0.2; 0.102104\n
1304837732; 45.6512; 14.2525; 696.109; 100.754; -2.49981; -7.77189; 0; 19.2618; 0.2; 0.105428\n
1306590311; 45.651; 14.2522; 695.647; 100.292; -4.61544; -33.0314; 0; 19.5948; 0.2; -0.932752\n
1308172147; 45.6507; 14.2521; 694.097; 98.742; -5.41412; 0.476827; 0; 20.0092; 0.2; -0.817068\n
1309902408; 45.6505; 14.252; 692.609; 97.254; -8.01338; 33.4201; 0; 20.0634; 0.2; -1.33599\n
1311554160; 45.6503; 14.2518; 688.943; 93.588; -9.66036; 34.9273; 0; 21.0412; 0.2; -2.63487\n
1313195436; 45.6502; 14.2514; 685.352; 89.997; -8.92934; 34.8474; 0; 21.2945; 0.2; -2.49536\n
1314881728; 45.6504; 14.251; 681.895; 86.54; -9.39343; 34.9072; 0; 21.291; 0.2; -2.50299\n
1316526104; 45.6506; 14.2508; 678.17; 82.815; -10.0746; 34.9744; 0; 21.4709; 0.2; -2.71918\n
1318204149; 45.6509; 14.2508; 673.938; 78.583; -10.7319; 34.9358; 0; 21.6271; 0.2; -2.82198\n
1319868750; 45.6511; 14.2511; 669.428; 74.073; -11.2965; 34.9277; 0; 21.7351; 0.2; -2.93209\n
1321506786; 45.6512; 14.2514; 664.803; 69.448; -11.4463; 26.4216; 0; 21.8662; 0.2; -2.81048\n
1323240061; 45.6512; 14.2519; 660.408; 65.053; -10.7225; 21.4601; 0; 21.7355; 0.2; -2.45697\n
1324827256; 45.651; 14.2522; 657.01; 61.655; -10.186; 30.4933; 0; 21.5559; 0.2; -2.06092\n
1326600290; 45.6508; 14.2524; 652.425; 57.07; -11.7212; 34.5738; 0; 21.7357; 0.2; -2.97797\n
1328235635; 45.6505; 14.2524; 647.689; 52.334; -10.8723; 34.7099; 0; 21.9172; 0.2; -2.83482\n
1329849977; 45.6503; 14.2522; 643.815; 48.46; -9.28308; 34.7558; 0; 21.7615; 0.2; -2.37018\n
1331496093; 45.6502; 14.2518; 640.549; 45.194; -8.52604; 34.836; 0; 21.4281; 0.2; -1.96086\n
1333246477; 45.6503; 14.2514; 637.491; 42.136; -7.72028; 34.9258; 0; 21.237; 0.2; -1.7632\n
1334862327; 45.6505; 14.2512; 635.084; 39.729; -6.97919; 34.9053; 0; 21.0261; 0.2; -1.53405\n
1336522984; 45.6507; 14.2512; 633.061; 37.706; -8.43757; 34.754; 0; 16.4427; 0; -1.89871\n
1338191022; 45.6509; 14.2513; 628.677; 33.322; -14.7769; 19.1756; 0; 15.0005; 0; -3.07743\n
1339838818; 45.651; 14.2515; 624.035; 28.68; -13.781; 6.38847; 0; 14.4126; 0; -2.69276\n
1341512464; 45.6511; 14.2518; 619.962; 24.607; -13.0618; 13.0209; 0; 13.709; 0; -2.3564\n
1343247442; 45.6511; 14.2521; 615.45; 20.095; -14.3417; 24.8645; 0; 13.5916; 0; -2.79086\n
1344856835; 45.651; 14.2523; 611.14; 15.785; -10.8835; 25.0639; 0; 13.6516; 0; -2.52571\n
1346493588; 45.6509; 14.2524; 608.153; 12.798; -8.02251; 24.0261; 0; 12.6083; 0; -1.61083\n
1348175374; 45.6507; 14.2524; 605.743; 10.388; -6.53828; 20.4897; 0; 11.759; 0; -1.36899\n
1349886877; 45.6506; 14.2522; 603.686; 8.33099; -4.56049; 16.1317; 0; 10.9802; 0; -1.09011\n
1351548658; 45.6505; 14.252; 602.143; 6.78796; -3.08911; 13.4332; 0; 10.0702; 0; -0.840663\n
1353269348; 45.6505; 14.2518; 600.71; 5.35498; -1.88144; 11.9191; 0; 9.40653; 0; -0.812853\n
1354858299; 45.6506; 14.2517; 599.364; 4.00897; -2.26264; 11.6108; 0; 8.94588; 0; -0.870716\n
1356555904; 45.6507; 14.2516; 597.534; 2.17902; -4.04233; 12.246; 0; 8.97691; 0; -1.19392\n
1358181239; 45.6508; 14.2515; 595.606; 0.250977; -4.13213; 14.0584; 0; 9.30184; 0; -1.20608\n
1359903555; 45.6509; 14.2515; 593.615; -1.73999; -3.61117; 15.3176; 0; 9.36353; 0; -1.13577\n
1361562032; 45.651; 14.2517; 591.81; -3.54498; -3.44659; 14.2351; 0; 9.39152; 0; -1.07997\n
1363178103; 45.6511; 14.2518; 590.207; -5.14801; -2.8943; 12.4574; 0; 9.23102; 0; -0.991708\n
1364905194; 45.6511; 14.252; 588.48; -6.875; -3.01256; 11.6539; 0; 9.1086; 0; -0.992673\n
1366530969; 45.651; 14.2521; 586.822; -8.53302; -3.82846; 12.0442; 0; 8.5459; 0; -0.352234\n
1368217438; 45.651; 14.2522; 586.822; -8.53302; 4.68173; -4.11477; 0; -0.390974; 0; -0.229508\n
1369874866; 45.651; 14.2522; 586.823; -8.53204; 3.89854; -4.62843; 0; -0.949963; 0; -0.147995\n
1371513426; 45.651; 14.2522; 586.823; -8.53204; 3.581; -5.53074; 0; -0.781149; 0; 0.0254888</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>log_bounce</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1660314565.31</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1002.23817.30233.14233</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1660838998.81</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
/// <reference path="./GameManager.ts" />
TAKEOFF_RADIUS = 60;
LOITER_LIMIT = 30;
LOITER_RADIUS_FACTOR = 0.60;
LOITER_SPEED_FACTOR = 1.5;
var DroneAaileFixeAPI = /** @class */ (function () {
//*************************************************** CONSTRUCTOR **************************************************
function DroneAaileFixeAPI(gameManager, team, flight_parameters) {
this._gameManager = gameManager;
this._team = team;
this._flight_parameters = flight_parameters;
this._loiter_radius = 0;
this._last_loiter_point_reached = -1;
this._last_altitude_point_reached = -1;
}
Object.defineProperty(DroneAaileFixeAPI.prototype, "team", {
//*************************************************** ACCESSOR *****************************************************
get: function () {
if (this._team == "L")
return this._gameManager.teamLeft;
else if (this._team == "R")
return this._gameManager.teamRight;
},
enumerable: true,
configurable: true
});
//*************************************************** FUNCTIONS ****************************************************
//#region ------------------ Internal
DroneAaileFixeAPI.prototype.internal_sendMsg = function (msg, to) {
var _this = this;
_this._gameManager.delay(function () {
if (to < 0) {
// Send to all drones
_this.team.forEach(function (drone) {
if (drone.infosMesh) {
try {
drone.onGetMsg(msg);
}
catch (error) {
console.warn('Drone crashed on sendMsg due to error:', error);
drone._internal_crash();
}
}
});
}
else {
// Send to specific drone
if (drone.infosMesh) {
try {
_this.team[to].onGetMsg(msg);
}
catch (error) {
console.warn('Drone crashed on sendMsg due to error:', error);
_this.team[to]._internal_crash();
}
}
}
}, GAMEPARAMETERS.latency.communication);
};
//#endregion
//#region ------------------ Accessible from AI
DroneAaileFixeAPI.prototype.log = function (msg) {
console.log("API say : " + msg);
};
DroneAaileFixeAPI.prototype.getGameParameter = function (name) {
if (["gameTime", "mapSize", "teamSize", "derive", "meteo", "initialHumanAreaPosition"].includes(name))
return this._gameManager.gameParameter[name];
};
DroneAaileFixeAPI.prototype._isWithinDroneView = function (drone_position, element_position) {
// Check if element is under the drone cone-view
var angle = GAMEPARAMETERS.drone.viewAngle ? GAMEPARAMETERS.drone.viewAngle : 60,
radius = drone_position.z * Math.tan(angle/2 * Math.PI/180),
distance = (drone_position.x - element_position.x) * (drone_position.x - element_position.x) +
(drone_position.y - element_position.y) * (drone_position.y - element_position.y);
if (distance < (radius*radius))
return true;
return false;
};
DroneAaileFixeAPI.prototype._getProbabilityOfDetection = function (drone_position) {
var h = drone_position.z,
km = GAMEPARAMETERS.meteo;
prob = 20 * (1 + (110-h)/25) * km;
return prob;
};
DroneAaileFixeAPI.prototype.isHumanPositionSpottedCalculation = function (drone) {
var context = this,
result = false,
drone_position = drone.infosMesh.position;
//swap axes back
drone_position = {
x: drone_position.x,
y: drone_position.z,
z: drone_position.y
};
context._gameManager.teamRight.forEach(function (human) {
if (human.infosMesh && context._isWithinDroneView(drone_position, human.position)) {
var prob = context._getProbabilityOfDetection(drone_position),
random = Math.floor(Math.random()*101);
if (random < prob)
result = true;
}
});
return result;
};
DroneAaileFixeAPI.prototype.isHumanPositionSpotted = function (drone) {
var context = this,
human_detected;
if (drone.__is_calculating_human_position !== true) {
drone.__is_calculating_human_position = true;
//human detection is done with the info captured by the drone
//at the moment this method is called
human_detected = context.isHumanPositionSpottedCalculation(drone);
context._gameManager.delay(function () {
drone.__is_calculating_human_position = false;
try {
drone.onCapture(human_detected);
} catch (error) {
console.warn('Drone crashed on capture due to error:', error);
drone._internal_crash();
}
}, 2000);
}
};
DroneAaileFixeAPI.prototype.processCoordinates = function (lat, lon, z, r) {
if(isNaN(lat) || isNaN(lon) || isNaN(z)){
throw new Error('Target coordinates must be numbers');
}
var flightParameters = this.getFlightParameters();
function longitudToX(lon, flightParameters) {
return (flightParameters.MAP_SIZE / 360.0) * (180 + lon);
}
function latitudeToY(lat, flightParameters) {
return (flightParameters.MAP_SIZE / 180.0) * (90 - lat);
}
function normalizeToMap(x, y, flightParameters) {
var n_x = (x - flightParameters.MIN_X) / (flightParameters.MAX_X - flightParameters.MIN_X),
n_y = (y - flightParameters.MIN_Y) / (flightParameters.MAX_Y - flightParameters.MIN_Y);
return [n_x * 1000 - flightParameters.MAP_SIZE / 2, n_y * 1000 - flightParameters.MAP_SIZE / 2];
}
var x = longitudToX(lon, flightParameters),
y = latitudeToY(lat, flightParameters),
position = normalizeToMap(x, y, flightParameters);
if (z > flightParameters.start_AMSL) {
z -= flightParameters.start_AMSL;
}
var processed_coordinates = {
x: position[0],
y: position[1],
z: z
};
if (r && r > LOITER_LIMIT) {
this._loiter_radius = r * LOITER_RADIUS_FACTOR;
this._loiter_center = processed_coordinates;
this._loiter_coordinates = [];
this._last_loiter_point_reached = -1;
var x1, y1;
//for (var angle = 0; angle <360; angle+=8){ //counter-clockwise
for (var angle = 360; angle > 0; angle-=8){ //clockwise
x1 = this._loiter_radius * Math.cos(angle * (Math.PI / 180)) + this._loiter_center.x;
y1 = this._loiter_radius * Math.sin(angle * (Math.PI / 180)) + this._loiter_center.y;
this._loiter_coordinates.push(this.processCurrentPosition(x1, y1, z));
}
}
this._last_altitude_point_reached = -1;
this.takeoff_path = [];
return processed_coordinates;
};
DroneAaileFixeAPI.prototype.processCurrentPosition = function (x, y, z) {
//convert x-y coordinates into latitud-longitude
var flightParameters = this.getFlightParameters();
var lon = x + flightParameters.map_width / 2;
lon = lon / 1000;
lon = lon * (flightParameters.MAX_X - flightParameters.MIN_X) + flightParameters.MIN_X;
lon = lon / (flightParameters.map_width / 360.0) - 180;
var lat = y + flightParameters.map_height / 2;
lat = lat / 1000;
lat = lat * (flightParameters.MAX_Y - flightParameters.MIN_Y) + flightParameters.MIN_Y;
lat = 90 - lat / (flightParameters.map_height / 180.0);
return {
x: lat,
y: lon,
z: z
};
};
DroneAaileFixeAPI.prototype.loiter = function (drone) {
function distance(c1, c2) {
var R = 6371e3,
q1 = c1[0] * Math.PI / 180,
q2 = c2[0] * Math.PI / 180,
dq = (c2[0] - c1[0]) * Math.PI / 180,
dl = (c2[1] - c1[1]) * Math.PI / 180,
a = Math.sin(dq / 2) * Math.sin(dq / 2) +
Math.cos(q1) * Math.cos(q2) *
Math.sin(dl / 2) * Math.sin(dl / 2),
c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
return R * c;
}
if (this._loiter_radius > LOITER_LIMIT) {
var drone_pos = drone.getCurrentPosition();
//shift loiter circle to nearest point
if (this._last_loiter_point_reached === -1) {
if (!this.shifted) {
drone._maxSpeed = drone._maxSpeed * LOITER_SPEED_FACTOR;
var min = 9999, min_i;
for (var i = 0; i < this._loiter_coordinates.length; i++){
var d = distance([drone_pos.x, drone_pos.y], [this._loiter_coordinates[i].x, this._loiter_coordinates[i].y]);
if (d < min) {
min = d;
min_i = i;
}
}
this._loiter_coordinates = this._loiter_coordinates.concat(this._loiter_coordinates.splice(0,min_i));
this.shifted = true;
}
} else {
this.shifted = false;
}
//stop
if (this._last_loiter_point_reached === this._loiter_coordinates.length - 1) {
if (drone._maxSpeed !== this.getMaxSpeed()) {
drone._maxSpeed = this.getMaxSpeed();
}
drone.setDirection(0, 0, 0);
return;
}
//loiter
var next_point = this._loiter_coordinates[this._last_loiter_point_reached + 1];
drone.setTargetCoordinates(next_point.x, next_point.y, next_point.z, -1);
if (distance([drone_pos.x, drone_pos.y], [next_point.x, next_point.y]) < 1) {
this._last_loiter_point_reached += 1;
if (this._last_loiter_point_reached === this._loiter_coordinates.length - 1) {
return;
}
next_point = this._loiter_coordinates[this._last_loiter_point_reached + 1];
drone.setTargetCoordinates(next_point.x, next_point.y, next_point.z, -1);
}
}
};
DroneAaileFixeAPI.prototype.getDroneAI = function () {
return null;
};
DroneAaileFixeAPI.prototype.setAltitude = function (altitude, drone, skip_loiter) {
this.takeoff_path = [];
if (skip_loiter) {
var drone_pos = drone.getCurrentPosition();
drone.setTargetCoordinates(drone_pos.x, drone_pos.y, altitude);
return;
}
var x1, y1,
LOOPS = 1,
CIRCLE_ANGLE = 8,
current_point = 0,
total_points = 360/CIRCLE_ANGLE*LOOPS,
initial_altitude = drone.getAltitudeAbs(),
center = {
x: drone._controlMesh.position.x,
y: drone._controlMesh.position.z,
z: drone._controlMesh.position.y
};
for (var l = 0; l <= LOOPS; l+=1){
for (var angle = 360; angle > 0; angle-=CIRCLE_ANGLE){ //clockwise sense
current_point++;
x1 = TAKEOFF_RADIUS * Math.cos(angle * (Math.PI / 180)) + center.x;
y1 = TAKEOFF_RADIUS * Math.sin(angle * (Math.PI / 180)) + center.y;
if (current_point < total_points/3) {
var FACTOR = 0.5;
x1 = center.x*FACTOR + x1*(1-FACTOR);
y1 = center.y*FACTOR + y1*(1-FACTOR);
}
this.takeoff_path.push({x: x1, y: y1, z: initial_altitude + current_point * (altitude-initial_altitude)/total_points});
}
}
};
DroneAaileFixeAPI.prototype.reachAltitude = function (drone) {
function distance(p1, p2) {
return Math.sqrt(Math.pow(p1[0] - p2[0], 2) +
Math.pow(p1[1] - p2[1], 2));
}
//stop
if (this._last_altitude_point_reached === this.takeoff_path.length - 1) {
this._last_altitude_point_reached = -1;
this.takeoff_path = [];
drone._start_altitude = 0;
drone.setDirection(0, 0, 0);
return;
}
//loiter
var drone_pos = {
x: drone._controlMesh.position.x,
y: drone._controlMesh.position.z,
z: drone._controlMesh.position.y
};
var next_point = this.takeoff_path[this._last_altitude_point_reached + 1];
drone.internal_setTargetCoordinates(next_point.x, next_point.y, next_point.z);
if (distance([drone_pos.x, drone_pos.y], [next_point.x, next_point.y]) < 1) {
this._last_altitude_point_reached += 1;
if (this._last_altitude_point_reached === this.takeoff_path.length - 1) {
return;
}
next_point = this.takeoff_path[this._last_altitude_point_reached + 1];
drone.internal_setTargetCoordinates(next_point.x, next_point.y, next_point.z);
}
};
DroneAaileFixeAPI.prototype.getMaxSpeed = function () {
return GAMEPARAMETERS.drone.maxSpeed;
};
DroneAaileFixeAPI.prototype.doParachute = function (drone) {
//TODO what to do here?
drone.setDirection(0, 0, 0);
};
DroneAaileFixeAPI.prototype.landed = function (drone) {
var drone_pos = drone.getCurrentPosition();
return Math.floor(drone_pos.z) === 0;
};
DroneAaileFixeAPI.prototype.exit = function (drone) {
//TODO what to do here?
drone.setDirection(0, 0, 0);
};
DroneAaileFixeAPI.prototype.getInitialAltitude = function () {
return 0;
};
DroneAaileFixeAPI.prototype.getAltitudeAbs = function (altitude) {
return altitude;
};
DroneAaileFixeAPI.prototype.getMinHeight = function () {
return 0;
};
DroneAaileFixeAPI.prototype.getMaxHeight = function () {
return 800;
};
DroneAaileFixeAPI.prototype.getFlightParameters = function () {
return this._flight_parameters;
};
return DroneAaileFixeAPI;
}());
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>DroneAaileFixeAPI.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>drone_web_worker_aaile_fixe_api_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Drone Aaile Fixe API JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1662556209.39</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1003.4484.47794.56558</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1663611202.23</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>empty</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1662555990.53</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
/// <reference path="./GameManager.ts" />
var DroneAPI = /** @class */ (function () {
//*************************************************** CONSTRUCTOR **************************************************
function DroneAPI(gameManager, team) {
this._gameManager = gameManager;
this._team = team;
}
Object.defineProperty(DroneAPI.prototype, "team", {
//*************************************************** ACCESSOR *****************************************************
get: function () {
if (this._team == "L")
return this._gameManager.teamLeft;
else if (this._team == "R")
return this._gameManager.teamRight;
},
enumerable: true,
configurable: true
});
//*************************************************** FUNCTIONS ****************************************************
//#region ------------------ Internal
DroneAPI.prototype.internal_sendMsg = function (msg, to) {
var _this = this;
_this._gameManager.delay(function () {
if (to < 0) {
// Send to all drones
_this.team.forEach(function (drone) {
if (drone.infosMesh) {
try {
drone.onGetMsg(msg);
}
catch (error) {
console.warn('Drone crashed on sendMsg due to error:', error);
drone._internal_crash();
}
}
});
}
else {
// Send to specific drone
if (drone.infosMesh) {
try {
_this.team[to].onGetMsg(msg);
}
catch (error) {
console.warn('Drone crashed on sendMsg due to error:', error);
_this.team[to]._internal_crash();
}
}
}
}, GAMEPARAMETERS.latency.communication);
};
//#endregion
//#region ------------------ Accessible from AI
DroneAPI.prototype.log = function (msg) {
console.log("API say : " + msg);
};
DroneAPI.prototype.getGameParameter = function (name) {
if (["gameTime", "mapSize", "teamSize", "derive", "meteo", "initialHumanAreaPosition"].includes(name))
return this._gameManager.gameParameter[name];
};
DroneAPI.prototype._isWithinDroneView = function (drone_position, element_position) {
// Check if element is under the drone cone-view
var angle = GAMEPARAMETERS.drone.viewAngle ? GAMEPARAMETERS.drone.viewAngle : 60,
radius = drone_position.z * Math.tan(angle/2 * Math.PI/180),
distance = (drone_position.x - element_position.x) * (drone_position.x - element_position.x) +
(drone_position.y - element_position.y) * (drone_position.y - element_position.y);
if (distance < (radius*radius))
return true;
return false;
};
DroneAPI.prototype._getProbabilityOfDetection = function (drone_position) {
var h = drone_position.z,
km = GAMEPARAMETERS.meteo;
prob = 20 * (1 + (110-h)/25) * km;
return prob;
};
DroneAPI.prototype.isHumanPositionSpottedCalculation = function (drone) {
var context = this,
result = false,
drone_position = drone.infosMesh.position;
//swap axes back
drone_position = {
x: drone_position.x,
y: drone_position.z,
z: drone_position.y
};
context._gameManager.teamRight.forEach(function (human) {
if (human.infosMesh && context._isWithinDroneView(drone_position, human.position)) {
var prob = context._getProbabilityOfDetection(drone_position),
random = Math.floor(Math.random()*101);
if (random < prob)
result = true;
}
});
return result;
};
DroneAPI.prototype.isHumanPositionSpotted = function (drone) {
var context = this,
human_detected;
if (drone.__is_calculating_human_position !== true) {
drone.__is_calculating_human_position = true;
//human detection is done with the info captured by the drone
//at the moment this method is called
human_detected = context.isHumanPositionSpottedCalculation(drone);
context._gameManager.delay(function () {
drone.__is_calculating_human_position = false;
try {
drone.onCapture(human_detected);
} catch (error) {
console.warn('Drone crashed on capture due to error:', error);
drone._internal_crash();
}
}, 2000);
}
};
DroneAPI.prototype.getDirectionFromCoordinates = function (x, y, z, drone_position) {
if(isNaN(x) || isNaN(y) || isNaN(z)){
throw new Error('Target coordinates must be numbers');
}
x -= drone_position.x;
y -= drone_position.y;
z -= drone_position.z;
if (this._team == "R")
y = -y;
return {
x: x,
y: y,
z: z
};
};
DroneAPI.prototype.setAltitude = function (altitude) {
//TODO
return;
};
DroneAPI.prototype.getInitialAltitude = function () {
return 0;
};
DroneAPI.prototype.getAltitudeAbs = function () {
return 0;
};
DroneAPI.prototype.getMinHeight = function () {
return 9;
};
DroneAPI.prototype.getMaxHeight = function () {
return 220;
};
DroneAPI.prototype.getDroneAI = function () {
return null;
};
DroneAPI.prototype.getMaxSpeed = function () {
return GAMEPARAMETERS.drone.maxSpeed;
};
return DroneAPI;
}());
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>DroneAPI.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>drone_web_worker_drone_api_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Drone API JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1662556207.86</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1002.52438.8605.21913</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1662556286.54</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>empty</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1662555993.71</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
/// <reference path="./typings/babylon.3.1.d.ts" />
/// <reference path="./DroneAPI.ts" />
/// <reference path="./DroneLogAPI.ts" />
/// <reference path="./DroneAaileFixeAPI.ts" />
var DroneManager = /** @class */ (function () {
//*************************************************** CONSTRUCTOR **************************************************
function DroneManager(scene, id, team, API) {
var _this = this;
// Mesh
this._mesh = null;
this._controlMesh = null;
this._colliderBackMesh = null;
this._canPlay = false;
this._canCommunicate = false;
this._maxAcceleration = 0;
this._maxSpeed = 0;
this._speed = 0;
this._acceleration = 0;
this._direction = BABYLON.Vector3.Zero();
this._rotationSpeed = 0.4;
this._maxOrientation = Math.PI / 4;
this._scene = scene;
this._canUpdate = true;
this._id = id;
this._leader_id = 0;
this._team = team;
this._start_loiter = 0;
this._start_altitude = 0;
this._API = API; // var API created on AI evel
// Create the control mesh
this._controlMesh = BABYLON.Mesh.CreateBox("droneControl_" + id, 0.01, this._scene);
this._controlMesh.isVisible = false;
if (this._team == "R")
this._controlMesh.rotation = new BABYLON.Vector3(0, Math.PI, 0);
this._controlMesh.computeWorldMatrix(true);
// Create the mesh from the drone prefab
this._mesh = DroneManager.Prefab.clone("drone_" + id, this._controlMesh);
this._mesh.position = BABYLON.Vector3.Zero();
this._mesh.isVisible = false;
this._mesh.computeWorldMatrix(true);
// Get the back collider
this._mesh.getChildMeshes().forEach(function (mesh) {
if (mesh.name.substring(mesh.name.length - 13) == "Dummy_arriere") {
_this._colliderBackMesh = mesh;
_this._colliderBackMesh.isVisible = false;
}
else {
if (_this._team !== "R") {
mesh.isVisible = true;
} else {
mesh.isVisible = false;
_this._colliderBackMesh = mesh;
_this._colliderBackMesh.isVisible = false;
}
}
});
// Team color
if (!DroneManager.PrefabBlueMat || !DroneManager.PrefabRedMat) {
DroneManager.PrefabBlueMat = new BABYLON.StandardMaterial("blueTeamMat", scene);
DroneManager.PrefabBlueMat.diffuseTexture = new BABYLON.Texture("assets/drone/drone_bleu.jpg", scene);
DroneManager.PrefabRedMat = new BABYLON.StandardMaterial("redTeamMat", scene);
DroneManager.PrefabRedMat.diffuseTexture = new BABYLON.Texture("assets/drone/drone_rouge.jpg", scene);
}
this._propellerAnimMeshes = [];
this._mesh.getChildren().forEach(function (mesh) {
// Propeller animation
if (mesh.name.substring(mesh.name.length - 7, mesh.name.length - 1) == "helice") {
var anim = new BABYLON.Animation("propellerTurning_" + mesh.name, "rotation.y", 20, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
var keys = [
{ frame: 0, value: 0 },
{ frame: 2, value: Math.PI },
{ frame: 4, value: Math.PI * 2 }
];
anim.setKeys(keys);
mesh.animations.push(anim);
_this._scene.beginAnimation(mesh, 0, 4, true);
_this._propellerAnimMeshes.push(mesh);
}
else {
if (_this._team == "L") {
mesh.material = DroneManager.PrefabBlueMat;
}
else if (_this._team == "R") {
mesh.material = DroneManager.PrefabRedMat;
}
}
});
}
DroneManager.prototype._swapAxe = function (vector) {
return new BABYLON.Vector3(vector.x, vector.z, vector.y);
};
Object.defineProperty(DroneManager.prototype, "leader_id", {
//*************************************************** ACCESSOR *****************************************************
get: function () { return this._leader_id; },
enumerable: true,
configurable: true
});
Object.defineProperty(DroneManager.prototype, "id", {
//*************************************************** ACCESSOR *****************************************************
get: function () { return this._id; },
enumerable: true,
configurable: true
});
Object.defineProperty(DroneManager.prototype, "team", {
get: function () { return this._team; },
enumerable: true,
configurable: true
});
Object.defineProperty(DroneManager.prototype, "colliderMesh", {
get: function () { return this._mesh; },
enumerable: true,
configurable: true
});
Object.defineProperty(DroneManager.prototype, "colliderBackMesh", {
get: function () { return this._colliderBackMesh; },
enumerable: true,
configurable: true
});
Object.defineProperty(DroneManager.prototype, "infosMesh", {
get: function () { return this._controlMesh; },
enumerable: true,
configurable: true
});
Object.defineProperty(DroneManager.prototype, "position", {
get: function () {
if (this._controlMesh !== null) {
return this._swapAxe(this._controlMesh.position);
}
return null;
},
enumerable: true,
configurable: true
});
Object.defineProperty(DroneManager.prototype, "rotation", {
get: function () { return this._swapAxe(this._controlMesh.rotation); },
enumerable: true,
configurable: true
});
Object.defineProperty(DroneManager.prototype, "speed", {
get: function () { return this._speed; },
enumerable: true,
configurable: true
});
Object.defineProperty(DroneManager.prototype, "direction", {
get: function () { return this._swapAxe(this._direction); },
enumerable: true,
configurable: true
});
Object.defineProperty(DroneManager.prototype, "worldDirection", {
get: function () {
var t = this.team === "L" ? 1 : -1;
return new BABYLON.Vector3(t * this._direction.x, this._direction.y, t * this._direction.z);
},
enumerable: true,
configurable: true
});
//*************************************************** FUNCTIONS ****************************************************
//#region ------------------ Internal
// Function called by the GameManager
// Set internal variables then call API function
DroneManager.prototype.internal_start = function () {
this._maxAcceleration = GAMEPARAMETERS.drone.maxAcceleration;
if (this._team == "R") {
if (GAMEPARAMETERS.derive) {
this._maxSpeed = GAMEPARAMETERS.derive.speed;
} else {
this._maxSpeed = 0;
}
} else {
this._maxSpeed = this._API.getMaxSpeed();
}
this._canPlay = true;
this._canCommunicate = true;
try {
return this.onStart();
} catch (error) {
console.warn('Drone crashed on start due to error:', error);
this._internal_crash();
}
};
/**
* Set a target point to move
*/
DroneManager.prototype.internal_setTargetCoordinates = function (x, y, z) {
if (!this._canPlay)
return;
x -= this._controlMesh.position.x;
y -= this._controlMesh.position.z;
z -= this._controlMesh.position.y;
this.setDirection(x, y, z);
this.setAcceleration(this._maxAcceleration);
return;
};
DroneManager.prototype.internal_update = function (delta_time) {
var context = this;
if (this._controlMesh) {
if (context._rotationTarget) {
var rotStep = BABYLON.Vector3.Zero();
var diff = context._rotationTarget.subtract(context._controlMesh.rotation);
if (diff.x >= 1)
rotStep.x = 1;
else
rotStep.x = diff.x;
if (diff.y >= 1)
rotStep.y = 1;
else
rotStep.y = diff.y;
if (diff.z >= 1)
rotStep.z = 1;
else
rotStep.z = diff.z;
if (rotStep == BABYLON.Vector3.Zero()) {
context._rotationTarget = null;
return;
}
var newrot = new BABYLON.Vector3(context._controlMesh.rotation.x + (rotStep.x * context._rotationSpeed), context._controlMesh.rotation.y + (rotStep.y * context._rotationSpeed), context._controlMesh.rotation.z + (rotStep.z * context._rotationSpeed));
context._controlMesh.rotation = newrot;
}
context._speed += context._acceleration * delta_time / 1000;
if (context._speed > context._maxSpeed)
context._speed = context._maxSpeed;
if (context._speed < -context._maxSpeed)
context._speed = -context._maxSpeed;
var updateSpeed = context._speed * delta_time / 1000;
if (context._direction.x != 0
|| context._direction.y != 0
|| context._direction.z != 0) {
context._controlMesh.position.addInPlace(new BABYLON.Vector3(context._direction.x * updateSpeed, context._direction.y * updateSpeed, context._direction.z * updateSpeed));
}
var orientationValue = context._maxOrientation * (context._speed / context._maxSpeed);
context._mesh.rotation = new BABYLON.Vector3(orientationValue * context._direction.z, 0, -orientationValue * context._direction.x);
context._controlMesh.computeWorldMatrix(true);
context._mesh.computeWorldMatrix(true);
if (context._canUpdate) {
context._canUpdate = false;
return new RSVP.Queue()
.push(function () {
return context.onUpdate(context._API._gameManager._game_duration);
})
.push(function () {
context._canUpdate = true;
}, function (err) {
console.warn('Drone crashed on update due to error:', err);
context._internal_crash();
})
.push(function () {
if (context._start_loiter > 0) {
context._API.loiter(context);
}
if (context._start_altitude > 0) {
context._API.reachAltitude(context);
}
});
}
return;
}
return;
};
DroneManager.prototype.internal_touch = function () {
var _this = this;
this.setRotationBy(0, 0, 0);
this.setDirection(0, 0, -1);
this.setAcceleration(this._maxAcceleration);
this._canPlay = false;
if (this._propellerAnimMeshes != null) {
try {
this._propellerAnimMeshes.forEach(function (mesh) {
_this._scene.stopAnimation(mesh);
});
}
catch (ex) { }
this._propellerAnimMeshes = null;
}
this._canCommunicate = false;
this._controlMesh = null;
this._mesh = null;
this.onTouched();
};
DroneManager.prototype._internal_crash = function () {
var _this = this;
if (this._propellerAnimMeshes !== null) {
try {
this._propellerAnimMeshes.forEach(function (mesh) {
_this._scene.stopAnimation(mesh);
});
}
catch (ex) { }
this._propellerAnimMeshes = null;
}
this._canCommunicate = false;
this._controlMesh = null;
this._mesh = null;
this._canPlay = false;
this.onTouched();
this._API._gameManager._onDroneInternalCrash(this);
};
DroneManager.prototype._internal_dispose = function () {
if (this._mesh) {
this._mesh.dispose();
this._mesh = null;
this._controlMesh.dispose();
this._controlMesh = null;
}
};
DroneManager.prototype.internal_finish = function () {
this._canPlay = false;
this._canCommunicate = false;
this._controlMesh = null;
};
DroneManager.prototype.can_play = function () {
return this._canPlay;
};
//#endregion
//#region ------------------ Accessible from AI
// Function callable by "me.functionName()" in AI code
// -- Starting info
/**
* Set the starting position of the drone
* Take x,y,z coordinates as parameters
*/
DroneManager.prototype.setStartingPosition = function (x, y, z) {
if(isNaN(x) || isNaN(y) || isNaN(z)){
throw new Error('Position coordinates must be numbers');
}
if (!this._canPlay) {
if (z <= 0.05)
z = 0.05;
this._controlMesh.position = new BABYLON.Vector3(x, z, y);
}
this._controlMesh.computeWorldMatrix(true);
this._mesh.computeWorldMatrix(true);
};
//#region -- Movements
/**
* Set the drone acceleration
* It is in meter / second
*/
DroneManager.prototype.setAcceleration = function (factor) {
if (!this._canPlay)
return;
if (isNaN(factor)){
throw new Error('Acceleration must be a number');
}
if (factor > this._maxAcceleration)
factor = this._maxAcceleration;
this._acceleration = factor;
};
//#region -- Movements
/**
* Set the human derive acceleration
* It is in meter / second
* It has no cap to allow constant speed
*/
DroneManager.prototype.setHumanAcceleration = function (factor) {
if (!this._canPlay)
return;
if (isNaN(factor)){
throw new Error('Acceleration must be a number');
}
this._acceleration = factor;
};
/**
* Set the drone direction
*/
DroneManager.prototype.setDirection = function (x, y, z) {
if (!this._canPlay)
return;
if(isNaN(x) || isNaN(y) || isNaN(z)){
throw new Error('Direction coordinates must be numbers');
}
this._direction = new BABYLON.Vector3(x, z, y).normalize();
};
/**
* Set the drone rotation
*/
DroneManager.prototype.setRotation = function (x, y, z) {
if (!this._canPlay)
return;
if (this._team == "R")
y += Math.PI;
this._rotationTarget = new BABYLON.Vector3(x, z, y);
};
/**
* Add this rotation to the actual drone rotation
*/
DroneManager.prototype.setRotationBy = function (x, y, z) {
if (!this._canPlay)
return;
this._rotationTarget = new BABYLON.Vector3(this.rotation.x + x, this.rotation.y + z, this.rotation.z + y);
};
/**
* Set a target point to move
*/
DroneManager.prototype.setTargetCoordinates = function (x, y, z, r) {
if (!this._canPlay)
return;
//HACK too specific for DroneAaileFixe, should be a flag: (bool)process?
if (r !== -1) {
this._start_loiter = 0;
this._maxSpeed = this._API.getMaxSpeed();
}
this._start_altitude = 0;
var coordinates = this._API.processCoordinates(x, y, z, r);
coordinates.x -= this._controlMesh.position.x;
coordinates.y -= this._controlMesh.position.z;
coordinates.z -= this._controlMesh.position.y;
if (this.team == "R")
coordinates.y = -coordinates.y;
this.setDirection(coordinates.x, coordinates.y, coordinates.z);
this.setAcceleration(this._maxAcceleration);
return;
};
//#endregion
//#region -- Messaging
/**
* Send a message to team drones
* @param msg The message to send
* @param id The targeted drone. -1 or nothing to broadcast
*/
DroneManager.prototype.sendMsg = function (msg, id) {
//TODO
return;
var _this = this;
if (!this._canCommunicate)
return;
if (id >= 0) { }
else
id = -1;
if (_this.infosMesh) {
return _this._API.internal_sendMsg(JSON.parse(JSON.stringify(msg)), id);
}
};
/**
* Perform a console.log with drone id + the message
*/
DroneManager.prototype.log = function (msg) { };
//#endregion
//#region -- Game informations
/**
* Get drone max height
*/
DroneManager.prototype.getMaxHeight = function () {
return this._API.getMaxHeight();
};
/**
* Get drone min height
*/
DroneManager.prototype.getMinHeight = function () {
return this._API.getMinHeight();
};
/**
* Get drone initial altitude
*/
DroneManager.prototype.getInitialAltitude = function () {
return this._API.getInitialAltitude();
};
/**
* Get drone absolute altitude
*/
DroneManager.prototype.getAltitudeAbs = function () {
if (this._controlMesh) {
var altitude = this._controlMesh.position.y;
return this._API.getAltitudeAbs(altitude);
}
return null;
};
/**
* Get a game parameter by name
* @param name Name of the parameter to retrieve
*/
DroneManager.prototype.getGameParameter = function (name) {
if (!this._canCommunicate)
return;
return this._API.getGameParameter(name);
};
/**
* get if drone detects the human position
*/
DroneManager.prototype.isHumanPositionSpotted = function () {
if (!this._canCommunicate)
return;
return this._API.isHumanPositionSpotted(this);
};
/**
* get current drone position
*/
DroneManager.prototype.getCurrentPosition = function () {
if (this._controlMesh)
return this._API.processCurrentPosition(
this._controlMesh.position.x,
this._controlMesh.position.z,
this._controlMesh.position.y
);
return null;
};
/**
* Set the drone altitude
* @param altitude information to be set
*/
DroneManager.prototype.setAltitude = function (altitude, skip_loiter) {
if (!this._canPlay)
return;
if (this._start_altitude === 0) {
this._start_altitude = 1;
}
altitude = this._API.setAltitude(altitude, this, skip_loiter);
return;
};
/**
* Make the drone loiter
*/
DroneManager.prototype.loiter = function () {
if (!this._canPlay)
return;
if (this._start_loiter === 0) {
this._start_loiter = 1;
}
};
/**
* Set the reported human position
* @param position information to be set
*/
DroneManager.prototype.reportHumanPosition = function (position) {
this._API._gameManager.reportHumanPosition(position);
};
/**
* get log flight parameters
*/
DroneManager.prototype.getFlightParameters = function () {
if (this._API.getFlightParameters)
return this._API.getFlightParameters();
return null;
};
/**
* get yaw flight parameters
*/
DroneManager.prototype.getYaw = function () {
//TODO
return 0;
};
/**
* do parachute
*/
DroneManager.prototype.doParachute = function () {
return this._API.doParachute(this);
};
/**
* exit
*/
DroneManager.prototype.exit = function () {
return this._API.exit(this);
};
/**
* landed
*/
DroneManager.prototype.landed = function () {
return this._API.landed(this);
};
/**
* Set the drone last checkpoint reached
* @param checkpoint to be set
*/
DroneManager.prototype.setCheckpoint = function (checkpoint) {
//TODO
return null;
};
//#endregion
//#endregion
//#region ------------------ To be defined in AI code
// Function called on evt.
// These functions must be defined in the AI code
/**
* Function called on game start
*/
DroneManager.prototype.onStart = function () { };
;
/**
* Function called on game update
*/
DroneManager.prototype.onUpdate = function (timestamp) { };
;
/**
* Function called when drone die (crash or collision)
*/
DroneManager.prototype.onTouched = function () { };
;
/**
* Function called when a message is received
* @param msg The message
*/
DroneManager.prototype.onGetMsg = function (msg) { };
;
/**
* Function called when drone finishes the detection process
* @param human_detected true or false
*/
DroneManager.prototype.onCapture = function (human_detected) { };
;
return DroneManager;
}());
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>DroneManager.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>drone_web_worker_drone_manager_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Drone Manager JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1662556210.06</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1003.4485.30969.53230</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1663614606.63</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>empty</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1662555985.78</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -61,14 +61,12 @@ var GameManager = /** @class */ (function () { ...@@ -61,14 +61,12 @@ var GameManager = /** @class */ (function () {
GameManager.prototype.run = function () { GameManager.prototype.run = function () {
var gadget = this; var gadget = this;
return gadget._init(); return gadget._init()
}; .push(function () {
//TODO return result
GameManager.prototype.event = function (event) { gadget._final_score = "fake-result 000";
var _this = this; return gadget._final_score;
//TODO });
console.log("[GM] Event. this._camera:", this._camera);
console.log("[GM] Event. event:", event);
}; };
GameManager.prototype.update = function () { GameManager.prototype.update = function () {
...@@ -90,7 +88,11 @@ var GameManager = /** @class */ (function () { ...@@ -90,7 +88,11 @@ var GameManager = /** @class */ (function () {
_this.ongoing_update_promise = null; _this.ongoing_update_promise = null;
triggerUpdateIfPossible(); triggerUpdateIfPossible();
}) })
.push(undefined, _this.finish_deferred.reject.bind(_this.finish_deferred)); .push(undefined, function(error) {
console.log("ERROR on update:", error);
console.log("rejecting finish_deferred promise...");
_this.finish_deferred.reject.bind(_this.finish_deferred);
});
} }
} }
triggerUpdateIfPossible(); triggerUpdateIfPossible();
...@@ -202,12 +204,23 @@ var GameManager = /** @class */ (function () { ...@@ -202,12 +204,23 @@ var GameManager = /** @class */ (function () {
}); });
return queue return queue
//TODO finish .push(function () {
/*.push(function () { if (_this._timeOut()) {
if (_this._allDroneAreOut()) { console.log("TIMEOUT!");
return _this._finish(); return _this._finish();
} }
})*/; });
};
GameManager.prototype._timeOut = function () {
var seconds = Math.floor(this._game_duration / 1000);
return this._totalTime - seconds <= 0;
};
GameManager.prototype._finish = function () {
console.log("Simulation finished");
this._canUpdate = false;
return this.finish_deferred.resolve();
}; };
GameManager.prototype._dispose = function () { GameManager.prototype._dispose = function () {
...@@ -392,7 +405,6 @@ var GameManager = /** @class */ (function () { ...@@ -392,7 +405,6 @@ var GameManager = /** @class */ (function () {
// Timing // Timing
this._game_duration = 0; this._game_duration = 0;
this._totalTime = GAMEPARAMETERS.gameTime; this._totalTime = GAMEPARAMETERS.gameTime;
this._canUpdate = true;
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
...@@ -408,34 +420,7 @@ var GameManager = /** @class */ (function () { ...@@ -408,34 +420,7 @@ var GameManager = /** @class */ (function () {
return RSVP.all(promise_list); return RSVP.all(promise_list);
}) })
.push(function () { .push(function () {
//The loop is handle from the outside (webworker) _this._canUpdate = true;
//_this._scene.registerBeforeRender(function () { console.log("loop"); });
/*_this._scene.registerBeforeRender(function () {
// To increase the game speed, increase this value
_this._max_step_animation_frame = 10;
// time delta means that drone are updated every virtual second
// This is fixed and must not be modified
// otherwise, it will lead to different scenario results
// (as drone calculations may be triggered less often)
var TIME_DELTA = 1000 / 60, i;
// init the value on the first step
_this.waiting_update_count = _this._max_step_animation_frame;
function triggerUpdateIfPossible() {
if ((_this._canUpdate) && (_this.ongoing_update_promise === null) && (0 < _this.waiting_update_count)) {
_this.ongoing_update_promise = _this._update(TIME_DELTA, (_this.waiting_update_count === 1))
.push(function () {
_this.waiting_update_count -= 1;
_this.ongoing_update_promise = null;
triggerUpdateIfPossible();
})
.push(undefined, _this.finish_deferred.reject.bind(_this.finish_deferred));
}
}
triggerUpdateIfPossible();
});*/
//TODO solving promise so game-start finishes and web worker can update
_this.finish_deferred.resolve();
return _this.finish_deferred.promise; return _this.finish_deferred.promise;
}); });
}; };
......
...@@ -10,11 +10,8 @@ ...@@ -10,11 +10,8 @@
<key> <string>_Access_contents_information_Permission</string> </key> <key> <string>_Access_contents_information_Permission</string> </key>
<value> <value>
<tuple> <tuple>
<string>Anonymous</string>
<string>Assignee</string> <string>Assignee</string>
<string>Assignor</string> <string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string> <string>Manager</string>
</tuple> </tuple>
</value> </value>
...@@ -52,11 +49,8 @@ ...@@ -52,11 +49,8 @@
<key> <string>_View_Permission</string> </key> <key> <string>_View_Permission</string> </key>
<value> <value>
<tuple> <tuple>
<string>Anonymous</string>
<string>Assignee</string> <string>Assignee</string>
<string>Assignor</string> <string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string> <string>Manager</string>
</tuple> </tuple>
</value> </value>
...@@ -169,7 +163,7 @@ ...@@ -169,7 +163,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>action</string> </key> <key> <string>action</string> </key>
<value> <string>publish_alive</string> </value> <value> <string>hide</string> </value>
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
...@@ -195,7 +189,7 @@ ...@@ -195,7 +189,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1662555757.05</float> <float>1664290777.68</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
...@@ -204,7 +198,7 @@ ...@@ -204,7 +198,7 @@
</item> </item>
<item> <item>
<key> <string>validation_state</string> </key> <key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value> <value> <string>hidden</string> </value>
</item> </item>
</dictionary> </dictionary>
</list> </list>
...@@ -244,7 +238,7 @@ ...@@ -244,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1003.14332.42567.56439</string> </value> <value> <string>1003.15811.41174.17766</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -262,7 +256,7 @@ ...@@ -262,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1664202073.56</float> <float>1664291563.2</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/// <reference path="./GameManager.ts" />
var DroneLogAPI = /** @class */ (function () {
//*************************************************** CONSTRUCTOR **************************************************
function DroneLogAPI(gameManager, team, flight_parameters) {
this._gameManager = gameManager;
this._team = team;
this._flight_parameters = flight_parameters;
}
Object.defineProperty(DroneLogAPI.prototype, "team", {
//*************************************************** ACCESSOR *****************************************************
get: function () {
if (this._team == "L")
return this._gameManager.teamLeft;
else if (this._team == "R")
return this._gameManager.teamRight;
},
enumerable: true,
configurable: true
});
//*************************************************** FUNCTIONS ****************************************************
//#region ------------------ Internal
DroneLogAPI.prototype.internal_sendMsg = function (msg, to) {
var _this = this;
_this._gameManager.delay(function () {
if (to < 0) {
// Send to all drones
_this.team.forEach(function (drone) {
if (drone.infosMesh) {
try {
drone.onGetMsg(msg);
}
catch (error) {
console.warn('Drone crashed on sendMsg due to error:', error);
drone._internal_crash();
}
}
});
}
else {
// Send to specific drone
if (drone.infosMesh) {
try {
_this.team[to].onGetMsg(msg);
}
catch (error) {
console.warn('Drone crashed on sendMsg due to error:', error);
_this.team[to]._internal_crash();
}
}
}
}, GAMEPARAMETERS.latency.communication);
};
//#endregion
//#region ------------------ Accessible from AI
DroneLogAPI.prototype.log = function (msg) {
console.log("API say : " + msg);
};
DroneLogAPI.prototype.getGameParameter = function (name) {
if (["gameTime", "mapSize", "teamSize", "derive", "meteo", "initialHumanAreaPosition"].includes(name))
return this._gameManager.gameParameter[name];
};
DroneLogAPI.prototype._isWithinDroneView = function (drone_position, element_position) {
// Check if element is under the drone cone-view
var angle = GAMEPARAMETERS.drone.viewAngle ? GAMEPARAMETERS.drone.viewAngle : 60,
radius = drone_position.z * Math.tan(angle/2 * Math.PI/180),
distance = (drone_position.x - element_position.x) * (drone_position.x - element_position.x) +
(drone_position.y - element_position.y) * (drone_position.y - element_position.y);
if (distance < (radius*radius))
return true;
return false;
};
DroneLogAPI.prototype._getProbabilityOfDetection = function (drone_position) {
var h = drone_position.z,
km = GAMEPARAMETERS.meteo;
prob = 20 * (1 + (110-h)/25) * km;
return prob;
};
DroneLogAPI.prototype.isHumanPositionSpottedCalculation = function (drone) {
var context = this,
result = false,
drone_position = drone.infosMesh.position;
//swap axes back
drone_position = {
x: drone_position.x,
y: drone_position.z,
z: drone_position.y
};
context._gameManager.teamRight.forEach(function (human) {
if (human.infosMesh && context._isWithinDroneView(drone_position, human.position)) {
var prob = context._getProbabilityOfDetection(drone_position),
random = Math.floor(Math.random()*101);
if (random < prob)
result = true;
}
});
return result;
};
DroneLogAPI.prototype.isHumanPositionSpotted = function (drone) {
var context = this,
human_detected;
if (drone.__is_calculating_human_position !== true) {
drone.__is_calculating_human_position = true;
//human detection is done with the info captured by the drone
//at the moment this method is called
human_detected = context.isHumanPositionSpottedCalculation(drone);
context._gameManager.delay(function () {
drone.__is_calculating_human_position = false;
try {
drone.onCapture(human_detected);
} catch (error) {
console.warn('Drone crashed on capture due to error:', error);
drone._internal_crash();
}
}, 2000);
}
};
DroneLogAPI.prototype.processCoordinates = function (x, y, z) {
if(isNaN(x) || isNaN(y) || isNaN(z)){
throw new Error('Target coordinates must be numbers');
}
return {
x: x,
y: y,
z: z
};
};
DroneLogAPI.prototype.getDroneAI = function () {
return 'function distance(p1, p2) {' +
'var a = p1[0] - p2[0],' +
'b = p1[1] - p2[1];' +
'return Math.sqrt(a * a + b * b);' +
'}' +
'me.onStart = function() {' +
'console.log("DRONE LOG START!");' +
'if (!me.getFlightParameters())' +
'throw "DroneLog API must implement getFlightParameters";' +
'me.flightParameters = me.getFlightParameters();' +
'me.checkpoint_list = me.flightParameters.converted_log_point_list;' +
'me.startTime = new Date();' +
'me.initTimestamp = me.flightParameters.converted_log_point_list[0][3];' +
'me.setTargetCoordinates(me.checkpoint_list[0][0], me.checkpoint_list[0][1], me.checkpoint_list[0][2]);' +
'me.last_checkpoint_reached = -1;' +
'me.setAcceleration(10);' +
'};' +
'me.onUpdate = function () {' +
'var next_checkpoint = me.checkpoint_list[me.last_checkpoint_reached+1];' +
'if (distance([me.position.x, me.position.y], next_checkpoint) < 12) {' +
'var log_elapsed = next_checkpoint[3] - me.initTimestamp,' +
'time_elapsed = new Date() - me.startTime;' +
'if (time_elapsed < log_elapsed) {' +
'me.setDirection(0, 0, 0);' +
'return;' +
'}' +
'if (me.last_checkpoint_reached + 1 === me.checkpoint_list.length - 1) {' +
'me.setTargetCoordinates(me.position.x, me.position.y, me.position.z);' +
'return;' +
'}' +
'me.last_checkpoint_reached += 1;' +
'next_checkpoint = me.checkpoint_list[me.last_checkpoint_reached+1];' +
'me.setTargetCoordinates(next_checkpoint[0], next_checkpoint[1], next_checkpoint[2]);' +
'} else {' +
'me.setTargetCoordinates(next_checkpoint[0], next_checkpoint[1], next_checkpoint[2]);' +
'}' +
'};';
};
DroneLogAPI.prototype.setAltitude = function (altitude) {
return altitude;
};
DroneLogAPI.prototype.getMaxSpeed = function () {
return 3000;
};
DroneLogAPI.prototype.getInitialAltitude = function () {
return 0;
};
DroneLogAPI.prototype.getAltitudeAbs = function () {
return 0;
};
DroneLogAPI.prototype.getMinHeight = function () {
return 0;
};
DroneLogAPI.prototype.getMaxHeight = function () {
return 220;
};
DroneLogAPI.prototype.getFlightParameters = function () {
return this._flight_parameters;
};
return DroneLogAPI;
}());
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>DroneLogAPI.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>drone_web_worker_log_api_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Drone Log API JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1662556208.64</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1003.194.53408.47940</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1663355083.2</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>empty</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1662555993.19</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
/*global GameManager, console*/ /*global GameManager, console*/
/*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80 */ /*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80 */
/*********************** DRONE SIMULATOR LOGIC ********************************/
var runGame, updateGame, eventGame, game_manager_instance; var runGame, updateGame, eventGame, game_manager_instance;
// game.js // game.js
(function () { (function () {
"use strict"; "use strict";
console.log('game logic'); console.log('game logic');
runGame = function (canvas, script, game_parameters_json, log) { runGame = function (canvas, script, log) {
var game_parameters_json = {
"drone": {
"maxAcceleration": 1,
"maxSpeed": 16.666667
},
"gameTime": 1800,
"latency": {
"information": 0,
"communication": 0
},
"initialPosition": {
"x": 0,
"y": 0,
"z": 20
},
"droneList": ["DroneAaileFixeAPI", "DroneLogAPI"]
};
function processLog(game_parameters_json, log) { function processLog(game_parameters_json, log) {
var MAP_SIZE = 1000, var MAP_SIZE,
MIN_HEIGHT = 15, MIN_HEIGHT = 15,
MIN_X, MIN_X,
MAX_X, MAX_X,
...@@ -52,8 +74,7 @@ var runGame, updateGame, eventGame, game_manager_instance; ...@@ -52,8 +74,7 @@ var runGame, updateGame, eventGame, game_manager_instance;
lat, lon, x, y, position, min_lon = 99999, min_lat = 99999, lat, lon, x, y, position, min_lon = 99999, min_lat = 99999,
max_lon = 0, max_lat = 0, previous, start_position, dist = 0, max_lon = 0, max_lat = 0, previous, start_position, dist = 0,
path_point, average_speed = 0, flight_time, log_interval_time, path_point, average_speed = 0, flight_time, log_interval_time,
previous_log_time, height, timestamp, destination_lon, previous_log_time, height, timestamp, log_header_found, time_offset = 1,
destination_lat, log_header_found, time_offset = 1,
flight_dist = 0, start_AMSL = 0; flight_dist = 0, start_AMSL = 0;
for (i = 0; i < line_list.length; i += 1) { for (i = 0; i < line_list.length; i += 1) {
if (!log_header_found && !line_list[i].includes("timestamp;")) { if (!log_header_found && !line_list[i].includes("timestamp;")) {
...@@ -118,8 +139,6 @@ var runGame, updateGame, eventGame, game_manager_instance; ...@@ -118,8 +139,6 @@ var runGame, updateGame, eventGame, game_manager_instance;
lat = parseFloat(splitted_log_entry[1]); lat = parseFloat(splitted_log_entry[1]);
lon = parseFloat(splitted_log_entry[2]); lon = parseFloat(splitted_log_entry[2]);
if (i === log_entry_list.length - 1) { if (i === log_entry_list.length - 1) {
destination_lon = lon;
destination_lat = lat;
end_time = timestamp; end_time = timestamp;
} }
height = parseFloat(splitted_log_entry[4]); height = parseFloat(splitted_log_entry[4]);
...@@ -153,11 +172,6 @@ var runGame, updateGame, eventGame, game_manager_instance; ...@@ -153,11 +172,6 @@ var runGame, updateGame, eventGame, game_manager_instance;
"y": 3.5, "y": 3.5,
"z": 3.5 "z": 3.5
}, },
"rotation": {
"x": 0,
"y": 0,
"z": 0
},
"color": { "color": {
"r": 0, "r": 0,
"g": 255, "g": 255,
...@@ -177,6 +191,7 @@ var runGame, updateGame, eventGame, game_manager_instance; ...@@ -177,6 +191,7 @@ var runGame, updateGame, eventGame, game_manager_instance;
average_speed = average_speed / log_entry_list.length; average_speed = average_speed / log_entry_list.length;
log_interval_time = log_interval_time / log_entry_list.length / time_offset; log_interval_time = log_interval_time / log_entry_list.length / time_offset;
flight_time = (end_time - start_time) / 1000 / time_offset; flight_time = (end_time - start_time) / 1000 / time_offset;
//TODO refactor this
game_parameters_json.compareFlights = { game_parameters_json.compareFlights = {
log: true, log: true,
draw: true, draw: true,
...@@ -196,25 +211,25 @@ var runGame, updateGame, eventGame, game_manager_instance; ...@@ -196,25 +211,25 @@ var runGame, updateGame, eventGame, game_manager_instance;
converted_log_point_list: converted_log_point_list converted_log_point_list: converted_log_point_list
}; };
game_parameters_json.drone.maxSpeed = (flight_dist / flight_time) * SPEED_FACTOR; game_parameters_json.drone.maxSpeed = (flight_dist / flight_time) * SPEED_FACTOR;
game_parameters_json.obstacles = path_point_list; game_parameters_json.flight_path_point_list = path_point_list;
game_parameters_json.randomSpawn.leftTeam.position.x = start_position[0]; game_parameters_json.initialPosition.x = start_position[0];
game_parameters_json.randomSpawn.leftTeam.position.y = start_position[1]; game_parameters_json.initialPosition.y = start_position[1];
game_parameters_json.randomSpawn.leftTeam.position.z = start_position[2]; game_parameters_json.initialPosition.z = start_position[2];
game_parameters_json.gameTime = flight_time; game_parameters_json.gameTime = flight_time;
//give map some margin from the flight //give map some margin from flight limits
game_parameters_json.mapSize.width = MAP_SIZE * 1.10; MAP_SIZE *= 1.10;
game_parameters_json.mapSize.depth = MAP_SIZE * 1.10; game_parameters_json.mapSize = {
//flight destination "depth": MAP_SIZE,
var destination_x = longitudToX(destination_lon), "height": 100,
destination_y = latitudeToY(destination_lat), "width": MAP_SIZE
destination = normalizeToMap(destination_x, destination_y); }
game_parameters_json.randomSpawn.rightTeam.position.x = destination[0]; /*game_parameters_json.mapSize.width = MAP_SIZE * 1.10;
game_parameters_json.randomSpawn.rightTeam.position.y = destination[1]; game_parameters_json.mapSize.depth = MAP_SIZE * 1.10;*/
return game_parameters_json; return game_parameters_json;
} }
console.log('runGame', canvas);
game_parameters_json = processLog(game_parameters_json, log); game_parameters_json = processLog(game_parameters_json, log);
if (!game_manager_instance) { if (!game_manager_instance) {
game_manager_instance = new GameManager(canvas, script, game_manager_instance = new GameManager(canvas, script,
game_parameters_json, 5); game_parameters_json, 5);
...@@ -223,11 +238,9 @@ var runGame, updateGame, eventGame, game_manager_instance; ...@@ -223,11 +238,9 @@ var runGame, updateGame, eventGame, game_manager_instance;
}; };
updateGame = function () { updateGame = function () {
if (game_manager_instance) {
return game_manager_instance.update(); return game_manager_instance.update();
}; }
eventGame = function (event) {
return game_manager_instance.event(event);
}; };
/*// Resize canvas on window resize /*// Resize canvas on window resize
...@@ -237,3 +250,1301 @@ var runGame, updateGame, eventGame, game_manager_instance; ...@@ -237,3 +250,1301 @@ var runGame, updateGame, eventGame, game_manager_instance;
}(this)); }(this));
/******************************************************************************/
/******************************** GAME MANAGER ********************************/
var GAMEPARAMETERS = {};
function randomSpherePoint(x0, y0, z0, rx0, ry0, rz0) {
var u = Math.random(), v = Math.random(),
rx = Math.random() * rx0, ry = Math.random() * ry0,
rz = Math.random() * rz0, theta = 2 * Math.PI * u,
phi = Math.acos(2 * v - 1),
x = x0 + (rx * Math.sin(phi) * Math.cos(theta)),
y = y0 + (ry * Math.sin(phi) * Math.sin(theta)),
z = z0 + (rz * Math.cos(phi));
return new BABYLON.Vector3(x, y, z);
}
var GameManager = /** @class */ (function () {
// *** CONSTRUCTOR ***
function GameManager(canvas, script, game_parameters_json, simulation_speed) {
var _this = this;
this._canvas = canvas;
this._scene = null;
this._engine = null;
this._droneList = [];
this._canUpdate = false;
if (!simulation_speed) { simulation_speed = 5; }
this._max_step_animation_frame = simulation_speed;
Object.assign(GAMEPARAMETERS, game_parameters_json);
this._game_parameters_json = game_parameters_json;
this._map_swapped = false;
this._script = script;
this._last_position_drawn = [];
this._log_count = [];
this._flight_log = [];
//TODO drop the use of RS map and use a JSON instead. drop randomspawn and similar names //rename all
//TODO do this in above, in game logic game_parameters_json
//move this to JSON dict
if (GAMEPARAMETERS.compareFlights) {
for (var count = 0; count < GAMEPARAMETERS.droneList.length; count++) {
this._flight_log[count] = [];
this._log_count[count] = 0;
this._last_position_drawn[count] = null;
}
this._colors = [
new BABYLON.Color3(255, 165, 0),
new BABYLON.Color3(0, 0, 255),
new BABYLON.Color3(255, 0, 0),
new BABYLON.Color3(0, 255, 0)
];
}
this.APIs_dict = {
DroneAaileFixeAPI: DroneAaileFixeAPI,
DroneLogAPI: DroneLogAPI
};
}
Object.defineProperty(GameManager.prototype, "gameParameter", {
get: function () {
return this._gameParameter;
},
enumerable: true,
configurable: true
});
GameManager.prototype.run = function () {
var gadget = this;
return gadget._init()
.push(function () {
//TODO return result
gadget._final_score = "fake-result 000";
return gadget._final_score;
});
};
GameManager.prototype.update = function () {
var _this = this;
// To increase the game speed, increase this value
_this._max_step_animation_frame = 10;
// time delta means that drone are updated every virtual second
// This is fixed and must not be modified
// otherwise, it will lead to different scenario results
// (as drone calculations may be triggered less often)
var TIME_DELTA = 1000 / 60, i;
// init the value on the first step
_this.waiting_update_count = _this._max_step_animation_frame;
function triggerUpdateIfPossible() {
if ((_this._canUpdate) && (_this.ongoing_update_promise === null) && (0 < _this.waiting_update_count)) {
_this.ongoing_update_promise = _this._update(TIME_DELTA, (_this.waiting_update_count === 1))
.push(function () {
_this.waiting_update_count -= 1;
_this.ongoing_update_promise = null;
triggerUpdateIfPossible();
})
.push(undefined, function(error) {
console.log("ERROR on update:", error);
console.log("rejecting finish_deferred promise...");
_this.finish_deferred.reject.bind(_this.finish_deferred);
});
}
}
triggerUpdateIfPossible();
};
GameManager.prototype.delay = function (callback, millisecond) {
this._delayed_defer_list.push([callback, millisecond]);
};
GameManager.prototype._updateDisplayedInfo = function (delta_time, update_dom) {
this._game_duration += delta_time;
var seconds = Math.floor(this._game_duration / 1000);
if (GAMEPARAMETERS.compareFlights) {
for (var count = 0; count < GAMEPARAMETERS.droneList.length; count++) {
if (this._droneList[count]._controlMesh) {
var drone_position_x = this._droneList[count]._controlMesh.position.x,
drone_position_z = this._droneList[count]._controlMesh.position.y,
drone_position_y = this._droneList[count]._controlMesh.position.z;
if (GAMEPARAMETERS.compareFlights.log) {
if (this._log_count[count] === 0 || this._game_duration / this._log_count[count] > 1) {
this._log_count[count] += GAMEPARAMETERS.compareFlights.log_interval_time;
//convert x-y coordinates into latitud-longitude
var lon = drone_position_x + GAMEPARAMETERS.compareFlights.map_width / 2;
lon = lon / 1000;
lon = lon * (GAMEPARAMETERS.compareFlights.MAX_X - GAMEPARAMETERS.compareFlights.MIN_X) + GAMEPARAMETERS.compareFlights.MIN_X;
lon = lon / (GAMEPARAMETERS.compareFlights.map_width / 360.0) - 180;
var lat = drone_position_y + GAMEPARAMETERS.compareFlights.map_height / 2;
lat = lat / 1000;
lat = lat * (GAMEPARAMETERS.compareFlights.MAX_Y - GAMEPARAMETERS.compareFlights.MIN_Y) + GAMEPARAMETERS.compareFlights.MIN_Y;
lat = 90 - lat / (GAMEPARAMETERS.compareFlights.map_height / 180.0);
this._flight_log[count].push([lat, lon, drone_position_z]);
}
}
if (GAMEPARAMETERS.compareFlights.draw) { //TODO review this in JSON dict
//draw drone position every second
if (this._last_position_drawn[count] !== seconds) {
this._last_position_drawn[count] = seconds;
var position_obj = BABYLON.MeshBuilder.CreateSphere("obs_" + seconds, {
'diameterX': 3.5,
'diameterY': 3.5,
'diameterZ': 3.5
}, this._scene);
position_obj.position = new BABYLON.Vector3(drone_position_x, drone_position_z, drone_position_y);
position_obj.scaling = new BABYLON.Vector3(3.5, 3.5, 3.5);
var material = new BABYLON.StandardMaterial(this._scene);
material.alpha = 1;
var color = new BABYLON.Color3(255, 0, 0);
if (this._colors[count]) {
color = this._colors[count];
}
material.diffuseColor = color;
position_obj.material = material;
}
}
}
}
}
};
GameManager.prototype._update = function (delta_time, update_dom) {
var _this = this,
queue = new RSVP.Queue(),
i;
this._updateDisplayedInfo(delta_time, update_dom);
// trigger all deferred calls if it is time
for (i = _this._delayed_defer_list.length - 1; 0 <= i; i -= 1) {
_this._delayed_defer_list[i][1] = _this._delayed_defer_list[i][1] - delta_time;
if (_this._delayed_defer_list[i][1] <= 0) {
queue.push(_this._delayed_defer_list[i][0]);
_this._delayed_defer_list.splice(i, 1);
}
}
function updateDrone(drone) {
drone._tick += 1;
return drone.internal_update(delta_time);
}
this._droneList.forEach(function (drone) {
queue.push(function () {
return updateDrone(drone);
});
});
return queue
.push(function () {
if (_this._timeOut()) {
console.log("TIMEOUT!");
return _this._finish();
}
});
};
GameManager.prototype._timeOut = function () {
var seconds = Math.floor(this._game_duration / 1000);
return this._totalTime - seconds <= 0;
};
GameManager.prototype._finish = function () {
console.log("Simulation finished");
this._canUpdate = false;
return this.finish_deferred.resolve();
};
GameManager.prototype._dispose = function () {
if (this._scene) {
this._scene.dispose();
}
};
GameManager.prototype._init = function () {
var _this = this;
this._delayed_defer_list = [];
this._dispose();
var canvas = this._canvas;
// Create the Babylon engine
this._engine = new BABYLON.Engine(canvas, true, {
//options for event handling
stencil: true,
disableWebGL2Support: false,
audioEngine: false
});
this._scene = new BABYLON.Scene(this._engine);
this._scene.clearColor = new BABYLON.Color4(88/255,171/255,217/255,255/255);
//removed for event handling
//this._engine.enableOfflineSupport = false;
//this._scene.collisionsEnabled = true;
// Lights
var hemi_north = new BABYLON.HemisphericLight(
"hemiN", new BABYLON.Vector3(1, -1, 1), this._scene);
hemi_north.intensity = 0.75;
var hemi_south = new BABYLON.HemisphericLight(
"hemiS", new BABYLON.Vector3(-1, 1, -1), this._scene);
hemi_south.intensity = 0.75;
var camera = new BABYLON.ArcRotateCamera("camera", 0, 1.25, 800,
BABYLON.Vector3.Zero(), this._scene);
camera.wheelPrecision = 10;
//changed for event handling
//camera.attachControl(this._scene.getEngine().getRenderingCanvas()); //original
camera.attachControl(canvas, true);
camera.maxz = 40000;
this._camera = camera;
// Render loop
this._engine.runRenderLoop(function () {
_this._scene.render();
});
// -------------------------------- SIMULATION - Prepare API, Map and Teams
var on3DmodelsReady = function (ctx) {
console.log("on3DmodelsReady!");
// Get the game parameters
if (!ctx._map_swapped) {
GAMEPARAMETERS = ctx._getGameParameter();
ctx._map_swapped = true;
}
console.log("APIs created");
// Init the map
_this._mapManager = new MapManager(ctx._scene);
console.log("Map manager instantiated");
ctx._spawnDrones(GAMEPARAMETERS.initialPosition,
GAMEPARAMETERS.droneList, ctx._script);
// Hide the drone prefab
DroneManager.Prefab.isVisible = false;
//Hack to make advanced texture work
const documentTmp = document;
document = undefined;
var advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("UI", true, ctx._scene);
document = documentTmp;
for (var count = 0; count < GAMEPARAMETERS.droneList.length; count++) { //TODO use one color per drone
var controlMeshBlue = ctx._droneList[count].infosMesh;
var rectBlue = new BABYLON.GUI.Rectangle();
rectBlue.width = "10px";
rectBlue.height = "10px";
rectBlue.cornerRadius = 20;
rectBlue.color = "white";
rectBlue.thickness = 0.5;
rectBlue.background = "blue";
advancedTexture.addControl(rectBlue);
var labelBlue = new BABYLON.GUI.TextBlock();
labelBlue.text = count.toString();
labelBlue.fontSize = 7;
rectBlue.addControl(labelBlue);
rectBlue.linkWithMesh(controlMeshBlue);
rectBlue.linkOffsetY = 0;
}
console.log("advaced textures added");
return ctx;
};
// ----------------------------------- SIMULATION - Load 3D models
return new RSVP.Queue()
.push(function () {
return new RSVP.Promise(function (resolve) {
return _this._load3DModel(resolve);
});
})
.push(function () {
on3DmodelsReady(_this);
// 3,2,1,GO before start. To animate. //TODO DROP this countdown
var result = new RSVP.Queue(),
i;
function countdown (count) {
return function () {
console.log(count + " ...");
return RSVP.delay(200);
};
}
for (i = 5; 0 <= i; i -= 1) {
result.push(countdown(i));
}
return result.push(_this._start.bind(_this));
});
};
GameManager.prototype._start = function () {
var _this = this;
_this.waiting_update_count = 0;
_this.ongoing_update_promise = null;
_this.finish_deferred = RSVP.defer();
console.log("Simulation started.");
this._game_duration = 0;
this._totalTime = GAMEPARAMETERS.gameTime;
return new RSVP.Queue()
.push(function () {
promise_list = [];
_this._droneList.forEach(function (drone) {
drone._tick = 0;
promise_list.push(drone.internal_start());
});
return RSVP.all(promise_list);
})
.push(function () {
_this._canUpdate = true;
return _this.finish_deferred.promise;
});
};
GameManager.prototype._load3DModel = function (callback) {
var _this = this, droneTask, mapTask, obstacleTask,
assetManager = new BABYLON.AssetsManager(this._scene);
assetManager.useDefaultLoadingScreen = true;
// DRONE
droneTask = assetManager.addMeshTask("loadingDrone", "", "assets/drone/", "drone.babylon"); //TODO got from RS skin!
droneTask.onSuccess = function (task) {
task.loadedMeshes.forEach(function (mesh) {
mesh.isPickable = false;
mesh.isVisible = false;
});
DroneManager.Prefab = _this._scene.getMeshByName("Dummy_Drone");
DroneManager.Prefab.scaling = new BABYLON.Vector3(0.006, 0.006, 0.006);
DroneManager.Prefab.position = new BABYLON.Vector3(0, -5, 0);
};
droneTask.onError = function () {
console.log("Error loading 3D model for Drone");
};
// MAP
mapTask = assetManager.addMeshTask("loadingMap", "", "assets/map/", "map.babylon");
mapTask.onSuccess = function (task) {
task.loadedMeshes.forEach(function (mesh) {
mesh.isPickable = false;
mesh.isVisible = false;
});
};
mapTask.onError = function () {
console.log("Error loading 3D model for Map");
};
assetManager.onFinish = function () {
return callback();
};
assetManager.load();
};
GameManager.prototype._getGameParameter = function () {
var parameter = {}, i,
swap = function (pos) {
return {
x: pos.x,
y: pos.z,
z: pos.y
};
};
Object.assign(parameter, this._game_parameters_json);
this._gameParameter = {};
Object.assign(this._gameParameter, this._game_parameters_json);
for (i = 0; i < parameter.flight_path_point_list.length; i += 1) {
parameter.flight_path_point_list[i].position =
swap(parameter.flight_path_point_list[i].position);
if (parameter.flight_path_point_list[i].scale) {
parameter.flight_path_point_list[i].scale =
swap(parameter.flight_path_point_list[i].scale);
}
}
return parameter;
};
GameManager.prototype._spawnDrones = function (center, drone_list, code) {
var position, i, position_list = [], max_collision = 10 * drone_list.length,
collision_nb = 0;
function checkCollision(position, list) {
var i;
for (i = 0; i < list.length; i += 1) {
if (position.equalsWithEpsilon(list[i], 0.5)) {
return true;
}
}
return false;
}
function spawnDrone(x, y, z, index, api, code, ctx) {
var default_drone_AI = api.getDroneAI();
if (default_drone_AI) {
code = default_drone_AI;
}
var base, code_eval = "let drone = new DroneManager(ctx._scene, " +
index + ', api);' +
"let droneMe = function(NativeDate, me, Math, window, DroneManager, GameManager, DroneLogAPI, DroneAaileFixeAPI, BABYLON, GAMEPARAMETERS) {" +
"var start_time = (new Date(2070, 0, 0, 0, 0, 0, 0)).getTime();" +
"Date.now = function () {return start_time + drone._tick * 1000/60;}; " +
"function Date() {if (!(this instanceof Date)) {throw new Error('Missing new operator');} " +
"if (arguments.length === 0) {return new NativeDate(Date.now());} else {return new NativeDate(...arguments);}}";
// Simple desactivation of direct access of all globals
// It is still accessible in reality, but it will me more visible
// if people really access them
if (x !== null && y !== null && z !== null) {
code_eval += "me.setStartingPosition(" + x + ", " + y + ", " + z + ");";
}
base = code_eval;
code_eval += code + "}; droneMe(Date, drone, Math, {});";
base += "};ctx._droneList.push(drone)";
code_eval += "ctx._droneList.push(drone)";
try {
eval(code_eval);
}
catch (error) {
eval(base);
}
}
for (i = 0; i < drone_list.length; i += 1) {
position = randomSpherePoint(center.x + i, center.y + i, center.z + i, 0, 0, 0);
if (checkCollision(position, position_list) || position.z < 0.05) {
collision_nb += 1;
if (collision_nb < max_collision) {
i -= 1;
}
}
else {
position_list.push(position);
var api = new this.APIs_dict[drone_list[i]](this, GAMEPARAMETERS.compareFlights);
spawnDrone(position.x, position.y, position.z, i, api, code, this);
}
}
};
return GameManager;
}());
/*****************************************************************************/
/******************************* DRONE LOG API ********************************/
var DroneLogAPI = /** @class */ (function () {
//** CONSTRUCTOR
function DroneLogAPI(gameManager, flight_parameters) {
this._gameManager = gameManager;
this._flight_parameters = flight_parameters;
}
//TODO test sendMsg (what is iterable _this.team??) (latency.communication?)(GM.delay?)
DroneLogAPI.prototype.internal_sendMsg = function (msg, to) {
var _this = this;
_this._gameManager.delay(function () {
if (to < 0) {
// Send to all drones
_this.team.forEach(function (drone) {
if (drone.infosMesh) {
try {
drone.onGetMsg(msg);
}
catch (error) {
console.warn('Drone crashed on sendMsg due to error:', error);
drone._internal_crash();
}
}
});
}
else {
// Send to specific drone
if (drone.infosMesh) {
try {
_this.team[to].onGetMsg(msg);
}
catch (error) {
console.warn('Drone crashed on sendMsg due to error:', error);
_this.team[to]._internal_crash();
}
}
}
}, GAMEPARAMETERS.latency.communication);
};
DroneLogAPI.prototype.log = function (msg) {
console.log("API say : " + msg);
};
DroneLogAPI.prototype.getGameParameter = function (name) {
if (["gameTime", "mapSize"].includes(name))
return this._gameManager.gameParameter[name];
};
DroneLogAPI.prototype.processCoordinates = function (x, y, z) {
if(isNaN(x) || isNaN(y) || isNaN(z)){
throw new Error('Target coordinates must be numbers');
}
return {
x: x,
y: y,
z: z
};
};
//Internal AI: drone follows the flight log points
DroneLogAPI.prototype.getDroneAI = function () {
return 'function distance(p1, p2) {' +
'var a = p1[0] - p2[0],' +
'b = p1[1] - p2[1];' +
'return Math.sqrt(a * a + b * b);' +
'}' +
'me.onStart = function() {' +
'console.log("DRONE LOG START!");' +
'if (!me.getFlightParameters())' +
'throw "DroneLog API must implement getFlightParameters";' +
'me.flightParameters = me.getFlightParameters();' +
'me.checkpoint_list = me.flightParameters.converted_log_point_list;' +
'me.startTime = new Date();' +
'me.initTimestamp = me.flightParameters.converted_log_point_list[0][3];' +
'me.setTargetCoordinates(me.checkpoint_list[0][0], me.checkpoint_list[0][1], me.checkpoint_list[0][2]);' +
'me.last_checkpoint_reached = -1;' +
'me.setAcceleration(10);' +
'};' +
'me.onUpdate = function () {' +
'var next_checkpoint = me.checkpoint_list[me.last_checkpoint_reached+1];' +
'if (distance([me.position.x, me.position.y], next_checkpoint) < 12) {' +
'var log_elapsed = next_checkpoint[3] - me.initTimestamp,' +
'time_elapsed = new Date() - me.startTime;' +
'if (time_elapsed < log_elapsed) {' +
'me.setDirection(0, 0, 0);' +
'return;' +
'}' +
'if (me.last_checkpoint_reached + 1 === me.checkpoint_list.length - 1) {' +
'me.setTargetCoordinates(me.position.x, me.position.y, me.position.z);' +
'return;' +
'}' +
'me.last_checkpoint_reached += 1;' +
'next_checkpoint = me.checkpoint_list[me.last_checkpoint_reached+1];' +
'me.setTargetCoordinates(next_checkpoint[0], next_checkpoint[1], next_checkpoint[2]);' +
'} else {' +
'me.setTargetCoordinates(next_checkpoint[0], next_checkpoint[1], next_checkpoint[2]);' +
'}' +
'};';
};
DroneLogAPI.prototype.setAltitude = function (altitude) {
return altitude;
};
DroneLogAPI.prototype.getMaxSpeed = function () {
return 3000;
};
DroneLogAPI.prototype.getInitialAltitude = function () {
return 0;
};
DroneLogAPI.prototype.getAltitudeAbs = function () {
return 0;
};
DroneLogAPI.prototype.getMinHeight = function () {
return 0;
};
DroneLogAPI.prototype.getMaxHeight = function () {
return 220;
};
DroneLogAPI.prototype.getFlightParameters = function () {
return this._flight_parameters;
};
return DroneLogAPI;
}());
/*****************************************************************************/
/************************** DRONE A AILE FIXE API ****************************/
TAKEOFF_RADIUS = 60;
LOITER_LIMIT = 30;
LOITER_RADIUS_FACTOR = 0.60;
LOITER_SPEED_FACTOR = 1.5;
var DroneAaileFixeAPI = /** @class */ (function () {
//** CONSTRUCTOR
function DroneAaileFixeAPI(gameManager, flight_parameters) {
this._gameManager = gameManager;
this._flight_parameters = flight_parameters;
this._loiter_radius = 0;
this._last_loiter_point_reached = -1;
this._last_altitude_point_reached = -1;
}
DroneAaileFixeAPI.prototype.internal_sendMsg = function (msg, to) {
var _this = this;
_this._gameManager.delay(function () {
if (to < 0) {
// Send to all drones
_this.team.forEach(function (drone) {
if (drone.infosMesh) {
try {
drone.onGetMsg(msg);
}
catch (error) {
console.warn('Drone crashed on sendMsg due to error:', error);
drone._internal_crash();
}
}
});
}
else {
// Send to specific drone
if (drone.infosMesh) {
try {
_this.team[to].onGetMsg(msg);
}
catch (error) {
console.warn('Drone crashed on sendMsg due to error:', error);
_this.team[to]._internal_crash();
}
}
}
}, GAMEPARAMETERS.latency.communication);
};
DroneAaileFixeAPI.prototype.log = function (msg) {
console.log("API say : " + msg);
};
DroneAaileFixeAPI.prototype.getGameParameter = function (name) {
if (["gameTime", "mapSize"].includes(name))
return this._gameManager.gameParameter[name];
};
DroneAaileFixeAPI.prototype.processCoordinates = function (lat, lon, z, r) {
if(isNaN(lat) || isNaN(lon) || isNaN(z)){
throw new Error('Target coordinates must be numbers');
}
var flightParameters = this.getFlightParameters();
function longitudToX(lon, flightParameters) {
return (flightParameters.MAP_SIZE / 360.0) * (180 + lon);
}
function latitudeToY(lat, flightParameters) {
return (flightParameters.MAP_SIZE / 180.0) * (90 - lat);
}
function normalizeToMap(x, y, flightParameters) {
var n_x = (x - flightParameters.MIN_X) / (flightParameters.MAX_X - flightParameters.MIN_X),
n_y = (y - flightParameters.MIN_Y) / (flightParameters.MAX_Y - flightParameters.MIN_Y);
return [n_x * 1000 - flightParameters.MAP_SIZE / 2, n_y * 1000 - flightParameters.MAP_SIZE / 2];
}
var x = longitudToX(lon, flightParameters),
y = latitudeToY(lat, flightParameters),
position = normalizeToMap(x, y, flightParameters);
if (z > flightParameters.start_AMSL) {
z -= flightParameters.start_AMSL;
}
var processed_coordinates = {
x: position[0],
y: position[1],
z: z
};
if (r && r > LOITER_LIMIT) {
this._loiter_radius = r * LOITER_RADIUS_FACTOR;
this._loiter_center = processed_coordinates;
this._loiter_coordinates = [];
this._last_loiter_point_reached = -1;
var x1, y1;
//for (var angle = 0; angle <360; angle+=8){ //counter-clockwise
for (var angle = 360; angle > 0; angle-=8){ //clockwise
x1 = this._loiter_radius * Math.cos(angle * (Math.PI / 180)) + this._loiter_center.x;
y1 = this._loiter_radius * Math.sin(angle * (Math.PI / 180)) + this._loiter_center.y;
this._loiter_coordinates.push(this.processCurrentPosition(x1, y1, z));
}
}
this._last_altitude_point_reached = -1;
this.takeoff_path = [];
return processed_coordinates;
};
DroneAaileFixeAPI.prototype.processCurrentPosition = function (x, y, z) {
//convert x-y coordinates into latitud-longitude
var flightParameters = this.getFlightParameters();
var lon = x + flightParameters.map_width / 2;
lon = lon / 1000;
lon = lon * (flightParameters.MAX_X - flightParameters.MIN_X) + flightParameters.MIN_X;
lon = lon / (flightParameters.map_width / 360.0) - 180;
var lat = y + flightParameters.map_height / 2;
lat = lat / 1000;
lat = lat * (flightParameters.MAX_Y - flightParameters.MIN_Y) + flightParameters.MIN_Y;
lat = 90 - lat / (flightParameters.map_height / 180.0);
return {
x: lat,
y: lon,
z: z
};
};
DroneAaileFixeAPI.prototype.loiter = function (drone) {
function distance(c1, c2) {
var R = 6371e3,
q1 = c1[0] * Math.PI / 180,
q2 = c2[0] * Math.PI / 180,
dq = (c2[0] - c1[0]) * Math.PI / 180,
dl = (c2[1] - c1[1]) * Math.PI / 180,
a = Math.sin(dq / 2) * Math.sin(dq / 2) +
Math.cos(q1) * Math.cos(q2) *
Math.sin(dl / 2) * Math.sin(dl / 2),
c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
return R * c;
}
if (this._loiter_radius > LOITER_LIMIT) {
var drone_pos = drone.getCurrentPosition();
//shift loiter circle to nearest point
if (this._last_loiter_point_reached === -1) {
if (!this.shifted) {
drone._maxSpeed = drone._maxSpeed * LOITER_SPEED_FACTOR;
var min = 9999, min_i;
for (var i = 0; i < this._loiter_coordinates.length; i++){
var d = distance([drone_pos.x, drone_pos.y], [this._loiter_coordinates[i].x, this._loiter_coordinates[i].y]);
if (d < min) {
min = d;
min_i = i;
}
}
this._loiter_coordinates = this._loiter_coordinates.concat(this._loiter_coordinates.splice(0,min_i));
this.shifted = true;
}
} else {
this.shifted = false;
}
//stop
if (this._last_loiter_point_reached === this._loiter_coordinates.length - 1) {
if (drone._maxSpeed !== this.getMaxSpeed()) {
drone._maxSpeed = this.getMaxSpeed();
}
drone.setDirection(0, 0, 0);
return;
}
//loiter
var next_point = this._loiter_coordinates[this._last_loiter_point_reached + 1];
drone.setTargetCoordinates(next_point.x, next_point.y, next_point.z, -1);
if (distance([drone_pos.x, drone_pos.y], [next_point.x, next_point.y]) < 1) {
this._last_loiter_point_reached += 1;
if (this._last_loiter_point_reached === this._loiter_coordinates.length - 1) {
return;
}
next_point = this._loiter_coordinates[this._last_loiter_point_reached + 1];
drone.setTargetCoordinates(next_point.x, next_point.y, next_point.z, -1);
}
}
};
DroneAaileFixeAPI.prototype.getDroneAI = function () {
return null;
};
DroneAaileFixeAPI.prototype.setAltitude = function (altitude, drone, skip_loiter) {
this.takeoff_path = [];
if (skip_loiter) {
var drone_pos = drone.getCurrentPosition();
drone.setTargetCoordinates(drone_pos.x, drone_pos.y, altitude);
return;
}
var x1, y1,
LOOPS = 1,
CIRCLE_ANGLE = 8,
current_point = 0,
total_points = 360/CIRCLE_ANGLE*LOOPS,
initial_altitude = drone.getAltitudeAbs(),
center = {
x: drone._controlMesh.position.x,
y: drone._controlMesh.position.z,
z: drone._controlMesh.position.y
};
for (var l = 0; l <= LOOPS; l+=1){
for (var angle = 360; angle > 0; angle-=CIRCLE_ANGLE){ //clockwise sense
current_point++;
x1 = TAKEOFF_RADIUS * Math.cos(angle * (Math.PI / 180)) + center.x;
y1 = TAKEOFF_RADIUS * Math.sin(angle * (Math.PI / 180)) + center.y;
if (current_point < total_points/3) {
var FACTOR = 0.5;
x1 = center.x*FACTOR + x1*(1-FACTOR);
y1 = center.y*FACTOR + y1*(1-FACTOR);
}
this.takeoff_path.push({x: x1, y: y1, z: initial_altitude + current_point * (altitude-initial_altitude)/total_points});
}
}
};
DroneAaileFixeAPI.prototype.reachAltitude = function (drone) {
function distance(p1, p2) {
return Math.sqrt(Math.pow(p1[0] - p2[0], 2) +
Math.pow(p1[1] - p2[1], 2));
}
//stop
if (this._last_altitude_point_reached === this.takeoff_path.length - 1) {
this._last_altitude_point_reached = -1;
this.takeoff_path = [];
drone._start_altitude = 0;
drone.setDirection(0, 0, 0);
return;
}
//loiter
var drone_pos = {
x: drone._controlMesh.position.x,
y: drone._controlMesh.position.z,
z: drone._controlMesh.position.y
};
var next_point = this.takeoff_path[this._last_altitude_point_reached + 1];
drone.internal_setTargetCoordinates(next_point.x, next_point.y, next_point.z);
if (distance([drone_pos.x, drone_pos.y], [next_point.x, next_point.y]) < 1) {
this._last_altitude_point_reached += 1;
if (this._last_altitude_point_reached === this.takeoff_path.length - 1) {
return;
}
next_point = this.takeoff_path[this._last_altitude_point_reached + 1];
drone.internal_setTargetCoordinates(next_point.x, next_point.y, next_point.z);
}
};
DroneAaileFixeAPI.prototype.getMaxSpeed = function () {
return GAMEPARAMETERS.drone.maxSpeed;
};
DroneAaileFixeAPI.prototype.doParachute = function (drone) {
//TODO what to do here?
drone.setDirection(0, 0, 0);
};
DroneAaileFixeAPI.prototype.landed = function (drone) {
var drone_pos = drone.getCurrentPosition();
return Math.floor(drone_pos.z) === 0;
};
DroneAaileFixeAPI.prototype.exit = function (drone) {
//TODO what to do here?
drone.setDirection(0, 0, 0);
};
DroneAaileFixeAPI.prototype.getInitialAltitude = function () {
return 0;
};
DroneAaileFixeAPI.prototype.getAltitudeAbs = function (altitude) {
return altitude;
};
DroneAaileFixeAPI.prototype.getMinHeight = function () {
return 0;
};
DroneAaileFixeAPI.prototype.getMaxHeight = function () {
return 800;
};
DroneAaileFixeAPI.prototype.getFlightParameters = function () {
return this._flight_parameters;
};
return DroneAaileFixeAPI;
}());
/******************************************************************************/
/******************************* DRONE MANAGER ********************************/
var DroneManager = /** @class */ (function () {
//** CONSTRUCTOR
function DroneManager(scene, id, API) {
var _this = this;
// Mesh
this._mesh = null;
this._controlMesh = null;
this._colliderBackMesh = null; //TODO drop?
this._canPlay = false;
this._canCommunicate = false;
this._maxAcceleration = 0;
this._maxSpeed = 0;
this._speed = 0;
this._acceleration = 0;
this._direction = BABYLON.Vector3.Zero();
this._maxOrientation = Math.PI / 4;
this._scene = scene;
this._canUpdate = true;
this._id = id;
this._leader_id = 0;
this._start_loiter = 0;
this._start_altitude = 0;
this._API = API; // var API created on AI evel
// Create the control mesh
this._controlMesh = BABYLON.Mesh.CreateBox("droneControl_" + id, 0.01, this._scene);
this._controlMesh.isVisible = false;
this._controlMesh.computeWorldMatrix(true);
// Create the mesh from the drone prefab
this._mesh = DroneManager.Prefab.clone("drone_" + id, this._controlMesh);
this._mesh.position = BABYLON.Vector3.Zero();
this._mesh.isVisible = false;
this._mesh.computeWorldMatrix(true);
// Get the back collider
this._mesh.getChildMeshes().forEach(function (mesh) {
if (mesh.name.substring(mesh.name.length - 13) == "Dummy_arriere") {
_this._colliderBackMesh = mesh;
_this._colliderBackMesh.isVisible = false;
}
else {
mesh.isVisible = true;
}
});
if (!DroneManager.PrefabBlueMat) {
DroneManager.PrefabBlueMat = new BABYLON.StandardMaterial("blueTeamMat", scene);
DroneManager.PrefabBlueMat.diffuseTexture = new BABYLON.Texture("assets/drone/drone_bleu.jpg", scene);
}
}
DroneManager.prototype._swapAxe = function (vector) {
return new BABYLON.Vector3(vector.x, vector.z, vector.y);
};
Object.defineProperty(DroneManager.prototype, "leader_id", {
get: function () { return this._leader_id; },
enumerable: true,
configurable: true
});
Object.defineProperty(DroneManager.prototype, "id", {
get: function () { return this._id; },
enumerable: true,
configurable: true
});
Object.defineProperty(DroneManager.prototype, "colliderMesh", {
get: function () { return this._mesh; },
enumerable: true,
configurable: true
});
Object.defineProperty(DroneManager.prototype, "colliderBackMesh", {
get: function () { return this._colliderBackMesh; },
enumerable: true,
configurable: true
});
Object.defineProperty(DroneManager.prototype, "infosMesh", {
get: function () { return this._controlMesh; },
enumerable: true,
configurable: true
});
Object.defineProperty(DroneManager.prototype, "position", {
get: function () {
if (this._controlMesh !== null) {
return this._swapAxe(this._controlMesh.position);
}
return null;
},
enumerable: true,
configurable: true
});
Object.defineProperty(DroneManager.prototype, "speed", {
get: function () { return this._speed; },
enumerable: true,
configurable: true
});
Object.defineProperty(DroneManager.prototype, "direction", {
get: function () { return this._swapAxe(this._direction); },
enumerable: true,
configurable: true
});
Object.defineProperty(DroneManager.prototype, "worldDirection", {
get: function () {
return new BABYLON.Vector3(this._direction.x, this._direction.y, this._direction.z);
},
enumerable: true,
configurable: true
});
DroneManager.prototype.internal_start = function () {
this._maxAcceleration = GAMEPARAMETERS.drone.maxAcceleration;
this._maxSpeed = this._API.getMaxSpeed();
this._canPlay = true;
this._canCommunicate = true;
try {
return this.onStart();
} catch (error) {
console.warn('Drone crashed on start due to error:', error);
this._internal_crash();
}
};
DroneManager.prototype.internal_setTargetCoordinates = function (x, y, z) {
if (!this._canPlay)
return;
x -= this._controlMesh.position.x;
y -= this._controlMesh.position.z;
z -= this._controlMesh.position.y;
this.setDirection(x, y, z);
this.setAcceleration(this._maxAcceleration);
return;
};
DroneManager.prototype.internal_update = function (delta_time) {
var context = this;
if (this._controlMesh) {
context._speed += context._acceleration * delta_time / 1000;
if (context._speed > context._maxSpeed)
context._speed = context._maxSpeed;
if (context._speed < -context._maxSpeed)
context._speed = -context._maxSpeed;
var updateSpeed = context._speed * delta_time / 1000;
if (context._direction.x != 0
|| context._direction.y != 0
|| context._direction.z != 0) {
context._controlMesh.position.addInPlace(new BABYLON.Vector3(context._direction.x * updateSpeed, context._direction.y * updateSpeed, context._direction.z * updateSpeed));
}
var orientationValue = context._maxOrientation * (context._speed / context._maxSpeed);
context._controlMesh.computeWorldMatrix(true);
context._mesh.computeWorldMatrix(true);
if (context._canUpdate) {
context._canUpdate = false;
return new RSVP.Queue()
.push(function () {
return context.onUpdate(context._API._gameManager._game_duration);
})
.push(function () {
context._canUpdate = true;
}, function (err) {
console.warn('Drone crashed on update due to error:', err);
context._internal_crash();
})
.push(function () {
if (context._start_loiter > 0) {
context._API.loiter(context);
}
if (context._start_altitude > 0) {
context._API.reachAltitude(context);
}
});
}
return;
}
return;
};
DroneManager.prototype._internal_crash = function () {
this._canCommunicate = false;
this._controlMesh = null;
this._mesh = null;
this._canPlay = false;
this.onTouched();
};
DroneManager.prototype.setStartingPosition = function (x, y, z) {
if(isNaN(x) || isNaN(y) || isNaN(z)){
throw new Error('Position coordinates must be numbers');
}
if (!this._canPlay) {
if (z <= 0.05)
z = 0.05;
this._controlMesh.position = new BABYLON.Vector3(x, z, y);
}
this._controlMesh.computeWorldMatrix(true);
this._mesh.computeWorldMatrix(true);
};
DroneManager.prototype.setAcceleration = function (factor) {
if (!this._canPlay)
return;
if (isNaN(factor)){
throw new Error('Acceleration must be a number');
}
if (factor > this._maxAcceleration)
factor = this._maxAcceleration;
this._acceleration = factor;
};
DroneManager.prototype.setDirection = function (x, y, z) {
if (!this._canPlay)
return;
if(isNaN(x) || isNaN(y) || isNaN(z)){
throw new Error('Direction coordinates must be numbers');
}
this._direction = new BABYLON.Vector3(x, z, y).normalize();
};
/**
* Set a target point to move
*/
DroneManager.prototype.setTargetCoordinates = function (x, y, z, r) {
if (!this._canPlay)
return;
//HACK too specific for DroneAaileFixe, should be a flag: (bool)process?
if (r !== -1) {
this._start_loiter = 0;
this._maxSpeed = this._API.getMaxSpeed();
}
this._start_altitude = 0;
var coordinates = this._API.processCoordinates(x, y, z, r);
coordinates.x -= this._controlMesh.position.x;
coordinates.y -= this._controlMesh.position.z;
coordinates.z -= this._controlMesh.position.y;
this.setDirection(coordinates.x, coordinates.y, coordinates.z);
this.setAcceleration(this._maxAcceleration);
return;
};
/**
* Send a message to team drones
* @param msg The message to send
* @param id The targeted drone. -1 or nothing to broadcast
*/
DroneManager.prototype.sendMsg = function (msg, id) {
//TODO
return;
var _this = this;
if (!this._canCommunicate)
return;
if (id >= 0) { }
else
id = -1;
if (_this.infosMesh) {
return _this._API.internal_sendMsg(JSON.parse(JSON.stringify(msg)), id);
}
};
/** Perform a console.log with drone id + the message */
DroneManager.prototype.log = function (msg) { };
DroneManager.prototype.getMaxHeight = function () {
return this._API.getMaxHeight();
};
DroneManager.prototype.getMinHeight = function () {
return this._API.getMinHeight();
};
DroneManager.prototype.getInitialAltitude = function () {
return this._API.getInitialAltitude();
};
DroneManager.prototype.getAltitudeAbs = function () {
if (this._controlMesh) {
var altitude = this._controlMesh.position.y;
return this._API.getAltitudeAbs(altitude);
}
return null;
};
/**
* Get a game parameter by name
* @param name Name of the parameter to retrieve
*/
DroneManager.prototype.getGameParameter = function (name) {
if (!this._canCommunicate)
return;
return this._API.getGameParameter(name);
};
DroneManager.prototype.getCurrentPosition = function () {
if (this._controlMesh)
return this._API.processCurrentPosition(
this._controlMesh.position.x,
this._controlMesh.position.z,
this._controlMesh.position.y
);
return null;
};
DroneManager.prototype.setAltitude = function (altitude, skip_loiter) {
if (!this._canPlay)
return;
if (this._start_altitude === 0) {
this._start_altitude = 1;
}
altitude = this._API.setAltitude(altitude, this, skip_loiter);
return;
};
/**
* Make the drone loiter (circle with a set radius)
*/
DroneManager.prototype.loiter = function () {
if (!this._canPlay)
return;
if (this._start_loiter === 0) {
this._start_loiter = 1;
}
};
DroneManager.prototype.getFlightParameters = function () {
if (this._API.getFlightParameters)
return this._API.getFlightParameters();
return null;
};
DroneManager.prototype.getYaw = function () {
//TODO
return 0;
};
DroneManager.prototype.doParachute = function () {
return this._API.doParachute(this);
};
DroneManager.prototype.exit = function () {
return this._API.exit(this);
};
DroneManager.prototype.landed = function () {
return this._API.landed(this);
};
/**
* Set the drone last checkpoint reached
* @param checkpoint to be set
*/
DroneManager.prototype.setCheckpoint = function (checkpoint) {
//TODO
return null;
};
/**
* Function called on game start
*/
DroneManager.prototype.onStart = function () { };
;
/**
* Function called on game update
*/
DroneManager.prototype.onUpdate = function (timestamp) { };
;
/**
* Function called when drone crashes
*/
DroneManager.prototype.onTouched = function () { };
;
/**
* Function called when a message is received
* @param msg The message
*/
DroneManager.prototype.onGetMsg = function (msg) { };
;
return DroneManager;
}());
/******************************************************************************/
/******************************** MAP MANAGER *********************************/
var MapManager = /** @class */ (function () {
//** CONSTRUCTOR
function MapManager(scene) {
var _this = this;
var max = GAMEPARAMETERS.mapSize.width;
if (GAMEPARAMETERS.mapSize.depth > max)
max = GAMEPARAMETERS.mapSize.depth;
if (GAMEPARAMETERS.mapSize.height > max)
max = GAMEPARAMETERS.mapSize.height;
max = max < GAMEPARAMETERS.mapSize.depth ? GAMEPARAMETERS.mapSize.depth : max;
// Skybox
var max_sky = (max * 10 < 20000) ? max * 10 : 20000,
skybox = BABYLON.Mesh.CreateBox("skyBox", max_sky, scene);
skybox.infiniteDistance = true;
skybox.renderingGroupId = 0;
var skyboxMat = new BABYLON.StandardMaterial("skybox", scene);
skyboxMat.backFaceCulling = false;
skyboxMat.disableLighting = true;
skyboxMat.reflectionTexture = new BABYLON.CubeTexture("./assets/skybox/sky", scene);
skyboxMat.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE;
skyboxMat.infiniteDistance = true;
skybox.material = skyboxMat;
// Plane from bottom
var largeGroundMat = new BABYLON.StandardMaterial("largeGroundMat", scene);
largeGroundMat.specularColor = BABYLON.Color3.Black();
largeGroundMat.alpha = 0.4;
var largeGroundBottom = BABYLON.Mesh.CreatePlane("largeGroundBottom", max * 11, scene);
largeGroundBottom.position.y = -0.01;
largeGroundBottom.rotation.x = -Math.PI / 2;
largeGroundBottom.rotation.y = Math.PI;
largeGroundBottom.material = largeGroundMat;
// Camera
scene.activeCamera.upperRadiusLimit = max * 4;
// Terrain
var width = GAMEPARAMETERS.mapSize.width,
depth = GAMEPARAMETERS.mapSize.depth,
height = GAMEPARAMETERS.mapSize.height,
terrain = scene.getMeshByName("terrain001");
terrain.isVisible = true;
terrain.position = BABYLON.Vector3.Zero();
terrain.scaling = new BABYLON.Vector3(depth / 50000, depth / 50000, width / 50000);
// Flight path point list
var count = 0;
this._flight_path_point_list = [];
GAMEPARAMETERS.flight_path_point_list.forEach(function (obs) {
var newObj;
switch (obs.type) {
case "box":
newObj = BABYLON.MeshBuilder.CreateBox("obs_" + count, { 'size': 1 }, scene);
break;
case "cylinder":
newObj = BABYLON.MeshBuilder.CreateCylinder("obs_" + count, {
'diameterBottom': obs.diameterBottom,
'diameterTop': obs.diameterTop,
'height': 1
}, scene);
break;
case "sphere":
newObj = BABYLON.MeshBuilder.CreateSphere("obs_" + count, {
'diameterX': obs.scale.x,
'diameterY': obs.scale.y,
'diameterZ': obs.scale.z
}, scene);
break;
default:
return;
}
newObj.obsType = obs.type;
var convertion = Math.PI / 180;
if ("position" in obs)
newObj.position = new BABYLON.Vector3(obs.position.x, obs.position.y, obs.position.z);
if ("rotation" in obs)
newObj.rotation = new BABYLON.Vector3(obs.rotation.x * convertion, obs.rotation.y * convertion, obs.rotation.z * convertion);
if ("scale" in obs)
newObj.scaling = new BABYLON.Vector3(obs.scale.x, obs.scale.y, obs.scale.z);
if ("color" in obs) {
var material = new BABYLON.StandardMaterial(scene);
material.alpha = 1;
material.diffuseColor = new BABYLON.Color3(obs.color.r, obs.color.g, obs.color.b);
newObj.material = material;
}
_this._flight_path_point_list.push(newObj);
});
}
return MapManager;
}());
\ No newline at end of file
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1003.8464.37017.2594</string> </value> <value> <string>1003.18711.10168.13175</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1663849971.49</float> <float>1664470272.38</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/// <reference path="./typings/babylon.3.1.d.ts" />
var MapManager = /** @class */ (function () {
//*************************************************** CONSTRUCTOR **************************************************
function MapManager(scene) {
var _this = this;
var max = GAMEPARAMETERS.mapSize.width;
if (GAMEPARAMETERS.mapSize.depth > max)
max = GAMEPARAMETERS.mapSize.depth;
if (GAMEPARAMETERS.mapSize.height > max)
max = GAMEPARAMETERS.mapSize.height;
max = max < GAMEPARAMETERS.mapSize.depth ? GAMEPARAMETERS.mapSize.depth : max;
// Skybox
var max_sky = (max * 10 < 20000) ? max * 10 : 20000,
skybox = BABYLON.Mesh.CreateBox("skyBox", max_sky, scene);
skybox.infiniteDistance = true;
skybox.renderingGroupId = 0;
var skyboxMat = new BABYLON.StandardMaterial("skybox", scene);
skyboxMat.backFaceCulling = false;
skyboxMat.disableLighting = true;
skyboxMat.reflectionTexture = new BABYLON.CubeTexture("./assets/skybox/sky", scene);
skyboxMat.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE;
skyboxMat.infiniteDistance = true;
skybox.material = skyboxMat;
// Plane from bottom
var largeGroundMat = new BABYLON.StandardMaterial("largeGroundMat", scene);
largeGroundMat.specularColor = BABYLON.Color3.Black();
largeGroundMat.alpha = 0.4;
var largeGroundBottom = BABYLON.Mesh.CreatePlane("largeGroundBottom", max * 11, scene);
largeGroundBottom.position.y = -0.01;
largeGroundBottom.rotation.x = -Math.PI / 2;
largeGroundBottom.rotation.y = Math.PI;
largeGroundBottom.material = largeGroundMat;
// Camera
scene.activeCamera.upperRadiusLimit = max * 4;
// Terrain
var width = GAMEPARAMETERS.mapSize.width,
depth = GAMEPARAMETERS.mapSize.depth,
height = GAMEPARAMETERS.mapSize.height,
terrain = scene.getMeshByName("terrain001");
terrain.isVisible = true;
terrain.position = BABYLON.Vector3.Zero();
terrain.scaling = new BABYLON.Vector3(depth / 50000, depth / 50000, width / 50000);
// Goals
this._rGoal = BABYLON.Mesh.CreateSphere("rightGoal", 32, GAMEPARAMETERS.goalDiameter, scene);
var rGoalMat = new BABYLON.StandardMaterial("rGoalMat", scene);
rGoalMat.alpha = 0.0;
rGoalMat.diffuseColor = BABYLON.Color3.Red();
this._rGoal.material = rGoalMat;
this._rGoal.position = new BABYLON.Vector3(GAMEPARAMETERS.goalPositionRightTeam.x, GAMEPARAMETERS.goalPositionRightTeam.y, GAMEPARAMETERS.goalPositionRightTeam.z);
this._rGoal.computeWorldMatrix(true);
this._lGoal = BABYLON.Mesh.CreateSphere("leftGoal", 32, GAMEPARAMETERS.goalDiameter, scene);
goal_x = GAMEPARAMETERS.goalPositionLeftTeam.x;
goal_y = GAMEPARAMETERS.goalPositionLeftTeam.y;
goal_z = GAMEPARAMETERS.goalPositionLeftTeam.z;
this._lGoal.position = new BABYLON.Vector3(goal_x, goal_y, goal_z);
var lGoalMat = new BABYLON.StandardMaterial("lGoalMat", scene);
lGoalMat.alpha = 0.0;
lGoalMat.diffuseColor = BABYLON.Color3.Blue();
this._lGoal.material = lGoalMat;
this._lGoal.computeWorldMatrix(true);
//base is now a boat (special object)
ObstacleManager.Prefab.rotation = new BABYLON.Vector3(20.4, 0, 0);
ObstacleManager.Prefab.scaling = new BABYLON.Vector3(15, 15, 15);
goalPart1 = new ObstacleManager("goal_1", scene);
goalPart1.setStartingPosition(goal_x, goal_y, goal_z);
goalPart2 = BABYLON.MeshBuilder.CreateBox("goal_2", { 'size': 1 }, scene);
goalPart2.position = new BABYLON.Vector3(goal_x - 0.5, goal_y + 1.5, goal_z + 1.5);
goalPart2.rotation = new BABYLON.Vector3(0, 0, 0);
goalPart2.scaling = new BABYLON.Vector3(2, 2, 1.5);
goalPart3 = BABYLON.MeshBuilder.CreateCylinder("goal_3", {
'diameterBottom': 1.5,
'diameterTop': 1.5,
'height': 1
}, scene);
goalPart3.position = new BABYLON.Vector3(goal_x + 2.5, goal_y + 1.5, goal_z + 1.5);
goalPart3.rotation = new BABYLON.Vector3(0, 0, 0);
goalPart3.scaling = new BABYLON.Vector3(1.5, 3.5, 1.5);
// Obstacles
var count = 0;
this._obstacles = [];
GAMEPARAMETERS.obstacles.forEach(function (obs) {
var newObj;
switch (obs.type) {
case "box":
newObj = BABYLON.MeshBuilder.CreateBox("obs_" + count, { 'size': 1 }, scene);
break;
case "cylinder":
newObj = BABYLON.MeshBuilder.CreateCylinder("obs_" + count, {
'diameterBottom': obs.diameterBottom,
'diameterTop': obs.diameterTop,
'height': 1
}, scene);
break;
case "sphere":
newObj = BABYLON.MeshBuilder.CreateSphere("obs_" + count, {
'diameterX': obs.scale.x,
'diameterY': obs.scale.y,
'diameterZ': obs.scale.z
}, scene);
break;
case "boat":
ObstacleManager.Prefab.rotation = new BABYLON.Vector3(obs.rotation.x, obs.rotation.y, obs.rotation.z);
ObstacleManager.Prefab.scaling = new BABYLON.Vector3(obs.scale.x * 2, obs.scale.y * 2, obs.scale.z * 2);
newObj = new ObstacleManager("obs_" + count, scene);
newObj.setStartingPosition(obs.position.x, obs.position.y, obs.position.z);
break;
default:
return;
}
newObj["obsType"] = obs.type;
var convertion = Math.PI / 180;
if ("position" in obs)
newObj.position = new BABYLON.Vector3(obs.position.x, obs.position.y, obs.position.z);
if ("rotation" in obs)
newObj.rotation = new BABYLON.Vector3(obs.rotation.x * convertion, obs.rotation.y * convertion, obs.rotation.z * convertion);
if ("scale" in obs)
newObj.scaling = new BABYLON.Vector3(obs.scale.x, obs.scale.y, obs.scale.z);
if ("color" in obs) {
var material = new BABYLON.StandardMaterial(scene);
material.alpha = 1;
material.diffuseColor = new BABYLON.Color3(obs.color.r, obs.color.g, obs.color.b);
newObj.material = material;
}
_this._obstacles.push(newObj);
});
}
Object.defineProperty(MapManager.prototype, "lGoal", {
get: function () { return this._lGoal; },
enumerable: true,
configurable: true
});
Object.defineProperty(MapManager.prototype, "rGoal", {
get: function () { return this._rGoal; },
enumerable: true,
configurable: true
});
Object.defineProperty(MapManager.prototype, "obstacles", {
get: function () { return this._obstacles; },
enumerable: true,
configurable: true
});
return MapManager;
}());
/// <reference path="./typings/babylon.3.1.d.ts" />
var ObstacleManager = /** @class */ (function () {
//*************************************************** CONSTRUCTOR **************************************************
function ObstacleManager(id, scene) {
// Mesh
this._mesh = null;
this._controlMesh = null;
this._colliderBackMesh = null;
this._maxOrientation = Math.PI / 4;
this._scene = scene;
this._id = id;
// Create the control mesh
this._controlMesh = BABYLON.Mesh.CreateBox("obstacleControl_" + id, 0.01, this._scene);
this._controlMesh.isVisible = false;
this._controlMesh.rotation = new BABYLON.Vector3(0, Math.PI, 0);
this._controlMesh.computeWorldMatrix(true);
// Create the mesh from the obstacle prefab
console.log("ObstacleManager.Prefab:", ObstacleManager.Prefab);
this._mesh = ObstacleManager.Prefab.clone("obstacle_" + id, this._controlMesh);
this._mesh.position = BABYLON.Vector3.Zero();
this._mesh.isVisible = true;
this._mesh.computeWorldMatrix(true);
this._propellerAnimMeshes = [];
}
// API
ObstacleManager.prototype._swapAxe = function (vector) {
return new BABYLON.Vector3(vector.x, vector.z, vector.y);
};
Object.defineProperty(ObstacleManager.prototype, "colliderMesh", {
//*************************************************** ACCESSOR *****************************************************
get: function () { return this._mesh; },
enumerable: true,
configurable: true
});
Object.defineProperty(ObstacleManager.prototype, "colliderBackMesh", {
get: function () { return this._colliderBackMesh; },
enumerable: true,
configurable: true
});
Object.defineProperty(ObstacleManager.prototype, "infosMesh", {
get: function () { return this._controlMesh; },
enumerable: true,
configurable: true
});
Object.defineProperty(ObstacleManager.prototype, "position", {
get: function () {
if (this._controlMesh !== null) {
return this._swapAxe(this._controlMesh.position);
}
return null;
},
enumerable: true,
configurable: true
});
//*************************************************** FUNCTIONS ****************************************************
// -- Starting info
/**
* Set the starting position of the obstacle
* Take x,y,z coordinates as parameters
*/
ObstacleManager.prototype.setStartingPosition = function (x, y, z) {
this._controlMesh.position = new BABYLON.Vector3(x, y, z);
this._controlMesh.computeWorldMatrix(true);
this._mesh.computeWorldMatrix(true);
};
return ObstacleManager;
}());
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>ObstacleManager.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>drone_web_worker_obstacle_manager_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Obstacle Manager JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1662651834.74</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1002.54032.1793.9847</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1662657167.12</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1662651770.1</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -7,51 +7,15 @@ ...@@ -7,51 +7,15 @@
// game.js // game.js
(function (RSVP, requestAnimationFrame, cancelAnimationFrame) { (function (RSVP, requestAnimationFrame, cancelAnimationFrame) {
"use strict"; "use strict";
console.log('game');
// Events props to send to worker // Events props to send to worker
const mouseEventFields = new Set([ const mouseEventFields = new Set(['altKey', 'bubbles', 'button', 'buttons',
'altKey', 'cancelBubble', 'cancelable', 'clientX', 'clientY', 'composed', 'ctrlKey',
'bubbles', 'defaultPrevented', 'detail', 'eventPhase', 'fromElement', 'isTrusted',
'button', 'layerX', 'layerY', 'metaKey', 'movementX', 'movementY', 'offsetX', 'pageX',
'buttons', 'offsetY', 'pageY', 'relatedTarget', 'returnValue', 'screenX', 'screenY',
'cancelBubble', 'shiftKey', 'timeStamp', 'type', 'which', 'x', 'wheelDelta', 'wheelDeltaX',
'cancelable', 'wheelDeltaY', 'y', 'deltaX', 'deltaY', 'deltaZ', 'deltaMode',
'clientX',
'clientY',
'composed',
'ctrlKey',
'defaultPrevented',
'detail',
'eventPhase',
'fromElement',
'isTrusted',
'layerX',
'layerY',
'metaKey',
'movementX',
'movementY',
'offsetX',
'offsetY',
'pageX',
'pageY',
'relatedTarget',
'returnValue',
'screenX',
'screenY',
'shiftKey',
'timeStamp',
'type',
'which',
'x',
'y',
'wheelDelta',
'wheelDeltaX',
'wheelDeltaY',
'deltaX',
'deltaY',
'deltaZ',
'deltaMode',
]); ]);
////////////////////////////////////////// //////////////////////////////////////////
...@@ -172,18 +136,8 @@ ...@@ -172,18 +136,8 @@
worker.onmessage = workerToMain; worker.onmessage = workerToMain;
// Always quit the game when the worker callback usage is over // Always quit the game when the worker callback usage is over
// to prevent trying to call pause // to prevent trying to call pause
//context.quit();
return message_error_handler_defer.promise; return message_error_handler_defer.promise;
/*options.canvas_original.addEventListener("mousewheel", (evt) => {
console.log("[MAIN] canvas mousewheel. event:", evt);
const eventClone = cloneEvent(evt);
worker.postMessage({
type: 'mousewheel',
eventClone: eventClone
});
});*/
function workerToMain(evt) { function workerToMain(evt) {
switch (evt.data.type) { switch (evt.data.type) {
case 'loaded': case 'loaded':
...@@ -194,7 +148,6 @@ ...@@ -194,7 +148,6 @@
width: options.width, width: options.width,
height: options.height, height: options.height,
script: options.script, script: options.script,
game_parameters_json: options.game_parameters_json,
log: options.log log: options.log
}, [options.canvas]); }, [options.canvas]);
break; break;
...@@ -206,6 +159,10 @@ ...@@ -206,6 +159,10 @@
case 'updated': case 'updated':
return update_defer.resolve('updated'); return update_defer.resolve('updated');
break; break;
case 'finished':
console.log('GAME: finished');
return context.quit();
break;
case 'event': case 'event':
bindEvent(evt.data); bindEvent(evt.data);
break; break;
...@@ -215,6 +172,9 @@ ...@@ -215,6 +172,9 @@
case 'canvasStyle': case 'canvasStyle':
options.canvas_original.style[evt.data.name] = evt.data.value; options.canvas_original.style[evt.data.name] = evt.data.value;
break; break;
case 'error':
message_error_handler_defer.reject(evt.data.error);
break;
default: default:
message_error_handler_defer.reject( message_error_handler_defer.reject(
new Error('Unsupported message ' + JSON.stringify(evt.data)) new Error('Unsupported message ' + JSON.stringify(evt.data))
...@@ -260,10 +220,8 @@ ...@@ -260,10 +220,8 @@
// We can`t pass original event to the worker // We can`t pass original event to the worker
const eventClone = cloneEvent(e); const eventClone = cloneEvent(e);
if (eventClone.type === "pointerout") { if (eventClone.type === "pointerout") {
console.log("ignoring pointerout event");
return; return;
} }
console.log("[MAIN][LISTENER] event(cloned)-target:", data.eventName, data.targetName);
worker.postMessage({ worker.postMessage({
type: 'event', type: 'event',
targetName: data.targetName, targetName: data.targetName,
...@@ -302,7 +260,6 @@ ...@@ -302,7 +260,6 @@
// droneaailefixe.js // droneaailefixe.js
(function () { (function () {
"use strict"; "use strict";
//console.log('droneaailefixe');
}()); }());
// page gadget.js // page gadget.js
...@@ -315,6 +272,7 @@ ...@@ -315,6 +272,7 @@
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader") .declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("jio_get", "jio_get") .declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareMethod('render', function renderHeader() { .declareMethod('render', function renderHeader() {
var gadget = this, var gadget = this,
...@@ -332,21 +290,19 @@ ...@@ -332,21 +290,19 @@
offscreen = canvas.transferControlToOffscreen(); offscreen = canvas.transferControlToOffscreen();
//TODO this should be in game logic BUT gadget can't be accessed from WW //TODO this should be in game logic BUT gadget can't be accessed from WW
var script_content, game_parameters_json, log_content; var script_content, log_content;
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
return gadget.jio_get("rescue_swarm_script_module/" + "web_worker"); var query = '(portal_type:"Web Script") AND (reference:"loiter_flight_script")';
}) return gadget.jio_allDocs({query: query, select_list: ["text_content"]});
.push(function (script) {
script_content = script.text_content;
return gadget.jio_get("rescue_swarm_map_module/" + "compare_map");
}) })
.push(function (parameters_doc) { .push(function (result) {
game_parameters_json = JSON.parse(parameters_doc.text_content); script_content = result.data.rows[0].value.text_content;
return gadget.jio_get("rescue_swarm_script_module/" + "lp_loiter"); var query = '(portal_type:"Web Manifest") AND (reference:"loiter_flight_log")';
return gadget.jio_allDocs({query: query, select_list: ["text_content"]});
}) })
.push(function (log) { .push(function (result) {
log_content = log.text_content; log_content = result.data.rows[0].value.text_content;
gadget.runGame({ gadget.runGame({
logic_url: parameter_gamelogic, logic_url: parameter_gamelogic,
...@@ -355,7 +311,6 @@ ...@@ -355,7 +311,6 @@
width: canvas.width, width: canvas.width,
height: canvas.height, height: canvas.height,
script: script_content, script: script_content,
game_parameters_json: game_parameters_json,
log: log_content log: log_content
}); });
......
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1003.10118.17019.16759</string> </value> <value> <string>1003.18672.40791.39372</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1663954426.68</float> <float>1664462734.74</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -4,17 +4,6 @@ ...@@ -4,17 +4,6 @@
DroneGameManager*/ DroneGameManager*/
/*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80 */ /*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80 */
/*************************************************************************/
/**************************** ROQUE WW EVENTS ****************************/
/*************************************************************************/
console.log("WITH EVENTS");
self.window = { self.window = {
addEventListener: function (event, fn, opt) { addEventListener: function (event, fn, opt) {
bindHandler('window', event, fn, opt); bindHandler('window', event, fn, opt);
...@@ -34,15 +23,7 @@ self.document = { ...@@ -34,15 +23,7 @@ self.document = {
defaultView: self.window, defaultView: self.window,
}; };
importScripts('babylon.js', 'babylon.gui.js'); importScripts('babylon.js', 'babylon.gui.js', 'rsvp.js',
importScripts('rsvp.js',
'GameManager.js',
'DroneManager.js',
'MapManager.js',
'ObstacleManager.js',
'DroneAaileFixeAPI.js',
'DroneLogAPI.js',
'DroneAPI.js',
'gadget_erp5_page_game_logic.js'); 'gadget_erp5_page_game_logic.js');
function mainToWorker(evt) { function mainToWorker(evt) {
...@@ -52,11 +33,14 @@ function mainToWorker(evt) { ...@@ -52,11 +33,14 @@ function mainToWorker(evt) {
RSVP = window.RSVP; RSVP = window.RSVP;
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
return runGame(offscreen_canvas, evt.data.script, postMessage({'type': 'started'});
evt.data.game_parameters_json, evt.data.log); return runGame(offscreen_canvas, evt.data.script, evt.data.log);
}) })
.push(function () { .push(function (result) {
return postMessage({'type': 'started'}); return postMessage({'type': 'finished', 'result': result});
}, function(error) {
console.log("ERROR:", error);
return postMessage({'type': 'error', 'error': error});
}); });
break; break;
case 'update': case 'update':
...@@ -76,98 +60,6 @@ function mainToWorker(evt) { ...@@ -76,98 +60,6 @@ function mainToWorker(evt) {
} }
}; };
/*****************************************************************************/
/************************************************************************/
/***************************** WORKING GAME *****************************/
/************************************************************************/
/*console.log("WORKING GAME WITH NO EVENTS");
var document = {
addEventListener: function () {},
createElement: function () {}
};
(function (worker) {
importScripts('babylon.js', 'babylon.gui.js');
}(this));
var window = {
addEventListener: function (event, fn, opt) {
bindHandler('window', event, fn, opt);
},
PointerEvent: true
};
document = {
addEventListener: function (event, fn, opt) {
bindHandler('document', event, fn, opt);
},
createElement: function () {
return {onwheel: true};
},
defaultView: window
};
function mainToWorker(evt) {
switch (evt.data.type) {
case 'start':
var offscreen_canvas = prepareCanvas(evt.data);
//override createElement as it is needed by babylon to create a canvas
document.createElement = function (type) {
if (type === 'canvas') { return offscreen_canvas; }
return { onwheel: true };
}
//TODO evt.data.logic_url should contain the list of scripts
importScripts(
'rsvp.js',
'GameManager.js',
'DroneManager.js',
'MapManager.js',
'ObstacleManager.js',
'DroneAaileFixeAPI.js',
'DroneLogAPI.js',
'DroneAPI.js',
evt.data.logic_url);
RSVP = window.RSVP;
window = undefined;
return new RSVP.Queue()
.push(function () {
return runGame(offscreen_canvas, evt.data.script,
evt.data.game_parameters_json, evt.data.log);
})
.push(function () {
return postMessage({'type': 'started'});
});
break;
case 'update':
return new RSVP.Queue()
.push(function () {
return updateGame();
})
.push(function () {
return postMessage({'type': 'updated'});
});
break;
case 'event':
handleEvent(evt.data);
break;
//case 'mousewheel':
// eventGame(evt.data.eventClone);
// break;
default:
throw new Error('Unsupported message ' + JSON.stringify(evt.data));
}
};*/
/*****************************************************************************/
// Doesn't work without it // Doesn't work without it
class HTMLElement {} class HTMLElement {}
...@@ -200,7 +92,6 @@ function bindHandler(targetName, eventName, fn, opt) { ...@@ -200,7 +92,6 @@ function bindHandler(targetName, eventName, fn, opt) {
function handleEvent(event) { function handleEvent(event) {
const handlerId = event.targetName + event.eventName; const handlerId = event.targetName + event.eventName;
console.log("[WEBWORKER] handlerId:", handlerId);
event.eventClone.preventDefault = noop; event.eventClone.preventDefault = noop;
event.eventClone.target = self.canvas; event.eventClone.target = self.canvas;
if (!handlers.has(handlerId)) { if (!handlers.has(handlerId)) {
...@@ -252,7 +143,7 @@ function prepareCanvas(data) { ...@@ -252,7 +143,7 @@ function prepareCanvas(data) {
return canvas; return canvas;
} }
function noop() { console.log("noop!"); } function noop() {}
(function (worker) { (function (worker) {
worker.onmessage = mainToWorker; worker.onmessage = mainToWorker;
......
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1003.14300.40470.3601</string> </value> <value> <string>1003.18860.38045.58146</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1664202107.66</float> <float>1664473758.33</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="Rescue Swarm Script" module="erp5.portal_type"/> <global name="Web Manifest" module="erp5.portal_type"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -62,23 +62,24 @@ ...@@ -62,23 +62,24 @@
</value> </value>
</item> </item>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>content_md5</string> </key>
<value> <string>application/javascript</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>log_loiter</string> </value> <value> <string>loiter_flight_log</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>Loiter flight log. Corresponds to the flight for the script https://lab.nexedi.com/lpgeneau/flight-scripts/blob/update_loop/demo.js\n <value>
\n <none/>
"demo flight" (where the drone is the leader so the code referring to the follower is not executed) using an API similar to the one used in the simulator.\n </value>
The SR is at https://lab.nexedi.com/lpgeneau/slapos/tree/update_loop/software/js-drone (especially the modified worker.js).</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>log_loiter</string> </value> <value> <string>loiter_flight_log</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
...@@ -88,7 +89,13 @@ The SR is at https://lab.nexedi.com/lpgeneau/slapos/tree/update_loop/software/js ...@@ -88,7 +89,13 @@ The SR is at https://lab.nexedi.com/lpgeneau/slapos/tree/update_loop/software/js
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Rescue Swarm Script</string> </value> <value> <string>Web Manifest</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>text_content</string> </key> <key> <string>text_content</string> </key>
...@@ -530,7 +537,13 @@ Taking off...\n ...@@ -530,7 +537,13 @@ Taking off...\n
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>log_loiter</string> </value> <value> <string>Loiter flight log</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
...@@ -563,6 +576,12 @@ Taking off...\n ...@@ -563,6 +576,12 @@ Taking off...\n
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -608,7 +627,7 @@ Taking off...\n ...@@ -608,7 +627,7 @@ Taking off...\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1660134705.82</float> <float>1664461702.56</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
...@@ -657,7 +676,7 @@ Taking off...\n ...@@ -657,7 +676,7 @@ Taking off...\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1002.23821.16502.25531</string> </value> <value> <string>1003.18664.31618.1314</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -675,7 +694,70 @@ Taking off...\n ...@@ -675,7 +694,70 @@ Taking off...\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1660839203.68</float> <float>1664461961.24</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>empty</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1664461675.47</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
const ALTITUDE_DIFF = 30,
FLIGH_ALTITUDE = 100,
PARACHUTE_ALTITUDE = 35,
EPSILON = 105,
EPSILON_YAW = 6,
EPSILON_ALTITUDE = 5,
TARGET_YAW = 0,
checkpoint_list = [
{
"latitude": 45.64492790560583,
"longitude": 14.25334942966329,
"altitude": 585.1806861589965
},
{
"latitude": 45.64316335436476,
"longitude": 14.26332880184475,
"altitude": 589.8802607573035
},
{
"latitude": 45.64911917196595,
"longitude": 14.26214792790128,
"altitude": 608.6648153348965
},
{
"latitude": 45.64122685351364,
"longitude": 14.26590493128597,
"altitude": 606.1448368129072
},
{
"latitude": 45.64543355564817,
"longitude": 14.27242391207985,
"altitude": 630.0829598206344
},
{
"latitude": 45.6372792927328,
"longitude": 14.27533492411138,
"altitude": 616.1839898415284
},
{
"latitude": 45.64061299543953,
"longitude": 14.26161958465814,
"altitude": 598.0603137354178
},
{
"latitude": 45.64032340702919,
"longitude": 14.2682896662383,
"altitude": 607.1243119862851
}
],
landing_point = [
{
"latitude": 45.6398451,
"longitude": 14.2699217
}
],
LEADER_ID = 0,
IS_LEADER = me.id === LEADER_ID;
function altitudeReached(altitude, target_altitude) {
//console.log(`[DEMO] Waiting for altitude... (${altitude} , ${target_altitude})`);
return Math.abs(altitude - target_altitude) < EPSILON_ALTITUDE;
}
function distance(lat1, lon1, lat2, lon2) {
const R = 6371e3, // meters
la1 = lat1 * Math.PI/180, // la, lo in radians
la2 = lat2 * Math.PI/180,
lo1 = lon1 * Math.PI/180,
lo2 = lon2 * Math.PI/180;
//haversine formula
const sin_lat = Math.sin((la2 - la1)/2),
sin_lon = Math.sin((lo2 - lo1)/2),
h = sin_lat*sin_lat + Math.cos(la1)*Math.cos(la2)*sin_lon*sin_lon;
return 2*R*Math.asin(Math.sqrt(h));
}
function exit_on_fail(ret, msg) {
if (ret) {
console.log(msg);
me.exit(1);
}
}
function mustWait(timestamp) {
if(me.timestamp === 0) {
me.timestamp = timestamp;
}
return timestamp - me.timestamp < me.must_wait;
}
me.onStart = function() {
console.log("[WEB SCRIPT] WEB WORKER DRONE START!");
/*console.log("distance from 1st point at start:", distance(me.getCurrentPosition().x, me.getCurrentPosition().y,
checkpoint_list[0].latitude,
checkpoint_list[0].longitude));*/
me.direction_set = false;
me.init_alt_reached = false;
me.landing = false;
me.landing_alt_reached = false;
me.must_wait = 3000;
me.next_checkpoint = 0;
me.parachute_triggered = false;
me.start_altitude = me.getInitialAltitude() + FLIGH_ALTITUDE;
me.timestamp = 0;
if (!IS_LEADER) {
me.follow_leader = true;
me.leader_init_alt_reached = false;
me.start_altitude += ALTITUDE_DIFF;
me.must_wait = 0;
}
exit_on_fail(
me.setAltitude(me.start_altitude + 1, true),
"Failed to set start altitude");
};
me.onUpdate = function(timestamp) {
if (!me.init_alt_reached) {
me.init_alt_reached = altitudeReached(me.getAltitudeAbs(), me.start_altitude);
return;
}
if (me.must_wait > 0) {
if (!mustWait(timestamp)) {
me.must_wait = 0;
me.timestamp = 0;
}
return;
}
if (!IS_LEADER && me.follow_leader) {
if (me.drone_dict[LEADER_ID].altitudeAbs === 0) {
return console.log("[DEMO] Waiting for leader to send its altitude");
}
if (!me.leader_init_alt_reached) {
me.leader_init_alt_reached = me.drone_dict[LEADER_ID].altitudeAbs >= me.start_altitude - ALTITUDE_DIFF;
return console.log(`[DEMO] Waiting for leader to reach altitude ${me.start_altitude - ALTITUDE_DIFF} (currently ${me.drone_dict[LEADER_ID].altitudeAbs})`);
}
if (me.drone_dict[LEADER_ID].altitudeRel > PARACHUTE_ALTITUDE) {
exit_on_fail(
me.setTargetCoordinates(
me.drone_dict[LEADER_ID].latitude,
me.drone_dict[LEADER_ID].longitude,
me.drone_dict[LEADER_ID].altitudeAbs + ALTITUDE_DIFF,
30.001
),
"Failed to follow leader");
} else {
me.follow_leader = false;
me.next_checkpoint = me.drone_dict[LEADER_ID].lastCheckpoint + 1;
console.log("[DEMO] Stop following...\n");
}
return;
}
if (!me.direction_set) {
if (me.next_checkpoint < checkpoint_list.length) {
var current_position = me.getCurrentPosition();
var dist = distance(current_position.x, current_position.y,
checkpoint_list[me.next_checkpoint].latitude,
checkpoint_list[me.next_checkpoint].longitude);
/*console.log("---------------------------------------------");
console.log("[SCRIPT] current_position:", current_position);
console.log("[SCRIPT] next_checkpoint:", checkpoint_list[me.next_checkpoint]);
console.log("[SCRIPT] distance:", dist);*/
exit_on_fail(
me.setTargetCoordinates(
checkpoint_list[me.next_checkpoint].latitude,
checkpoint_list[me.next_checkpoint].longitude,
checkpoint_list[me.next_checkpoint].altitude + FLIGH_ALTITUDE,
100
),
"Failed to set checkpoint coordinates");
//console.log(`[DEMO] Going to Checkpoint ${me.next_checkpoint}\n`)
} else {
console.log("[DEMO] Setting landing coordinates...\n");
me.landing_altitude = me.getAltitudeAbs() - me.getCurrentPosition().z + PARACHUTE_ALTITUDE;
exit_on_fail(
/*me.setTargetCoordinates(
checkpoint_list[checkpoint_list.length - 1].latitude,
checkpoint_list[checkpoint_list.length - 1].longitude,
me.landing_altitude,
100
),*/
me.setAltitude(me.landing_altitude, true),
"Failed to set landing coordinates");
}
me.direction_set = true;
return;
}
if (me.next_checkpoint < checkpoint_list.length) {
me.current_position = me.getCurrentPosition();
me.distance = distance(me.current_position.x, me.current_position.y,
checkpoint_list[me.next_checkpoint].latitude,
checkpoint_list[me.next_checkpoint].longitude);
if (me.distance > EPSILON) {
//console.log(`Waiting for drone to get to destination (${me.distance} m)`);
} else {
/*console.log(`[DEMO] Reached Checkpoint ${me.next_checkpoint}\n`);
console.log("[SCRIPT] current_position:", me.current_position);*/
var loiter_center = checkpoint_list[me.next_checkpoint];
/*console.log("[SCRIPT] next_checkpoint:", checkpoint_list[me.next_checkpoint]);
console.log("[SCRIPT] drone-checkpoint distance:", me.distance);*/
me.next_checkpoint += 1;
me.sendMsg(JSON.stringify({ next_checkpoint: me.next_checkpoint }));
me.direction_set = false;
me.must_wait = 30000;
me.loiter();
}
return;
}
if (!me.landing_alt_reached) {
me.landing_alt_reached = altitudeReached(me.getAltitudeAbs(), me.landing_altitude);
return;
}
if (!me.landing) {
me.current_position = me.getCurrentPosition();
me.distance = distance(me.current_position.x, me.current_position.y,
landing_point.latitude, landing_point.longitude);
if (me.distance > 20) {
//console.log(`[DEMO] Waiting to reach landing point (current distance is ${me.distance})`);
} else {
console.log("[DEMO] Landing...\n");
me.landing = true;
}
return;
}
if (!me.parachute_triggered) {
if (Math.abs(me.getYaw() - TARGET_YAW) < EPSILON_YAW) {
console.log("[DEMO] Deploying parachute...");
exit_on_fail(me.doParachute(2), "Failed to deploy parachute");
me.parachute_triggered = true;
} else {
return console.log(`[DEMO] Waiting for yaw...`);
}
}
if (me.landed()) {
console.log("calling me.exit(0) when me.landed");
me.exit(0);
}
};
me.onGetMsg = function(msg) {
me.msgDict = JSON.parse(msg);
if (me.follow_leader && me.msgDict.hasOwnProperty("next_checkpoint")) {
me.next_checkpoint = me.msgDict.next_checkpoint;
}
};
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>MapManager.js</string> </value> <value> <string>loiter_flight_script</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>drone_web_worker_map_manager_js</string> </value> <value> <string>loiter_flight_script</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Map Manager JS</string> </value> <value> <string>Loiter flight script</string> </value>
</item> </item>
<item> <item>
<key> <string>version</string> </key> <key> <string>version</string> </key>
...@@ -195,7 +195,7 @@ ...@@ -195,7 +195,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1662556210.78</float> <float>1664459507.81</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1002.54126.42371.36932</string> </value> <value> <string>1003.18623.52236.6348</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1662993125.49</float> <float>1664460051.36</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
...@@ -325,7 +325,7 @@ ...@@ -325,7 +325,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1662555978.78</float> <float>1664387279.94</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment