Skip to content

Commit

Permalink
add ss check by degree
Browse files Browse the repository at this point in the history
  • Loading branch information
SeirenTDoi committed Oct 17, 2023
1 parent 1ddd01d commit 709556e
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
// Satellite Parameters
#include <src_user/Settings/SatelliteParameters/nanossoc_d60_parameters.h>

#define NANOSSOC_D60_UPPER_LIMIT_ANGLE_DEGREE (60) //!< コンポ検出上限
#define NANOSSOC_D60_LOWER_LIMIT_ANGLE_DEGREE (-60) //!< コンポ検出下限

static SunSensorSelector sun_sensor_selector_;
const SunSensorSelector* const sun_sensor_selector = &sun_sensor_selector_;

Expand Down Expand Up @@ -109,6 +112,8 @@ static void APP_SS_SELECTOR_generate_available_list_(void)
static APP_SS_SELECTOR_AVAILABLE APP_SS_SELECTOR_check_availability_(NANOSSOC_D60_IDX idx)
{
float sun_intensity_percent = nanossoc_d60_driver[idx]->info.sun_intensity_percent;
float sun_angle_compo_alpha_deg = nanossoc_d60_driver[idx]->info.sun_angle_compo_deg[NANOSSOC_D60_ANGLE_ELEMENT_ALPHA];
float sun_angle_compo_beta_deg = nanossoc_d60_driver[idx]->info.sun_angle_compo_deg[NANOSSOC_D60_ANGLE_ELEMENT_BETA];

if (nanossoc_d60_driver[idx]->info.checksum_state != NANOSSOC_D60_CHECKSUM_STATE_OK)
{
Expand All @@ -122,6 +127,14 @@ static APP_SS_SELECTOR_AVAILABLE APP_SS_SELECTOR_check_availability_(NANOSSOC_D6
{
return APP_SS_SELECTOR_AVAILABLE_NG;
}
else if (sun_angle_compo_alpha_deg <= NANOSSOC_D60_LOWER_LIMIT_ANGLE_DEGREE || NANOSSOC_D60_UPPER_LIMIT_ANGLE_DEGREE <= sun_angle_compo_alpha_deg)
{
return APP_SS_SELECTOR_AVAILABLE_NG;
}
else if (sun_angle_compo_beta_deg <= NANOSSOC_D60_LOWER_LIMIT_ANGLE_DEGREE || NANOSSOC_D60_UPPER_LIMIT_ANGLE_DEGREE <= sun_angle_compo_beta_deg)
{
return APP_SS_SELECTOR_AVAILABLE_NG;
}
else
{
return APP_SS_SELECTOR_AVAILABLE_OK;
Expand Down

0 comments on commit 709556e

Please sign in to comment.