Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thursday part 2: Improve SampleStage #13

Open
olliesilvester opened this issue Jul 10, 2024 · 0 comments
Open

Thursday part 2: Improve SampleStage #13

olliesilvester opened this issue Jul 10, 2024 · 0 comments

Comments

@olliesilvester
Copy link
Owner

Add the following functionality to the SampleStage device

  • A set function, which accepts two parameters, the desired position for each motor:

  • The function checks to see if the parameters are within the limits of the motor, and throws a custom exception if they are not

  • Each motor checks the position it is currently at, and then checks its current velocity to see how long it will take to do the move.

  • Both motors should move to their positions at the same time, and throw a timeout error if it took longer than the time calculated above

  • Create a new class attribute called 'previous_positions', which is a list which updates every time the 'set' function is called, and keeps track of all the positions we moved to

  • Also create a 'read' function which returns the current value of motor x and the rotation motor. This should be in a dictionary format. Eg {'x': 0, 'A': 120}

Write tests for these as thoroughly as you can!

@olliesilvester olliesilvester changed the title Thursday part 3: Improve SampleStage Thursday part 2: Improve SampleStage Jul 10, 2024
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

No branches or pull requests

1 participant