Skip to content

Commit

Permalink
fix loss of information due to quality variable type declaration in O…
Browse files Browse the repository at this point in the history
…F ABI (paparazzi#1974)

* fix loss of information due to quality variable type declaration in OF ABI

* removed FIXME comment
  • Loading branch information
TitusBraber authored and flixr committed Dec 19, 2016
1 parent b1e08d4 commit e577814
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion conf/abi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<field name="flow_y" type="int16_t">Flow in y direction from the camera (in subpixels)</field>
<field name="flow_der_x" type="int16_t">The derotated flow calculation in the x direction (in subpixels)</field>
<field name="flow_der_y" type="int16_t">The derotated flow calculation in the y direction (in subpixels)</field>
<field name="quality" type="uint8_t"/>
<field name="quality" type="float"/>
<field name="size_divergence" type="float">Divergence as determined with the size method (in 1/seconds)</field>
<field name="dist" type="float">Distance to ground</field>
</message>
Expand Down
2 changes: 1 addition & 1 deletion sw/airborne/modules/computer_vision/opticflow_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ void opticflow_module_run(void)
opticflow_result.flow_y,
opticflow_result.flow_der_x,
opticflow_result.flow_der_y,
opticflow_result.noise_measurement,// FIXME, scale to some quality measure 0-255
opticflow_result.noise_measurement,
opticflow_result.div_size,
opticflow_state.agl);
//TODO Find an appropiate quality measure for the noise model in the state filter, for now it is tracked_cnt
Expand Down
4 changes: 2 additions & 2 deletions sw/airborne/modules/ctrl/optical_flow_landing.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static abi_event optical_flow_ev;
/// Callback function of the ground altitude
static void vertical_ctrl_agl_cb(uint8_t sender_id __attribute__((unused)), float distance);
// Callback function of the optical flow estimate:
static void vertical_ctrl_optical_flow_cb(uint8_t sender_id __attribute__((unused)), uint32_t stamp, int16_t flow_x, int16_t flow_y, int16_t flow_der_x, int16_t flow_der_y, uint8_t quality, float size_divergence, float dist);
static void vertical_ctrl_optical_flow_cb(uint8_t sender_id __attribute__((unused)), uint32_t stamp, int16_t flow_x, int16_t flow_y, int16_t flow_der_x, int16_t flow_der_y, float quality, float size_divergence, float dist);

struct OpticalFlowLanding of_landing_ctrl;

Expand Down Expand Up @@ -480,7 +480,7 @@ static void vertical_ctrl_agl_cb(uint8_t sender_id, float distance)
{
of_landing_ctrl.agl = distance;
}
static void vertical_ctrl_optical_flow_cb(uint8_t sender_id, uint32_t stamp, int16_t flow_x, int16_t flow_y, int16_t flow_der_x, int16_t flow_der_y, uint8_t quality, float size_divergence, float dist)
static void vertical_ctrl_optical_flow_cb(uint8_t sender_id, uint32_t stamp, int16_t flow_x, int16_t flow_y, int16_t flow_der_x, int16_t flow_der_y, float quality, float size_divergence, float dist)
{
divergence_vision = size_divergence;
vision_message_nr++;
Expand Down

0 comments on commit e577814

Please sign in to comment.