Skip to content

Conversation

@cal-pratt
Copy link
Contributor

As the project has expanded the io package has become larger and larger. This PR attempts to re-package the io classes to make more sense. New sub-packages have been created for this purpose.

A generic io.devices package has been created to hold onto all of the interfaces implemented by the io package. Further, the Barometer and Thermometer classes have been refactored to use PressureValue / TemperatureValue interfaces instead of InternalPressureValue/ TemperaturePressureValue. This means that no new device interface had to be created to make the new Bar30PressureSensor (which reads pressure and temperature). Continuing this change, the same package has been created under test to hold onto the mock classes.

During this cleanup I also removed a lot of the sensors that we don't use anymore such as the LM35, TMP36, and MPX4250AP.

The panel controllers (EmergencyStopController, MotionPowerStoreController, SliderController) have been moved to a panel package and their dependency on the Arduino has been removed. Arduino now implements the BoardIO interface which is in the devices package.

The rpi package was created to hold onto Raspberry Pi specific code. In the future it would be good to limit all the pi4j dependencies to this folder to help make more of the code readily testable.

The Bar30PressureSensor depth sensor itself is now present under the io package and implements PressureValue and TemperatureValue. It follows a similar pattern to the IMU and is passed to the Rov as a generic value with multiple bounded type parameters.

This still needs to be tested in hardware, but once that's done this should be good to go.

@cal-pratt cal-pratt added this to the MATE 2017 milestone Jun 13, 2017
@cal-pratt cal-pratt self-assigned this Jun 13, 2017
@cal-pratt cal-pratt requested a review from ConnorWhalen June 13, 2017 21:07
@cal-pratt
Copy link
Contributor Author

edits Added a line to the startup command which enables remote debugging. This can be done through intellij or eclipse and let the user debug the pi remotely in their IDE.

I don't know why I only just added this... I've used this tool many times in the past.

@cal-pratt
Copy link
Contributor Author

Edits:

  • Bar 30 sensor is garbage and fails randomly every 10 reads or so. This either results in a complete IOException, or it returns false bytes (my favorite 😠 😢 ). For this I added a unsafe way to read I2C and I also added logic in pressure sensor that ignores values 10% different from the last reading. This might not be enough, but we'll deal with that later.
  • I removed packaging dependencies in the testJar. Just zip the test contents and launch the app like normal.
  • Fixed various logic bugs in the Bar 30 reader. Now reads proper values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants