Skip to content

Update MINDCUBER to new API - #12

Merged
dwalton76 merged 6 commits into
ev3dev:masterfrom
dwalton76:mindcuber
Oct 11, 2017
Merged

dwalton76 merged 6 commits into
ev3dev:masterfrom
dwalton76:mindcuber

Conversation

@dwalton76

Copy link
Copy Markdown
Collaborator

No description provided.

@dwalton76

Copy link
Copy Markdown
Collaborator Author

For issue #4

rotate_speed = 400
flip_speed = 300
flip_speed_push = 400
corner_to_edge_diff = 60

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wasn't used

self.color_sensor = ColorSensor()
self.color_sensor.mode = self.color_sensor.MODE_RGB_RAW
self.infrared_sensor = InfraredSensor()
self.cube = {}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wasn't used

Comment thread robots/MINDCUB3R/mindcuber.py Outdated
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()

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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')

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have changed this when we moved from python2 to python3



class Rubiks(object):
class MindCuber(object):

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea why I named this class Rubiks way back when

@dwalton76

Copy link
Copy Markdown
Collaborator Author

This depends on the changes in ev3dev/ev3dev-lang-python#407

@dwalton76
dwalton76 merged commit f812326 into ev3dev:master Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants