-
Notifications
You must be signed in to change notification settings - Fork 0
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
Controller Module Header File #34
base: main
Are you sure you want to change the base?
Conversation
Have you looked at the embedded coding standard yet https://docs.waterloorocketry.com/general/standards/embedded-coding-standard.html |
* Must be called before RTOS scheduler starts | ||
* @return true if initialization successful | ||
*/ | ||
bool Controller_Init(void); |
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.
we use snake_case
// Output of controller to be sent to servo via CAN | ||
typedef struct { | ||
float commanded_angle; // Desired angle | ||
float actual_angle; // Current angle |
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.
Why are you interested in sending the actual angle? That should be handled within MCB itself
float timestamp; // Timestamp in ms | ||
} controller_state_t; | ||
|
||
// Output of controller to be sent to servo via CAN |
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.
// Output of controller to be sent to servo motor controller board via CAN
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.
Attitude is a 4 vector with the quaternions q0 - q3.
State vector also includes canard coefficient CL, and canard angle delta, which are both states
float commanded_angle; // Desired angle | ||
float actual_angle; // Current angle | ||
uint32_t timestamp; // Timestamp | ||
uint32_t servo_id; // Servo identifier |
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.
Can you explain what servo_id is for? We only have one servo. @rexblade21 I'd like you to work with processor ppl to figure out what u want in your message
* @param output Pointer to store output -> type defined in state_estimation.h | ||
* @return false if no output available | ||
*/ | ||
bool Controller_Get_Latest_Output(control_output_SE_t *output); |
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.
Make sure state_estimation.h correctly defines control_output_SE_t
@@ -0,0 +1,58 @@ | |||
#ifndef CONTROLLER_H_ | |||
#define CONTROLLER_H_ |
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.
update header file
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.
added some comments in the google doc
@Joe-Joe-Joe-Joe @FinnBreu can u guys also review the design in the google doc?
float actual_angle; // Current angle | ||
uint32_t timestamp; // Timestamp | ||
uint32_t servo_id; // Servo identifier | ||
} controller_can_output_t; |
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.
this is an internal thing right? does it need to be exposed in this .h
Comments in the gdoc |
#include <stdbool.h> | ||
|
||
/* Enums/Types */ | ||
typedef struct { |
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 recommend a union for this. See https://github.com/xioTechnologies/Fusion/blob/main/Fusion/FusionMath.h
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.
#41
im gonna make vectors a common project-wide type
Added header file for controller modules