-
Notifications
You must be signed in to change notification settings - Fork 1
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
Dynamic Traction Demonstration State Machine #123
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #123 +/- ##
==========================================
+ Coverage 38.20% 40.78% +2.58%
==========================================
Files 69 73 +4
Lines 3942 4129 +187
==========================================
+ Hits 1506 1684 +178
- Misses 2436 2445 +9
Continue to review full report at Codecov.
|
@MiltFra its not complete yet, just wanted to check if what I've done so far is okay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good so far.
demo UI does not work atm, still working on it |
@kshxtij please ping me once you have thoroughly reviewed this. |
src/demo_state_machine/state.cpp
Outdated
|
||
#include <chrono> | ||
|
||
namespace hyped { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
namespace hyped::demo_state_machine
?
|
||
const uint64_t time_now = utils::Timer::getTimeMicros(); | ||
const int64_t time_elapsed = time_now - instance_.acceleration_start_; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these are both timestamps, why are they different types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getTimeMacros()
gives a uint64_t so I have to use it, but for time_elapsed
we need to worry about it being signed (positive specifically) coz negative time difference should not happen and we should know that's the case
// Navigation Data Events | ||
//-------------------------------------------------------------------------------------- | ||
|
||
bool checkEnteredBrakingZone(utils::Logger &log, const data::Navigation &nav_data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this in the demo state machine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, will remove
|
||
bool checkPodStopped(utils::Logger &log, const data::Navigation &nav_data) | ||
{ | ||
if (nav_data.velocity > 0) return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure it will be exactly zero since it is type float. Maybe we could use a small number as a tolerance?
|
||
namespace hyped { | ||
|
||
namespace demo_state_machine { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
namespace hyped::demo_state_machine
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntactic difference, will change it still
return true; | ||
} | ||
|
||
bool checkReachedMaxVelocity(utils::Logger &log, const data::Navigation &nav_data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? I thought the pod wasn't really moving in demo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, will remove
@@ -123,7 +123,7 @@ void Gpio::uninitialise() | |||
void Gpio::exportGPIO() | |||
{ | |||
if (!initialised_) { | |||
log_.error("servise has not been initialised"); | |||
log_.error("service has not been initialised"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍
Description
Implementing demo_state_machine. Added missing instances of
kPreReady
in main.cpp under Brakes andfake_trajectory.cpp
under Sensors.