-
Notifications
You must be signed in to change notification settings - Fork 0
Update silsim2 #103
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
base: main
Are you sure you want to change the base?
Update silsim2 #103
Conversation
mpkarpov-ui
left a comment
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 like the changes overall, just a couple questions though
| ;lib_deps = | ||
| ; Eigen |
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.
Curious why eigen is killed here
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.
Should undo this getting deleted
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.
Guessing these are just organizational / formatting changes so lgtm
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.
RIP yessir.cpp :(
| enum class LED { | ||
| BLUE = 0, | ||
| RED = 1, | ||
| ORANGE = 2, | ||
| GREEN = 3 | ||
| }; | ||
|
|
||
| /** | ||
| * The ESP32 has two physical cores, which will each be dedicated to one group of threads. | ||
| * The DATA_CORE runs the GPS thread, as well as the threads which read from the sensor_data struct (e.g. SD logging). | ||
| */ | ||
| #define DATA_CORE ((BaseType_t) 1) | ||
| enum class Channel { | ||
| A = 0, | ||
| B = 1, | ||
| C = 2, | ||
| D = 3 | ||
| }; | ||
|
|
||
| /** | ||
| * Macro for declaring a thread. Creates a function with the name suffixed with `_thread`, annotated with [[noreturn]]. | ||
| * | ||
| * @param name The name of the task. | ||
| * @param param The single parameter to input into the thread. | ||
| */ | ||
| #define DECLARE_THREAD(name, param) [[noreturn]] void name##_thread(param) | ||
| enum class Camera { | ||
| Side = 0, | ||
| Bulkhead = 1 | ||
| }; |
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.
Any reason we're switching to enum classes instead of defines here?
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 is better than the #DEFINE pattern
| float roll_rate_hz = std::clamp(std::abs(orientation.angular_velocity.vx) / (2.0f*static_cast<float>(PI)), 0.0f, max_roll_rate_hz); | ||
| float roll_rate_hz = std::clamp(std::abs(orientation.angular_velocity.vx) / (2.0f*static_cast<float>(M_PI)), 0.0f, max_roll_rate_hz); |
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 thought PI and M_PI had different values?
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.
Maybe I'm just misremembering
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 thought M_PI was something like ~ 0.27, might be mistaken though
No description provided.