A tool to plot paths for First Lego League
Welcome! This tool is designed to help First Lego League teams plan their movement across the field.
This is a simple script that relies on providing a JSON text file with a set of missions. The tool helps visualize and trace the robot's movement on the field based on the mission data. Importantly, it is intended to be used by students to help assist coding. I intentionally don't want to make it overly complicated so students can drive the development!
Positive offset is shown here where the rotational center is skewed towards the rear of the geometric center. Negative offset would be skewed towards the front of the robot relative to the geometric center.
This helps to explain the orientation of the robot on the playing field.
There is a builder tool that allows move and rotate blocks to be added. There is also a JSON format that is used to run the app. The JSON upload can be used to load several missions to showcase different potential paths or a full set of mission plans.
Below is an example, also in the repository there is a missions.json file with this code:
[ { "name": "Coral Sweep", "startX": 11.5, "startY": 0, "startAngle": 90, "robotWidthCm": 17, "robotLengthCm": 15, "traceColor": "green", "offsetY":1.8, "actions": [ { "type": "move", "value": 17}, { "type": "rotate", "value": -24 }, { "type": "move", "value": 50 }, { "type": "move", "value": -50 }, { "type": "rotate", "value": 24 }, { "type": "move", "value": -17} ] }, { "name": "Raise the Mast", "startX": 25, "startY": 0, "startAngle": 90, "robotWidthCm": 17, "robotLengthCm": 15, "traceColor":"red", "offsetY":1.8, "actions": [ { "type": "move", "value": 55 }, { "type": "rotate", "value": -90 }, { "type": "move", "value": 20 }, { "type": "move", "value": -20 }, { "type": "rotate", "value": 90 }, { "type": "move", "value": -55 } ] }, { "name": "Coral Nursery/Shark Release", "startX": 0, "startY": 24, "startAngle": 0, "robotWidthCm": 17, "robotLengthCm": 15, "traceColor": "yellow", "offsetY":1.8, "actions": [ { "type": "move", "value": 40 }, { "type": "rotate", "value": 90 }, { "type": "move", "value": 43.5 }, { "type": "rotate", "value": 90 }, { "type": "move", "value": 20}, { "type": "move", "value": -20}, { "type": "rotate", "value": -36.5}, { "type": "move", "value": 29}, { "type": "move", "value": -29}, { "type": "rotate", "value": 90}, { "type": "move", "value": 60} ] } ]
Good luck, and have fun plotting your robot’s paths!