Repository navigation
Update MINDCUBER to new API - #12
Conversation
|
For issue #4 |
| rotate_speed = 400 | ||
| flip_speed = 300 | ||
| flip_speed_push = 400 | ||
| corner_to_edge_diff = 60 |
| self.color_sensor = ColorSensor() | ||
| self.color_sensor.mode = self.color_sensor.MODE_RGB_RAW | ||
| self.infrared_sensor = InfraredSensor() | ||
| self.cube = {} |
| self.turntable.wait_for_position(final_pos, stall_ok=True) | ||
| self.turntable.wait_for_stop() | ||
| self.turntable.wait_until('running') | ||
| self.turntable.wait_until_not_moving() |
There was a problem hiding this comment.
I rebuilt MINDCUBER and solved several cubes to test all of the changes. The wait_until('running') followed by wait_until_not_moving() combination works extremely well.
There was a problem hiding this comment.
Should we make a helper for that? It seems like you need to do this pretty much every time.
Also, I think we should pay attention to the new APIs; where possible,. I would prefer that we update our demo code do use them rather than the older ones.
There was a problem hiding this comment.
Good point I hadn't thought about switching over to the on_for_XYZ calls...will do that. All of the on_for_XYZ methods do wait_until('running') followed by wait_until_not_moving() (assuming block is True) so that will clean up most of these.
| log.info(self.color_sensor.rgb()) | ||
| self.colorarm_remove_halfway() | ||
|
|
||
| def scan_middles(self): |
There was a problem hiding this comment.
Not used and was the only caller of scan_middle() so deleting it too
| self.flipper_away() | ||
| self.rotate_cube(1, 1) | ||
| raw_input('Paused') | ||
| input('Paused') |
There was a problem hiding this comment.
Should have changed this when we moved from python2 to python3
|
|
||
|
|
||
| class Rubiks(object): | ||
| class MindCuber(object): |
There was a problem hiding this comment.
No idea why I named this class Rubiks way back when
|
This depends on the changes in ev3dev/ev3dev-lang-python#407 |
No description provided.