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

[draft] switch wpical backend to gtsam #7606

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mcm001
Copy link
Contributor

@mcm001 mcm001 commented Dec 29, 2024

Draft MR switching the wpical backend from ceres to GTSAM via the photonvision thirdparty repo.

@github-actions github-actions bot added the component: wpimath Math library label Dec 29, 2024
@mcm001 mcm001 force-pushed the mmorley/wpical-gtsam branch from 18330e1 to 7385556 Compare December 29, 2024 17:22
@mcm001 mcm001 force-pushed the mmorley/wpical-gtsam branch from 7385556 to 6f2a99d Compare December 29, 2024 17:24
@mcm001 mcm001 force-pushed the mmorley/wpical-gtsam branch from 6f2a99d to d34b60f Compare December 29, 2024 17:35
Comment on lines +181 to +182
it.cppCompiler.args.add("-Wno-deprecated-copy")
it.cppCompiler.args.add("-Wno-redundant-move")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we should probably fix these upstream instead

Comment on lines 154 to 97
inline cameracalibration::CameraModel load_camera_model(wpi::json json_data) {
inline CameraModel load_camera_model(wpi::json json_data) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This function feels like it doesn't belong in fieldcalibration code?

struct Pose3WithVariance {
frc::Pose3d pose;
// in order rx ry rz tx ty tz. Units are SI units
std::array<double, 6> covariance;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

member is named covariance but holds variance? swap to cov


struct TagDetection {
int32_t id;
std::vector<TargetCorner> corners;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

always 4 corners - consider an array

return worldTtags;
}

static std::vector<Point3> MakeTagModel(double width) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

consider templating this

Comment on lines +28 to +31
// cv::Mat R;
// cv::Rodrigues(rvec, R); // R is 3x3
// R = R.t(); // rotation of inverse
// cv::Mat tvecI = -R * tvec; // translation of inverse
Copy link
Contributor Author

Choose a reason for hiding this comment

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

dead code

Copy link
Contributor

@Gold856 Gold856 left a comment

Choose a reason for hiding this comment

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

Since we're not in a rush for this, and I know you want some of calibration things in here, considering splitting wpical into app and lib directories like Glass, so you can have a libwpical you can pull in.

@mcm001
Copy link
Contributor Author

mcm001 commented Dec 29, 2024

I was trying to keep the diff small, but now that wpical is in main im less scared about merge conflicts unless @ElliotScher is planning a similar refactor already?

@ElliotScher
Copy link
Contributor

ElliotScher commented Dec 30, 2024

I wasn't planning on it yet, but I can if it would help.

@mcm001
Copy link
Contributor Author

mcm001 commented Dec 30, 2024

I don't think it would - I think it makes more sense here to swap out the bones and fight the build system, then we can think about other plans? The wpical docs PR going in and getting some user feedback post kickoff seem like plenty of work to me

@spacey-sooty

This comment was marked as outdated.

Signed-off-by: Jade Turner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants