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 |
|
demo UI does not work atm, still working on it |
|
@kshxtij please ping me once you have thoroughly reviewed this. |
|
|
||
| #include <chrono> | ||
|
|
||
| namespace hyped { |
There was a problem hiding this comment.
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.
If these are both timestamps, why are they different types?
There was a problem hiding this comment.
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.
Do we need this in the demo state machine?
|
|
||
| bool checkPodStopped(utils::Logger &log, const data::Navigation &nav_data) | ||
| { | ||
| if (nav_data.velocity > 0) return false; |
There was a problem hiding this comment.
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.
namespace hyped::demo_state_machine?
There was a problem hiding this comment.
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.
Do we need this? I thought the pod wasn't really moving in demo?
| { | ||
| if (!initialised_) { | ||
| log_.error("servise has not been initialised"); | ||
| log_.error("service has not been initialised"); |
Description
Implementing demo_state_machine. Added missing instances of
kPreReadyin main.cpp under Brakes andfake_trajectory.cppunder Sensors.