Skip to content

MoveDifferential - #536

Merged
dwalton76 merged 20 commits into
ev3dev:ev3dev-stretchfrom
dwalton76:brickpi3
Nov 7, 2018
Merged

dwalton76 merged 20 commits into
ev3dev:ev3dev-stretchfrom
dwalton76:brickpi3

Conversation

@dwalton76

Copy link
Copy Markdown
Collaborator

For issue #392

Comment thread ev3dev2/__init__.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/wheel.py Resolved
Comment thread utils/move_differential.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/wheel.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/wheel.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/wheel.py Resolved
Comment thread tests/api_tests.py Resolved
Comment thread utils/move_differential.py Resolved
Comment thread ev3dev2/motor.py Resolved
@dwalton76

Copy link
Copy Markdown
Collaborator Author

@WasabiFan I think I have most things addressed besides the needed docstrings updates...will tackle those tonight.

Using collections.OrderedDict causes the micropython tests to fail, it does not have "collections". How have we been handling this scenario? I could catch it and use a regular dict instead but then we do not have the sorting we want. Another way we could handle this would be to go back to a regular dict but also create sorted list of motors in init. We would then use this sorted list anytime we need to loop over the list of motors.

@ddemidov

Copy link
Copy Markdown
Member

Using collections.OrderedDict causes the micropython tests to fail, it does not have "collections".

http://docs.micropython.org/en/v1.9.3/pyboard/library/ucollections.html

Comment thread docs/other.rst Resolved
Comment thread ev3dev2/motor.py Resolved
Comment thread ev3dev2/motor.py Outdated

New arguments:

wheel_class - A class typically from ev3dev2/wheel.py. This is used to

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.

Link to wheel section in docs? There should be examples for motor units. IIRC you might need to manually add a tag to the docs page.

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.

Given that none of the other docstrings (none of the ones that I looked at at least...Motor, ColorSensor, etc) are linking to their respective docs sections I would say lets leave it as is. If we want to have docstrings include links to their docs sections lets do that via a separate issue.

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.

The only other case where usage of one class depends on another is with units -- and we have links there. For example:

"""
Rotate the motor at ``speed`` for ``rotations``
``speed`` can be a percentage or a :class:`ev3dev2.motor.SpeedValue`
object, enabling use of other units.
"""

In these cases the user wants to have quick access to the relevant documentation. Remember, this is used both in docstrings and online rendered docs pages.

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.

will fix

Comment thread ev3dev2/motor.py
motor.wait_while(s, timeout)

def _block(self):
self.wait_until('running', timeout=WAIT_RUNNING_TIMEOUT)

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.

What's the change here? There used to be a _block in MoveTank but now that seems to have been removed and this was added. But I don't see changes to the usage.

If this is intended to replace the batch version in MoveTank, I have some additional questions about potential impacts.

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 change to the functionality this was just moving it up to the MotorSet class

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.

Can you expand on that?

It looks to me like the logic was changed from...

wait for motor A to start
wait for motor B to start
wait for motor A to stop
wait for motor B to stop

...to...

wait for motor A to start
wait for motor A to stop
wait for motor B to start
wait for motor B to stop

Which we've had issues with before.

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.

The logic is still

wait for motor A to start
wait for motor B to start
wait for motor A to stop
wait for motor B to stop

MotorSet.wait_until() loops over all of the motors so it will wait for A to start then wait for B to start...same basic logic for MotorSet.wait_until_not_moving

Comment thread ev3dev2/motor.py Resolved
Comment thread docs/other.rst
.. autoclass:: ev3dev2.port.LegoPort
:members:

Wheels

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.

In all honesty, I think the other docs page is pretty unweildy. We have so much stuff here that it just becomes difficult to browse. What do you think about breaking from tradition here and giving this its own file, and then we can track an issue for splitting out some of the other classes (like buttons) which are getting pretty big?

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.

Let's commit the wheels docs here for now and then we can figure out how we want to split this file up afterwards?

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.

Filed #559 to track this part

@dwalton76

Copy link
Copy Markdown
Collaborator Author

I think this one is ready to go. Do you guys want me to squash the commits down into one big "MoveDifferential" commit or just merge this as is?

@dwalton76

Copy link
Copy Markdown
Collaborator Author

Thank you for all of the feedback/conversation on this one. This ended up being a fairly large patch in order to implement the MoveDifferential functionality. At this point there haven't been any major changes to the patch in several days so I am going to go ahead and merge it....we can address any more tweaks via another commit.

@dwalton76
dwalton76 merged commit dede0b9 into ev3dev:ev3dev-stretch Nov 7, 2018
@dwalton76
dwalton76 deleted the brickpi3 branch November 7, 2018 11:42
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.

3 participants