cmu-mars / brasscomms

0 stars 1 forks source link

Implement query_path #15

Closed schmerl closed 7 years ago

schmerl commented 7 years ago

Added an API for LL to call us to get the path, to simplify obstacle placement. From Wiki:

// After ready is reported, the th will use this query to 
// get the initial planned path
GET http://brass-ta/action/query_path
TEST_ACTION:
  {TIME: TIME_ENCODING, ARGUMENTS : {}}
ACTION_RESULT:
  {TIME: TIME_ENCODING, ARGUMENTS : {path : [String]}}

From Konrad:

  1. Obstacle placement will be performed at startup based on the following interaction:

a. After receipt of DAS_READY, the TH will send TEST_ACTION/action/query_path to the DAS. b. DAS will respond with the planned path in JSON as a sequence of waypoint identifiers including the start and target as the first and last waypoints, and visiting the target waypoint only once: { path : [ “start_waypoint”, …, “target_waypoint” ] } c. TH will randomly choose an obstacle location from the middle 50% of the path length and send TEST_ACTION/action/place_obstacle with the selected location as: { x : Integer, y : Integer } d. DAS will respond with a string identifier that may be used as the argument to remove_obstacle (per your Wiki page and RR1 python code) { obstacle_id : String } e. After the TH receives the ack, TH will send TEST_ACTION/action/start

The Instruction graphs are stored in a file, but they do not contain the waypoints - just the coordinates. We need some way to encode or get those waypoints. Perhaps we cache an associated file that has the json that should be returned. Something like l1_to_l6_waypoints.json.

joshsunshine commented 7 years ago

Is there a file containing the mapping between waypoints and coordinates?

ivoysey commented 7 years ago

Javier is generating way points JSON

ivoysey commented 7 years ago

https://github.com/schmerl/LLStaging/commit/a90fefd45102bd0b0365db2a2a97a7adcb0f6960