EasternEdgeRobotics / Software_2017

The control software for 2017
MIT License
3 stars 0 forks source link

Refactor the io package and create depth sensor. #320

Closed cal-pratt closed 7 years ago

cal-pratt commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

Edits: