-
Notifications
You must be signed in to change notification settings - Fork 6
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
Piksi Upgrades #226
Piksi Upgrades #226
Conversation
@@ -41,37 +59,32 @@ void PiksiControlTask::execute() | |||
//3 means CRC error on serial | |||
//5 means timing error exceed | |||
if(read_out == 3|| read_out == 4|| read_out == 5) | |||
fix_error_count_f.set(fix_error_count_f.get() + 1); | |||
piksi_fault.signal(); |
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.
Rather than having a bunch of distributed signals() and unsignals(), I think it would be better to keep a running flag of whether or not Piksi should be signaled, and then have one if-else block at the end. In my belief this gives a better face-value guarantee that the Piksi fault is either signaled or unsignaled on every control cycle.
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.
Sounds good. Will do
tf.set_read_return(4); | ||
for(int i = 0;i<1000;i++) { | ||
if (i % 100 == 0) { | ||
TEST_ASSERT_EQUAL(i, tf.fix_error_count_fp->get()); | ||
} | ||
TimedControlTaskBase::control_cycle_count++; | ||
tf.execute(); | ||
TimedControlTaskBase::wait_duration(1); | ||
} | ||
const unsigned int delta_t = TimedControlTaskBase::duration_to_us( | ||
TimedControlTaskBase::get_system_time() | ||
- tf.last_fix_time_fp->get()); | ||
TEST_ASSERT_GREATER_OR_EQUAL(1000, delta_t); | ||
assert_piksi_mode(piksi_mode_t::no_data_error); | ||
TEST_ASSERT_FALSE(tf.piksi_fault_fp->is_faulted()); | ||
|
||
//one more execution to throw into DEAD mode | ||
// one more execution to throw fault | ||
TimedControlTaskBase::control_cycle_count++; | ||
tf.execute(); | ||
assert_piksi_mode(piksi_mode_t::dead); | ||
TEST_ASSERT(tf.piksi_fault_fp->is_faulted()); | ||
assert_piksi_mode(piksi_mode_t::no_data_error); | ||
|
||
// one good execution releases the fault | ||
tf.set_read_return(1); | ||
TimedControlTaskBase::control_cycle_count++; | ||
tf.execute(); | ||
assert_piksi_mode(piksi_mode_t::fixed_rtk); | ||
TEST_ASSERT_FALSE(tf.piksi_fault_fp->is_faulted()); |
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.
It should be clearer, in some preamble comments, that this chunk of code will test the fault flag.
This PR is so old it uses Travis. Can I suggest we close this PR until we're ready to address this properly? |
Lmao yeah, this PR is very dead, will revive in a bit |
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)