Skip to content
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

Closed
wants to merge 16 commits into from
Closed

Piksi Upgrades #226

wants to merge 16 commits into from

Conversation

shihaocao
Copy link
Collaborator

@shihaocao shihaocao commented Feb 24, 2020

  • Added ability to mute Piksi by setting relevant outputs to NaN when Quake is in transceive mode
  • Added set relevant outputs to NaN whenever no data is received (as opposed to leaving last output)
  • Replaced piksi_state_t::dead with a Fault

This change is Reviewable

src/fsw/FCCode/PiksiControlTask.cpp Outdated Show resolved Hide resolved
src/fsw/FCCode/PiksiControlTask.cpp Show resolved Hide resolved
@@ -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();
Copy link
Member

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Will do

Comment on lines 284 to +303
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());
Copy link
Member

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.

@tanishqaggarwal tanishqaggarwal added this to 3/22 - 3/28 in Schedule Mar 10, 2020
@tanishqaggarwal tanishqaggarwal modified the milestones: Sprint: 3/15 - 3/21, Sprint: 3/22 - 3/28 Mar 10, 2020
@tanishqaggarwal tanishqaggarwal added this to Initial Development in Flight Software Development Mar 11, 2020
@tanishqaggarwal tanishqaggarwal moved this from 3/22 - 3/28 to 3/29 - 4/4 in Schedule Mar 15, 2020
@tanishqaggarwal tanishqaggarwal moved this from 3/29 - 4/4 to 3/15 - 3/21 in Schedule Mar 16, 2020
@tanishqaggarwal tanishqaggarwal moved this from 3/15 - 3/21 to 3/22 - 3/28 in Schedule Mar 22, 2020
@tanishqaggarwal tanishqaggarwal moved this from 3/22 - 3/28 to 3/29 - 4/4 in Schedule Mar 28, 2020
@tanishqaggarwal tanishqaggarwal moved this from 3/29 - 4/4 to 4/5 - 4/11 in Schedule Mar 28, 2020
@tanishqaggarwal tanishqaggarwal moved this from 4/5 - 4/11 to 4/12 - 4/18 in Schedule Apr 10, 2020
@tanishqaggarwal tanishqaggarwal moved this from 4/12 - 4/18 to 4/5 - 4/11 in Schedule Apr 14, 2020
@tanishqaggarwal
Copy link
Member

This PR is so old it uses Travis. Can I suggest we close this PR until we're ready to address this properly?

@shihaocao
Copy link
Collaborator Author

Lmao yeah, this PR is very dead, will revive in a bit

@shihaocao shihaocao closed this Aug 30, 2020
@tanishqaggarwal tanishqaggarwal removed this from Unscheduled/Unassigned in Schedule Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Flight Software Development
  
Initial Development
Development

Successfully merging this pull request may close these issues.

None yet

2 participants