-
Notifications
You must be signed in to change notification settings - Fork 3
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
Pose Estimation with Limelight #36
base: predcmp
Are you sure you want to change the base?
Conversation
} | ||
|
||
fun Pose3d.closerToInTranslation(pose1: Pose3d, pose2: Pose3d): Pose3d { | ||
val distToPose1 = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(this - pose1).translation.norm
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or (this.translation - pose1.translation).norm
return Pose3d(this.x, this.y, 0.0.meters, Rotation3d(0.0.degrees, 0.0.degrees, this.rotation)) | ||
} | ||
|
||
fun Angle.rotateBy(angle: Angle): Angle { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the difference between this and just adding two angles?
cameraTransform: Transform3d, | ||
targetHeight: Length | ||
): Pose3d { | ||
val horizontalAngleFromRobot = tx + cameraTransform.rotation.x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is cleaner to do all of the math from the camera's perspective then rotate by the camera transform in the end.
Also, tx
and rotation about x
are not describing the same thing (tx
is rotation about Z I think because it is describing how far in the horizontal FOV the blob is)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also make sure your sign convention is what WPILib uses -- is limelight tx
positive in the direction you expect?
val rotationFromTargetToRobot = | ||
Rotation3d(0.0.degrees, verticalAngleFromRobot, horizontalAngleFromRobot) | ||
|
||
val xDistanceFromTargetToRobot = (targetHeight - cameraTransform.x) / verticalAngleFromRobot.tan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cameraTransform.z
?
|
||
return currentPose | ||
.toPose3d() | ||
.transformBy(cameraTransform) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do this if we already ended up in the robot coordinate frame earlier?
is it literally just an if statement this feels stupidly easy
No description provided.