Skip to content
This repository has been archived by the owner on May 9, 2019. It is now read-only.

Commit

Permalink
refs #17 Add thermistor as optional peripheral.
Browse files Browse the repository at this point in the history
  • Loading branch information
yoos committed Feb 10, 2015
1 parent 4861c21 commit 56b0e9d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/estimator/world_estimator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ WorldEstimator::WorldEstimator(Communicator& communicator)
: worldMessageStream(communicator, 10) {
}

WorldEstimate WorldEstimator::update(GPSReading& gpsReading) {
WorldEstimate WorldEstimator::update(const SensorReadingGroup& readings) {
// TODO: get GPS data

WorldEstimate estimate {
Expand Down
5 changes: 3 additions & 2 deletions src/estimator/world_estimator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

#include "communication/communicator.hpp"
#include "communication/rate_limited_stream.hpp"
#include "sensor/gps.hpp"
#include "estimator/attitude_estimator.hpp"

struct WorldEstimate {
float globe_loc[3];
float therm;
};

class WorldEstimator {
Expand All @@ -19,7 +20,7 @@ class WorldEstimator {
*
* TODO(yoos): Consolidate with attitude estimator.
*/
virtual WorldEstimate update(GPSReading& gpsReading);
virtual WorldEstimate update(const SensorReadingGroup& readings);

private:
RateLimitedStream worldMessageStream;
Expand Down
2 changes: 1 addition & 1 deletion src/system/multirotor_vehicle_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void MultirotorVehicleSystem::update() {
if (i++ % 100 == 0) {
gpsReading = gps.readGPS();
if (thermistor) {
thermReading = (*therm)->readTherm();
thermReading = (*thermistor)->readTherm();
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/system/multirotor_vehicle_system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class MultirotorVehicleSystem : public VehicleSystem, public MessageListener {
Accelerometer& accelerometer,
GPS& gps,
optional<Magnetometer *> magnetometer, // TODO: Use reference_wrapper?
optional<Thermistor *> thermistor,
WorldEstimator& world,
AttitudeEstimator& attitude,
InputSource& inputSource,
Expand All @@ -51,6 +52,7 @@ class MultirotorVehicleSystem : public VehicleSystem, public MessageListener {
Accelerometer& accelerometer;
GPS& gps;
optional<Magnetometer *> magnetometer;
optional<Thermistor *> thermistor;

WorldEstimator& world;
AttitudeEstimator& attitude;
Expand Down
2 changes: 1 addition & 1 deletion variants/units/helios/unit_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct UnitData {
world(communicator),
attitude(communicator),
inputSource(communicator),
system(platform.get<Gyroscope>(), platform.get<Accelerometer>(), platform.get<GPS>(), std::experimental::nullopt, world, attitude, inputSource, motorMapper, communicator) {
system(platform.get<Gyroscope>(), platform.get<Accelerometer>(), platform.get<GPS>(), std::experimental::nullopt, std::experimental::nullopt, world, attitude, inputSource, motorMapper, communicator) {
}
};

Expand Down

0 comments on commit 56b0e9d

Please sign in to comment.