1#ifndef INC_ADCS_COMMANDS_H_
2#define INC_ADCS_COMMANDS_H_
35 double mounting_transform_alpha_angle,
36 double mounting_transform_beta_angle,
37 double mounting_transform_gamma_angle,
38 double channel_1_offset,
39 double channel_2_offset,
40 double channel_3_offset,
41 double sensitivity_matrix_s11,
42 double sensitivity_matrix_s22,
43 double sensitivity_matrix_s33,
44 double sensitivity_matrix_s12,
45 double sensitivity_matrix_s13,
46 double sensitivity_matrix_s21,
47 double sensitivity_matrix_s23,
48 double sensitivity_matrix_s31,
49 double sensitivity_matrix_s32);
53uint8_t
ADCS_set_sgp4_orbit_params(
double inclination,
double eccentricity,
double ascending_node_right_ascension,
double perigee_argument,
double b_star_drag_term,
double mean_motion,
double mean_anomaly,
double epoch);
65 float magnetometer_rate_filter_system_noise,
66 float extended_kalman_filter_system_noise,
67 float coarse_sun_sensor_measurement_noise,
68 float sun_sensor_measurement_noise,
69 float nadir_sensor_measurement_noise,
70 float magnetometer_measurement_noise,
71 float star_tracker_measurement_noise,
73 bool use_nadir_sensor,
75 bool use_star_tracker,
76 bool nadir_sensor_terminator_test,
77 bool automatic_magnetometer_recovery,
80 bool automatic_estimation_transition_due_to_rate_sensor_errors,
81 bool wheel_30s_power_up_delay,
82 uint8_t error_counter_reset_period_min);
85 double raan_coefficient,
86 double ecc_coefficient,
87 double aop_coefficient,
88 double time_coefficient,
89 double pos_coefficient,
90 double maximum_position_error,
92 double xp_coefficient,
93 double yp_coefficient,
94 uint8_t gps_roll_over,
97 uint8_t min_satellites,
100 uint16_t min_samples);
uint8_t ADCS_get_power_control(ADCS_power_control_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Get_Power_Control command.
Definition adcs_commands.c:239
uint8_t ADCS_set_estimation_params(float magnetometer_rate_filter_system_noise, float extended_kalman_filter_system_noise, float coarse_sun_sensor_measurement_noise, float sun_sensor_measurement_noise, float nadir_sensor_measurement_noise, float magnetometer_measurement_noise, float star_tracker_measurement_noise, bool use_sun_sensor, bool use_nadir_sensor, bool use_css, bool use_star_tracker, bool nadir_sensor_terminator_test, bool automatic_magnetometer_recovery, ADCS_magnetometer_mode_enum_t magnetometer_mode, ADCS_magnetometer_mode_enum_t magnetometer_selection_for_raw_magnetometer_telemetry, bool automatic_estimation_transition_due_to_rate_sensor_errors, bool wheel_30s_power_up_delay, uint8_t error_counter_reset_period_min)
Instruct the ADCS to execute the ADCS_Set_Estimation_Params command.
Definition adcs_commands.c:567
uint8_t ADCS_get_raw_coarse_sun_sensor_7_to_10(ADCS_raw_coarse_sun_sensor_7_to_10_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Raw_Coarse_Sun_Sensor_7_to_10 command.
Definition adcs_commands.c:921
int16_t ADCS_save_sd_file_to_lfs(bool index_file_bool, uint16_t file_index)
Save a specified file from the ADCS SD card to the ADCS subfolder in LittleFS.
Definition adcs_commands.c:1590
uint8_t ADCS_get_magnetic_field_vector(ADCS_magnetic_field_vector_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Magnetic_Field_Vector command.
Definition adcs_commands.c:767
uint8_t ADCS_get_raw_gps_time(ADCS_raw_gps_time_struct_t *output_struct)
uint8_t ADCS_set_sd_log_config(uint8_t which_log, const uint8_t **log_array, uint8_t log_array_size, uint16_t log_period, ADCS_sd_log_destination_enum_t which_sd)
Instruct the ADCS to execute the ADCS_set_sd_log_config command.
Definition adcs_commands.c:1233
uint8_t ADCS_set_sgp4_orbit_params(double inclination, double eccentricity, double ascending_node_right_ascension, double perigee_argument, double b_star_drag_term, double mean_motion, double mean_anomaly, double epoch)
Instruct the ADCS to execute the ADCS_Set_SGP4_Orbit_Params command.
Definition adcs_commands.c:397
uint8_t ADCS_get_raw_gps_status(ADCS_raw_gps_status_struct_t *output_struct)
uint8_t ADCS_get_raw_gps_x(ADCS_raw_gps_struct_t *output_struct)
uint8_t ADCS_get_rate_gyro_config(ADCS_rate_gyro_config_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Get_Rate_Gyro_Config command.
Definition adcs_commands.c:739
uint8_t ADCS_get_communication_status(ADCS_comms_status_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Communication_Status command.
Definition adcs_commands.c:98
uint8_t ADCS_set_magnetometer_config(double mounting_transform_alpha_angle, double mounting_transform_beta_angle, double mounting_transform_gamma_angle, double channel_1_offset, double channel_2_offset, double channel_3_offset, double sensitivity_matrix_s11, double sensitivity_matrix_s22, double sensitivity_matrix_s33, double sensitivity_matrix_s12, double sensitivity_matrix_s13, double sensitivity_matrix_s21, double sensitivity_matrix_s23, double sensitivity_matrix_s31, double sensitivity_matrix_s32)
Instruct the ADCS to set the magnetometer configuration.
Definition adcs_commands.c:265
uint8_t ADCS_get_igrf_magnetic_field_vector(ADCS_magnetic_field_vector_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_IGRF_Magnetic_Field_Vector command.
Definition adcs_commands.c:823
uint8_t ADCS_get_sgp4_orbit_params(ADCS_orbit_params_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Get_SGP4_Orbit_Params command.
Definition adcs_commands.c:421
uint8_t ADCS_get_augmented_sgp4_params(ADCS_augmented_sgp4_params_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Get_Augmented_SGP4_Params command.
Definition adcs_commands.c:668
uint8_t ADCS_erase_file(ADCS_file_type_enum_t filetype, uint8_t filecounter, bool erase_all)
Send the Erase File command to the ADCS.
Definition adcs_commands.c:1112
uint8_t ADCS_get_commanded_wheel_speed(ADCS_wheel_speed_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Commanded_Wheel_Speed command.
Definition adcs_commands.c:809
uint8_t ADCS_save_image_to_sd(ADCS_camera_select_enum_t camera_select, ADCS_image_size_enum_t image_size)
Instruct the ADCS to save an image to the SD card.
Definition adcs_commands.c:1182
uint8_t ADCS_set_magnetometer_mode(ADCS_magnetometer_mode_enum_t mode)
Instruct the ADCS to execute the titular command.
Definition adcs_commands.c:173
uint8_t ADCS_get_wheel_speed(ADCS_wheel_speed_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Get_Wheel_Speed command.
Definition adcs_commands.c:449
uint8_t ADCS_clear_errors()
Instruct the ADCS to execute the ADCS_Clear_Errors command.
Definition adcs_commands.c:130
uint8_t ADCS_set_rate_gyro_config(ADCS_axis_select_enum_t gyro1, ADCS_axis_select_enum_t gyro2, ADCS_axis_select_enum_t gyro3, double x_rate_offset, double y_rate_offset, double z_rate_offset, uint8_t rate_sensor_mult)
Instruct the ADCS to execute the ADCS_Set_Rate_Gyro_Config command.
Definition adcs_commands.c:719
uint8_t ADCS_get_current_unix_time(uint64_t *epoch_time_ms)
Instruct the ADCS to execute the ADCS_get_current_unix_time command.
Definition adcs_commands.c:1215
uint8_t ADCS_set_run_mode(ADCS_run_mode_enum_t mode)
Instruct the ADCS to execute the ADCS_Set_Run_Mode command.
Definition adcs_commands.c:122
uint8_t ADCS_disable_peripherals_and_SD_logs_with_stabilisation()
Disable all ADCS peripherals and active SD card logs except the CubeSense Motor and Signal power,...
Definition adcs_commands.c:1774
uint8_t ADCS_disable_peripherals_and_SD_logs_without_stabilisation()
Disable all ADCS peripherals and active SD card logs.
Definition adcs_commands.c:1761
uint8_t ADCS_get_raw_coarse_sun_sensor_1_to_6(ADCS_raw_coarse_sun_sensor_1_to_6_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Raw_Coarse_Sun_Sensor_1_to_6 command.
Definition adcs_commands.c:907
uint8_t ADCS_set_unix_time_save_mode(bool save_now, bool save_on_update, bool save_periodic, uint8_t period_s)
Instruct the ADCS to execute the ADCS_Set_Unix_Time_Save_Mode command.
Definition adcs_commands.c:367
uint8_t ADCS_get_hole_map(uint8_t *hole_map_struct, uint8_t which_map)
Retrieve a File Upload Hole Map telemetry from the ADCS.
Definition adcs_commands.c:1087
uint8_t ADCS_get_download_block_ready_telemetry(ADCS_download_block_ready_struct_t *output_struct)
Request Download Block Ready telemetry from the ADCS.
Definition adcs_commands.c:1023
uint8_t ADCS_set_power_control(ADCS_power_select_enum_t cube_control_signal, ADCS_power_select_enum_t cube_control_motor, ADCS_power_select_enum_t cube_sense1, ADCS_power_select_enum_t cube_sense2, ADCS_power_select_enum_t cube_star_power, ADCS_power_select_enum_t cube_wheel1_power, ADCS_power_select_enum_t cube_wheel2_power, ADCS_power_select_enum_t cube_wheel3_power, ADCS_power_select_enum_t motor_power, ADCS_power_select_enum_t gps_power)
Set the power control mode of each component of the ADCS; for each, 0 turns the component off,...
Definition adcs_commands.c:223
uint8_t ADCS_bootloader_clear_errors()
Instruct the ADCS to execute the ADCS_Bootloader_Clear_Errors command.
Definition adcs_commands.c:354
uint8_t ADCS_attitude_control_mode(ADCS_control_mode_enum_t mode, uint16_t timeout)
Instruct the ADCS to execute the titular command.
Definition adcs_commands.c:141
uint8_t ADCS_get_raw_magnetometer_values(ADCS_raw_magnetometer_values_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Get_Raw_Magnetometer_Values command.
Definition adcs_commands.c:477
uint8_t ADCS_get_tracking_controller_target_reference(ADCS_tracking_controller_target_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Get_Tracking_Controller_Target_Reference command.
Definition adcs_commands.c:699
uint8_t ADCS_set_commanded_attitude_angles(double x, double y, double z)
Instruct the ADCS to execute the ADCS_Set_Commanded_Attitude_Angles command.
Definition adcs_commands.c:535
uint8_t ADCS_deploy_magnetometer(uint8_t deploy_timeout)
Instruct the ADCS to execute the ADCS_Deploy_Magnetometer command.
Definition adcs_commands.c:112
uint8_t ADCS_get_sd_card_format_erase_progress(ADCS_sd_card_format_erase_progress_struct_t *output_struct)
Retrieve the SD card format/erase progress telemetry from the ADCS.
Definition adcs_commands.c:1125
uint8_t ADCS_get_file_info_telemetry(ADCS_file_info_struct_t *output_struct)
Request file information telemetry from the ADCS.
Definition adcs_commands.c:979
uint8_t ADCS_cmd_ack(ADCS_cmd_ack_struct_t *ack)
Instructs the ADCS to determine whether the last command succeeded. (Doesn't work for telemetry reque...
Definition adcs_commands.c:41
uint8_t ADCS_get_raw_star_tracker_data(ADCS_raw_star_tracker_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_get_raw_star_tracker_data command.
Definition adcs_commands.c:1167
uint8_t ADCS_get_raw_gps_y(ADCS_raw_gps_struct_t *output_struct)
uint8_t ADCS_load_file_download_block(ADCS_file_type_enum_t file_type, uint8_t counter, uint32_t offset, uint16_t block_length)
Instruct the ADCS to load a file download block into the download buffer.
Definition adcs_commands.c:998
uint8_t ADCS_get_file_download_buffer(ADCS_file_download_buffer_struct_t *output_struct)
Retrieve the File Download Buffer telemetry from the ADCS.
Definition adcs_commands.c:1139
uint8_t ADCS_get_estimation_innovation_vector(ADCS_estimation_innovation_vector_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Estimation_Innovation_Vector command.
Definition adcs_commands.c:865
uint8_t ADCS_get_measurements(ADCS_measurements_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Measurements command.
Definition adcs_commands.c:949
uint8_t ADCS_get_estimate_fine_angular_rates(ADCS_fine_angular_rates_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Estimate_Fine_Angular_Rates command.
Definition adcs_commands.c:491
uint8_t ADCS_get_current_state_1(ADCS_current_state_1_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_get_current_state_1 command. (There's an ADCS_current_state_2 c...
Definition adcs_commands.c:1153
uint8_t ADCS_get_estimate_angular_rates(ADCS_angular_rates_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Estimate_Angular_Rates command.
Definition adcs_commands.c:327
uint8_t ADCS_get_unix_time_save_mode(ADCS_set_unix_time_save_mode_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Get_Unix_Time_Save_Mode command.
Definition adcs_commands.c:376
uint8_t ADCS_get_magnetometer_config(ADCS_magnetometer_config_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Get_Magnetometer_Config command.
Definition adcs_commands.c:505
uint8_t ADCS_disable_SD_logging()
Disable all active ADCS SD card logs.
Definition adcs_commands.c:1748
uint8_t ADCS_synchronize_unix_time()
Instruct the ADCS to synchronize its Unix epoch time to the current OBC Unix time.
Definition adcs_commands.c:1198
int16_t ADCS_load_sd_file_block_to_filesystem(ADCS_file_info_struct_t file_info, uint8_t current_block, lfs_file_t *file)
Save one block of the ADCS SD card file pointed to by the file pointer into the ADCS download buffer,...
Definition adcs_commands.c:1290
uint8_t ADCS_reset_file_list_read_pointer()
Instruct the ADCS to execute the ADCS_reset_file_list_read_pointer command.
Definition adcs_commands.c:962
uint8_t ADCS_erase_sd_file_by_index(uint16_t file_index)
Given the index on the SD card of a file, erase that file.
Definition adcs_commands.c:1786
uint8_t ADCS_set_wheel_speed(int16_t x_speed, int16_t y_speed, int16_t z_speed)
Instruct the ADCS to execute the titular command.
Definition adcs_commands.c:199
uint8_t ADCS_get_sd_log_config(uint8_t which_log, ADCS_sd_log_config_struct *config)
Instruct the ADCS to execute the ADCS_get_sd_log_config command.
Definition adcs_commands.c:1259
uint8_t ADCS_get_estimated_gyro_bias(ADCS_estimated_gyro_bias_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Estimated_Gyro_Bias command.
Definition adcs_commands.c:851
uint8_t ADCS_get_nadir_vector(ADCS_nadir_vector_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Nadir_Vector command.
Definition adcs_commands.c:795
uint8_t ADCS_attitude_estimation_mode(ADCS_estimation_mode_enum_t mode)
Instruct the ADCS to execute the ADCS_Attitude_Estimation_Mode command.
Definition adcs_commands.c:151
uint8_t ADCS_run_once()
Instruct the ADCS to execute the ADCS_Run_Once command.
Definition adcs_commands.c:162
uint8_t ADCS_get_llh_position(ADCS_llh_position_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Get_LLH_Position command.
Definition adcs_commands.c:341
uint8_t ADCS_get_fine_sun_vector(ADCS_fine_sun_vector_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Fine_Sun_Vector command.
Definition adcs_commands.c:781
uint8_t ADCS_get_magnetorquer_command(ADCS_magnetorquer_command_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Get_Magnetorquer_Command command.
Definition adcs_commands.c:463
uint8_t ADCS_advance_file_list_read_pointer()
Instruct the ADCS to execute the ADCS_advance_file_list_read_pointer command.
Definition adcs_commands.c:970
uint8_t ADCS_get_program_status(ADCS_boot_running_status_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Program_Status command.
Definition adcs_commands.c:84
uint8_t ADCS_format_sd()
Instruct the ADCS to format the SD card.
Definition adcs_commands.c:1102
uint8_t ADCS_set_magnetorquer_output(double x_duty, double y_duty, double z_duty)
Instruct the ADCS to execute the ADCS_Set_Magnetorquer_Output command.
Definition adcs_commands.c:181
uint8_t ADCS_bootloader_run_program()
Run the internal flash (CubeACP) program, exiting the bootloader. If CubeACP is already running,...
Definition adcs_commands.c:1856
uint8_t ADCS_initiate_download_burst(bool ignore_hole_map)
Send the Initiate Download Burst command to the ADCS.
Definition adcs_commands.c:1054
uint8_t ADCS_initialize()
Initialize the ADCS CRC, timestamp, and file system directory.
Definition adcs_commands.c:28
uint8_t ADCS_get_raw_cam2_sensor(ADCS_raw_cam_sensor_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Raw_Cam2_Sensor command.
Definition adcs_commands.c:893
uint8_t ADCS_get_commanded_attitude_angles(ADCS_commanded_angles_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Get_Commanded_Attitude_Angles command.
Definition adcs_commands.c:519
uint8_t ADCS_get_rate_sensor_rates(ADCS_rated_sensor_rates_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Rate_Sensor_Rates command.
Definition adcs_commands.c:435
uint8_t ADCS_get_raw_gps_z(ADCS_raw_gps_struct_t *output_struct)
uint8_t ADCS_get_sd_card_file_list(uint16_t num_to_read, uint16_t index_offset)
Get the list of files from the SD card.
Definition adcs_commands.c:1474
uint8_t ADCS_get_estimation_params(ADCS_estimation_params_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Get_Estimation_Params command.
Definition adcs_commands.c:611
uint8_t ADCS_save_orbit_params()
Instruct the ADCS to execute the ADCS_Save_Orbit_Params command.
Definition adcs_commands.c:318
uint8_t ADCS_get_acp_execution_state(ADCS_acp_execution_state_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_execution_state command.
Definition adcs_commands.c:1040
uint8_t ADCS_set_augmented_sgp4_params(double incl_coefficient, double raan_coefficient, double ecc_coefficient, double aop_coefficient, double time_coefficient, double pos_coefficient, double maximum_position_error, ADCS_augmented_sgp4_filter_enum_t augmented_sgp4_filter, double xp_coefficient, double yp_coefficient, uint8_t gps_roll_over, double position_sd, double velocity_sd, uint8_t min_satellites, double time_gain, double max_lag, uint16_t min_samples)
Set the Augmented SGP4 Parameters of the ADCS.
Definition adcs_commands.c:639
uint8_t ADCS_reset()
Instruct the ADCS to execute the ADCS_Reset command.
Definition adcs_commands.c:59
uint8_t ADCS_save_config()
Instruct the ADCS to execute the ADCS_Save_Config command.
Definition adcs_commands.c:310
uint8_t ADCS_get_quaternion_error_vector(ADCS_quaternion_error_vector_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Quaternion_Error_Vector command.
Definition adcs_commands.c:837
uint8_t ADCS_set_tracking_controller_target_reference(float lon, float lat, float alt)
Instruct the ADCS to execute the ADCS_Set_Tracking_Controller_Target_Reference command.
Definition adcs_commands.c:682
uint8_t ADCS_get_estimated_attitude_angles(ADCS_estimated_attitude_angles_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Estimated_Attitude_Angles command.
Definition adcs_commands.c:753
uint8_t ADCS_get_cubecontrol_current(ADCS_cubecontrol_current_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_CubeControl_Current command.
Definition adcs_commands.c:935
uint8_t ADCS_get_identification(ADCS_id_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Identification command.
Definition adcs_commands.c:69
uint8_t ADCS_set_hole_map(uint8_t *hole_map, uint8_t which_map)
Send a File Upload Hole Map command to the ADCS.
Definition adcs_commands.c:1071
uint8_t ADCS_get_raw_cam1_sensor(ADCS_raw_cam_sensor_struct_t *output_struct)
Instruct the ADCS to execute the ADCS_Raw_Cam1_Sensor command.
Definition adcs_commands.c:879
ADCS_camera_select_enum_t
Definition adcs_types.h:238
struct ADCS_Power_Control_struct_t ADCS_power_control_struct_t
ADCS_control_mode_enum_t
Definition adcs_types.h:101
ADCS_sd_log_destination_enum_t
Definition adcs_types.h:252
ADCS_magnetometer_mode_enum_t
Definition adcs_types.h:137
ADCS_image_size_enum_t
Definition adcs_types.h:244
ADCS_estimation_mode_enum_t
Definition adcs_types.h:120
ADCS_file_type_enum_t
Definition adcs_types.h:208
ADCS_augmented_sgp4_filter_enum_t
Definition adcs_types.h:144
ADCS_power_select_enum_t
Definition adcs_types.h:131
ADCS_axis_select_enum_t
Definition adcs_types.h:149
ADCS_run_mode_enum_t
Definition adcs_types.h:57
struct lfs_file lfs_file_t
Definition adcs_types.h:625
Definition adcs_types.h:313
Definition adcs_types.h:432
Definition adcs_types.h:296
Definition adcs_types.h:280
Definition adcs_types.h:405
Definition adcs_types.h:305
Definition adcs_types.h:534
Definition adcs_types.h:630
Definition adcs_types.h:609
Definition adcs_types.h:468
Definition adcs_types.h:498
Definition adcs_types.h:504
Definition adcs_types.h:411
Definition adcs_types.h:621
Definition adcs_types.h:599
Definition adcs_types.h:381
Definition adcs_types.h:480
Definition adcs_types.h:287
Definition adcs_types.h:319
Definition adcs_types.h:474
Definition adcs_types.h:387
Definition adcs_types.h:369
Definition adcs_types.h:560
Definition adcs_types.h:486
Definition adcs_types.h:345
Definition adcs_types.h:492
Definition adcs_types.h:458
Definition adcs_types.h:356
Definition adcs_types.h:510
Definition adcs_types.h:518
Definition adcs_types.h:527
Definition adcs_types.h:540
Definition adcs_types.h:554
Definition adcs_types.h:549
Definition adcs_types.h:375
Definition adcs_types.h:673
Definition adcs_types.h:715
Definition adcs_types.h:338
Definition adcs_types.h:452
Definition adcs_types.h:362