This commit updates the API used to the one that is used in ev3dev-stretch R3. This is the python API version 2.1.0.
The reason this has been done, is because their were problems with bluetooth on the real robots, which should be fixed by the new R3 release. Since the robots used in the lab and the simulator need to support the same API, this commit helps update the simulator. It includes a lot of style changes to the code. This makes the PR a bit harder to review, but incorporating these changes is useful so that we will have less merge conflicts when updating the code in the future.
I'm making this PR already, so that the code can already be looked at. However, before this is merged it is probably best if the new simulator is also tested with the submissions of students from this year, to ensure that everything works correctly.
Method:
First I went through all the commits (24) between the tags ev3dev-stretch/2.0.0_beta5 and ev3dev-stretch/2.1.0, to see which
changes their were. Most of the commits were changes to the documentation only. Next there were three commits which mostly changed code style (c4cbe75, 659f539, a4ed6b7).
Finally, there were 5 commits that actually changed functionality/fixed bugs:
9486f2d Fix Button process() on Micropython
a227613 Adds Gyro Support to MoveTank (#697)
8b43d6f Add rest notes to sound.Sound.play_song() (#701)
64b7bed LED animation fix duration None (#703)
995bcb6 MoveDifferential: use gyro for better accuracy (#718)
Secondly, I used the method described in the wiki to implement the changes into the simulator:
I cloned the ev3dev-lang-python repository.
I checked out the old version that the current simulator is based on (ev3dev-stretch/2.0.0_beta5).
I copied the files from the current simulator onto this repository and committed these changes on a new branch.
I rebased this branch on the new release of the ev3dev-lang-python repository (ev3dev-stretch/2.1.0), using git rebase
I fixed all merge conflicts using the understanding of the changes I gained during the first phase. I took all code style changes from the new release of the original library, so that in the future it will be easier to upgrade to a new version. For the functional changes, I implemented those that had effect and removed those that concerned classes or functions that are not supported by the simulator.
Once the merging was complete, I copied the ev3dev2 folder from the combined repository into a clean repository of the simulator, checked the changes and made this commit.
Testing:
I have tested this commit in a limited way manually, to ensure that the basic functions are working. Furthermore, I have run the automated tests. Through these I discovered a bug in the way I had updated the sound.py script, but this is fixed now. All automated tests now pass.
This commit updates the API used to the one that is used in ev3dev-stretch R3. This is the python API version 2.1.0.
The reason this has been done, is because their were problems with bluetooth on the real robots, which should be fixed by the new R3 release. Since the robots used in the lab and the simulator need to support the same API, this commit helps update the simulator. It includes a lot of style changes to the code. This makes the PR a bit harder to review, but incorporating these changes is useful so that we will have less merge conflicts when updating the code in the future.
I'm making this PR already, so that the code can already be looked at. However, before this is merged it is probably best if the new simulator is also tested with the submissions of students from this year, to ensure that everything works correctly.
Method:
First I went through all the commits (24) between the tags ev3dev-stretch/2.0.0_beta5 and ev3dev-stretch/2.1.0, to see which changes their were. Most of the commits were changes to the documentation only. Next there were three commits which mostly changed code style (c4cbe75, 659f539, a4ed6b7).
Finally, there were 5 commits that actually changed functionality/fixed bugs:
Secondly, I used the method described in the wiki to implement the changes into the simulator:
Testing:
I have tested this commit in a limited way manually, to ensure that the basic functions are working. Furthermore, I have run the automated tests. Through these I discovered a bug in the way I had updated the sound.py script, but this is fixed now. All automated tests now pass.