-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d1e4fe
commit dbb3f0a
Showing
46 changed files
with
2,297 additions
and
1,809 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import supervisor | ||
|
||
supervisor.set_next_stack_limit(4096 + 4096) | ||
supervisor.set_next_stack_limit(4096 + 4096) |
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
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
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 |
---|---|---|
@@ -1,18 +1,18 @@ | ||
''' | ||
""" | ||
In this method the PyCubed will wait a pre-allotted loiter time before proceeding to execute | ||
main. This loiter time is to allow for a keyboard interupt if needed. | ||
Authors: Nicole Maggard and Michael Pham | ||
''' | ||
""" | ||
|
||
import time | ||
import microcontroller | ||
|
||
try: | ||
import main | ||
|
||
except Exception as e: | ||
except Exception as e: | ||
print(e) | ||
time.sleep(10) | ||
microcontroller.on_next_reset(microcontroller.RunMode.NORMAL) | ||
microcontroller.reset() | ||
microcontroller.reset() |
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 |
---|---|---|
@@ -1,16 +1,23 @@ | ||
def dot_product(vector1, vector2): | ||
return sum([a*b for a,b in zip(vector1, vector2)]) | ||
return sum([a * b for a, b in zip(vector1, vector2)]) | ||
|
||
|
||
def x_product(vector1, vector2): | ||
return [vector1[1]*vector2[2]-vector1[2]*vector2[1],vector1[0]*vector2[2]-vector1[2]*vector2[0],vector1[0]*vector2[1]-vector1[1]*vector2[0]] | ||
return [ | ||
vector1[1] * vector2[2] - vector1[2] * vector2[1], | ||
vector1[0] * vector2[2] - vector1[2] * vector2[0], | ||
vector1[0] * vector2[1] - vector1[1] * vector2[0], | ||
] | ||
|
||
|
||
def gain_func(): | ||
return 1.0 | ||
|
||
def magnetorquer_dipole(mag_field,ang_vel): | ||
gain=gain_func() | ||
scalar_coef=-gain/pow(dot_product(mag_field,mag_field),0.5) | ||
dipole_out=x_product(mag_field,ang_vel) | ||
|
||
def magnetorquer_dipole(mag_field, ang_vel): | ||
gain = gain_func() | ||
scalar_coef = -gain / pow(dot_product(mag_field, mag_field), 0.5) | ||
dipole_out = x_product(mag_field, ang_vel) | ||
for i in range(3): | ||
dipole_out[i]*=scalar_coef | ||
dipole_out[i] *= scalar_coef | ||
return dipole_out |
Oops, something went wrong.