Now that it's June and we're in the middle of GCSEs, we have just been slapped in the face by how little time we have left.
We decided early on that the easiest way to complete the challenges would be to use remote control since we just needed general driving code on the PS4, which we already kind of had (though we edit the controls slightly for every attachment).
This worked to get us a first submittable video for each challenge.
But for MAXIMUM POINTS we know that we need to do challenges autonomously.
Today we set about trying to do the sheep challenge autonomously.
We've got a bunch of commands coded in the BrickPi that lets us code things half-autonomously half-remotely. Basically it's a bunch of key commands that we can later turn into a string of python code:
Semi-auto looks kind of like this
>> N
(Turn north according to gyro)
>> 30
(drive forward 30cm, maintaining gyro bearing)
>> rot 45
(rotate 45 degrees)
>> TR
(push Trailer to the Right)
>> RICEDOWN
(trigger the motor that lets the rice out of the spout)
>> RICEUP
(etc)
And if that works we turn it into:
if command == "CATTLE":
turn(NORTH)
drive(30)
turn(45)
trailerRight()
riceDown()
time.sleep(3)
riceUp()
With this method, we can begin by mapping out the route we want to take with key commands. We worked out the different angles and distances we would need to drive to accurately collect the sheep and bring them into the pen.
But "accurately" isn't easy with Lego gyro sensors. Even with two, there's drift, so the more turns you take without a reset, the more it gets out of alignment with reality.
Also, latching and opening the gate proved to be more difficult than we had imagined, and so we ended up scrapping the entire door just while we were doing practice runs. Even that wasn't enough to help - we kept hitting the walls and missing the open door.
After trying and basically failing a bunch of times, we decided that the autonomous sheep run would be hugely time consuming in the time we had left. We couldn't even get ONE accurate run without a barn door, let alone three.
Here's one of our best runs and as you can see it's pretty awful
In the end we decided to scrap it and roll back to Kilian's remote run. What a waste of a day - we were so depressed even get Subway cookies didn't cheer us up.
Comments