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

Implement thruster control #9

Closed
1 task done
whymarrh opened this issue Nov 5, 2015 · 7 comments
Closed
1 task done

Implement thruster control #9

whymarrh opened this issue Nov 5, 2015 · 7 comments
Assignees
Labels
Milestone

Comments

@whymarrh
Copy link
Contributor

whymarrh commented Nov 5, 2015

Subtasks:

  • Write thruster values over I2C
@whymarrh whymarrh added this to the MATE 2016 milestone Nov 5, 2015
@whymarrh
Copy link
Contributor Author

whymarrh commented Nov 5, 2015

@cal-pratt can we break this up into a bunch of small pull requests to avoid unrelated changes

@whymarrh
Copy link
Contributor Author

I've removed Joystick input and serial from this issue, as this can be thrusters via I2C only

@cal-pratt
Copy link
Contributor

The branch 2016/thruster-communications contains the logic required for controlling the thrusters.

I wasn't quite sure how to use the Schedulers so I've been sticking to just the rx observables, but I think this branch is a lot more sane than the system-manager branch.

Within the entrypoint class Rov there is a static class HeartbeatObserver which listens for HeartbeatValue types from the EventPublisher. The HeartbeatObserver uses the time passed since the last HeartbeatValue and the operation status of the value to determine if the rov should be active. This is then chained with Observable.interval

final Observable<Boolean> operationObservable = 
    Observable.interval(SLEEP_DURATION, TimeUnit.MILLISECONDS)
              .map(l -> heartbeatObserver.isRovOperational());

This Observable<Boolean> is subscribed to by objects which implement Observer<Boolean> in the control package (objects which determine the next-state of the rov hardware) and io package (objects which communicate directly rov hardware). If the boolean they are passed in the onNext method is false then these objects will attempt to set the rov to a safe state, otherwise they will function like normal.

@whymarrh
Copy link
Contributor Author

Sounds like progress! Is that branch ready to become a PR?

@cal-pratt
Copy link
Contributor

I think there might be a couple minor issues with the output in ThrusterConfig6. The algorithm was based off of what Calvin gave me on Saturday, so we probably need to make some test cases to verify the results.

Apart from that, the functions used in I2CThrusterGroup have only been tested on one thruster. So they'll need to be manually tested on an i2c line with multiple thrusters connected.

@whymarrh
Copy link
Contributor Author

Okay. If you're comfortable with that branch, there might be merit in opening a PR and using that to track the progress of the remaining tasks (e.g. tests and whatnot).

@cal-pratt cal-pratt mentioned this issue Nov 29, 2015
2 tasks
@cal-pratt
Copy link
Contributor

The current state.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants