Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msg: fix comments in SensorOpticalFlow and VehicleOpticalFlow #24337

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dakejahl
Copy link
Contributor

The EKF uses this convention but the raw sensor input data uses the opposite convention.

See comments in code about this

sensors
https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/sensors/vehicle_optical_flow/VehicleOpticalFlow.cpp#L291-L292
ekf2
https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/ekf2/EKF2.cpp#L2342-L2343


float32[3] delta_angle # (radians) accumulated gyro radians where a positive value is produced by a RH rotation about the body axis. Set to NaN if flow sensor does not have 3-axis gyro data.
float32[3] delta_angle # (radians) accumulated gyro radians where a negative value is produced by a RH rotation about the body axis. Set to NaN if flow sensor does not have 3-axis gyro data.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure about the delta angle? This should just be an integral of the gyro data so it should be positive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delta angle tracks pixel_flow
image

@@ -3,9 +3,9 @@ uint64 timestamp_sample

uint32 device_id # unique device ID for the sensor that does not change between power cycles

float32[2] pixel_flow # (radians) optical flow in radians where a positive value is produced by a RH rotation about the body axis
float32[2] pixel_flow # (radians) optical flow in radians where a negative value is produced by a RH rotation about the body axis
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
float32[2] pixel_flow # (radians) optical flow in radians where a negative value is produced by a RH rotation about the body axis
float32[2] pixel_flow # (radians) optical flow in radians where a positive value is produced by a RH rotation of the sensor about the body axis

EKF assumes positive LOS rate is produced by a RH rotation of the image about the sensor axis.

The opposite of this is a negative rotation of the image, or a positive rotation of the sensor. This message tells that a positive pixel flow is produces by a positive rotation of the sensor, which is correct (maybe just modify to the "RH rotation of the sensor about the body axis")

Copy link
Contributor Author

@dakejahl dakejahl Feb 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it were positive rotation wouldn't it have to be from the features perspective? From the sensors perspective (camera looking down) the drone moving forward causes the features to move backwards in the image (-X). This looks like the features are rotating in the negative direction around the Y axis (staying in FRD vehicle body frame of reference)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants