Skip to content

CRA#69

Draft
lsakunes wants to merge 14 commits intomainfrom
CRA
Draft

CRA#69
lsakunes wants to merge 14 commits intomainfrom
CRA

Conversation

@lsakunes
Copy link
Copy Markdown

@lsakunes lsakunes commented Mar 7, 2026

Description

A straightforward CRA implementation that assumes TLS and Eigen (the one with camera stuff) have been merged to main

Artifacts for PR #69 (DO NOT CHANGE)

@lsakunes lsakunes marked this pull request as draft March 7, 2026 23:27
Comment thread src/distance/distance.cpp
int pointsSize = p.size();
Eigen::Matrix<decimal, Eigen::Dynamic, 4> normalizedVecsToHorizonMat;
for (int i = 0; i < pointsSize; i++) {
Vec3 pBar = {p[i].x(), p[i].y(), 1};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

try using pixelToImageCoordinates

Comment thread src/distance/distance.cpp
for (int i = 0; i < pointsSize; i++) {
Vec3 pBar = {p[i].x(), p[i].y(), 1};
Vec3 normalizedVecToHorizon = (imageToSpace * pBar).normalized();
for (int j = 0; j < 3; j++){
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

try using Eigen's built in arrays

#include <iostream>
#include <Eigen/Dense>
#include <vector>

int main() {
    int n = 5; // Number of vectors

    // 1. Initialize a 3xn matrix (3 rows, Dynamic columns)
    Eigen::Matrix3Xd matrix = Eigen::Matrix3Xd::Zero(3, n);

    // 2. Loop to add 3D vectors
    for (int i = 0; i < n; ++i) {
        // Create a temporary 3D vector
        Eigen::Vector3d vec(i, i * 2.0, i * 3.0);
        
        // Assign the vector to the i-th column
        matrix.col(i) = vec;
    }

    std::cout << "Populated Matrix:\n" << matrix << std::endl;

    return 0;
}

Comment thread src/distance/distance.cpp
Mat3 imageToSpace = DiagInvAxes * TPC_.transpose() * cam_.GetInverseCalibrationMatrix();

int pointsSize = p.size();
Eigen::Matrix<decimal, Eigen::Dynamic, 4> normalizedVecsToHorizonMat;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

don't use dynamic we know the size it is p.size()

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