Skip to content

Commit

Permalink
silent compile warnings opticflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dewagter committed Sep 23, 2023
1 parent 3569f37 commit ad633f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions sw/airborne/modules/computer_vision/textons.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ static FILE *dictionary_logger = NULL;
* @param[out] *img The output image
* @param[in] *img The input image (YUV422)
*/
struct image_t *texton_func(struct image_t *img, uint8_t p);
struct image_t *texton_func(struct image_t *img, uint8_t p)
struct image_t *texton_func(struct image_t *img, UNUSED uint8_t p);
struct image_t *texton_func(struct image_t *img, UNUSED uint8_t p)
{
// whether to execute the function:
if (!running) { return img; }
Expand Down Expand Up @@ -286,7 +286,7 @@ void DictionaryTrainingYUV(uint8_t *frame, uint16_t width, uint16_t height)
}

// Extract and learn from n_samples_image per image
for (s = 0; s < n_samples_image; s++) {
for (s = 0; s < (int) n_samples_image; s++) {
// select a random sample from the image
x = rand() % (width - patch_size);
y = rand() % (height - patch_size);
Expand Down Expand Up @@ -446,7 +446,7 @@ void DistributionExtraction(uint8_t *frame, uint16_t width, uint16_t height)
texton_distribution[assignment]++;
n_extracted_textons++;

if (!FULL_SAMPLING && n_extracted_textons == n_samples_image) {
if (!FULL_SAMPLING && n_extracted_textons == (int) n_samples_image) {
finished = 1;
} else {
// FULL_SAMPLING is actually a sampling that covers the image:
Expand Down
8 changes: 4 additions & 4 deletions sw/airborne/modules/ctrl/optical_flow_landing.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ void vertical_ctrl_module_init(void)
of_landing_ctrl.vel = 0.0f;
of_landing_ctrl.divergence_setpoint = 0.0f; // For exponential gain landing, pick a negative value
of_landing_ctrl.cov_set_point = OFL_COV_SETPOINT;
of_landing_ctrl.cov_limit = fabsf(OFL_COV_LANDING_LIMIT);
of_landing_ctrl.cov_limit = fabsf((float)OFL_COV_LANDING_LIMIT);
of_landing_ctrl.lp_const = OFL_LP_CONST;
Bound(of_landing_ctrl.lp_const, 0.001f, 1.f);
of_landing_ctrl.pgain = OFL_PGAIN;
Expand Down Expand Up @@ -1125,7 +1125,7 @@ void guidance_h_module_enter(void)

}

void guidance_h_module_run(bool in_flight)
void guidance_h_module_run(bool UNUSED in_flight)
{

}
Expand Down Expand Up @@ -1248,7 +1248,7 @@ void learn_from_file(void)
printf("Learned! Fit error = %f\n", fit_error);

// free learning distributions:
for (i = 0; i < n_read_samples; i++) {
for (i = 0; i < (int) n_read_samples; i++) {
free(text_dists[i]);
}
}
Expand Down Expand Up @@ -1312,7 +1312,7 @@ void recursive_least_squares_batch(float *targets, float **samples, uint8_t D, u
(*fit_error) = sum_abs_err / count;
}

void recursive_least_squares(float target, float *sample, uint8_t length_sample, float *params)
void recursive_least_squares(float target, float *sample, uint8_t length_sample, UNUSED float *params)
{
// MATLAB procedure:
/*
Expand Down

0 comments on commit ad633f7

Please sign in to comment.