Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

Cannot perform cross product on 3D vectors #6

@dbecker59

Description

@dbecker59

I'm about to start a project that'll need eigen and this was the only library that even remotely worked, but I've found that the 3D cros product doesn't work. Here's an example sketch:

`/*
Name: Arduino_Device_Application.ino
Created: 12/7/2023 3:15:25 AM
Author: danie
*/

// the setup function runs once when you press reset or power the board

#include <EigenAVR.h>
#include <Eigen30.h>

void setup() {
Serial.begin(115200);
}

// the loop function runs over and over again until power down or reset
void loop() {
Serial.print("\n Length: ");
Serial.print(Eigen::Vector3f({ 1, 0, 0 }).cross(Eigen::Vector3f({ 0, 1, 0 }))(2));
delay(1000);
}`

which when I build, gives the following output

`Compiling 'Arduino_Device_Application' for 'Arduino Due (Programming Port) (arduino_due_x_dbg)'
Build Folder: "file:///C:/Users/******/AppData/Local/Temp/VMBuilds/Arduino_Device_Application/arduino_due_x_dbg/Release"

Arduino_Device_Application.cpp.o: In function loop

Error linking for board Arduino Due (Programming Port) (arduino_due_x_dbg)
Build failed for project 'Arduino_Device_Application'
Arduino_Device_Application.ino:19: undefined reference to Eigen Matrix<float, 3, 1, 0, 3, 1> Eigen MatrixBase<Eigen Matrix<float, 3, 1, 0, 3, 1> > cross3<Eigen Matrix<float, 3, 1, 0, 3, 1> >(Eigen MatrixBase<Eigen Matrix<float, 3, 1, 0, 3, 1> > const&) const

collect2.exe*: error: ld returned 1 exit status
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions