Skip to content

Commit

Permalink
Fix scaling issue with thoneflow/holybro optical flow pwm3901 UART dr…
Browse files Browse the repository at this point in the history
…iver

Signed-off-by: dirksavage88 <[email protected]>
  • Loading branch information
dirksavage88 authored and bresch committed Jan 9, 2024
1 parent af0eb72 commit 071565a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/drivers/optical_flow/thoneflow/thoneflow_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ bool thoneflow_parse(char c, char *parserbuf, unsigned *parserbuf_index, enum TH
// Checksum valid, populate sensor report
int16_t delta_x = uint16_t(parserbuf[1]) << 8 | parserbuf[0];
int16_t delta_y = uint16_t(parserbuf[3]) << 8 | parserbuf[2];
flow->pixel_flow[0] = static_cast<float>(delta_x) * (3.52e-3f);
flow->pixel_flow[1] = static_cast<float>(delta_y) * (3.52e-3f);
flow->pixel_flow[0] = static_cast<float>(delta_x) * (1.76e-3f);
flow->pixel_flow[1] = static_cast<float>(delta_y) * (1.76e-3f);
*state = THONEFLOW_PARSE_STATE7_CHECKSUM;

} else {
Expand Down

0 comments on commit 071565a

Please sign in to comment.