-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from bearbotics2358/feather_can_decoder
Add initial framework for FeatherCanDecoder and ICoralIntakeDataProvider
- Loading branch information
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "io/FeatherCanDecoder.h" | ||
|
||
FeatherCanDecoder::FeatherCanDecoder() { | ||
m_coralIntakeAngleDegrees = 0.0; | ||
m_coralCollected = false; | ||
} | ||
|
||
void FeatherCanDecoder::Update() { | ||
// @todo Read and unpack the CAN bus data to set m_coralIntakeAngleDegrees and m_coralCollected | ||
} | ||
|
||
float FeatherCanDecoder::GetCoralIntakeAngleDegrees() { | ||
return m_coralIntakeAngleDegrees; | ||
} | ||
|
||
bool FeatherCanDecoder::IsCoralCollected() { | ||
return m_coralCollected; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
#include "subsystems/ICoralIntakeDataProvider.h" | ||
|
||
class FeatherCanDecoder: public ICoralIntakeDataProvider { | ||
public: | ||
FeatherCanDecoder(); | ||
|
||
void Update(); | ||
|
||
// **** ICoralIntakeDataProvider interface functions **** // | ||
float GetCoralIntakeAngleDegrees() override; | ||
bool IsCoralCollected() override; | ||
|
||
private: | ||
float m_coralIntakeAngleDegrees; | ||
bool m_coralCollected; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
class ICoralIntakeDataProvider { | ||
public: | ||
// Provide the angle of the coral intake/delivery mechanism in degrees | ||
// @todo Decide if this will return the raw angle or the offset from some fixed point (like straight out or down) | ||
virtual float GetCoralIntakeAngleDegrees() = 0; | ||
|
||
// Return a simple boolean to indicate whether a piece of coral has been collected | ||
virtual bool IsCoralCollected() = 0; | ||
}; |