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

Some js errors in posit1.js #6

Closed
jeromeetienne opened this issue Apr 9, 2015 · 1 comment
Closed

Some js errors in posit1.js #6

jeromeetienne opened this issue Apr 9, 2015 · 1 comment
Assignees
Labels

Comments

@jeromeetienne
Copy link

Hi

Im playing with js-aruco, it is a lot of fun

Nevertheless i often get an js exception as error1 and error2 being undefined in line 118. it seems to occurs randomly when i move the marker in front of the camera. it occurs even with your debug.html.
i know this is old code, but it gained popularity with the gogglepaper.com stuff :)

Any hint on how to fix it ?

from https://github.com/jcmellado/js-aruco/blob/master/src/posit1.js#L118

  return error1.euclidean < error2.euclidean?
    new POS.Pose(error1.pixels, rotation1, translation1, error2.pixels, rotation2, translation2):
    new POS.Pose(error2.pixels, rotation2, translation2, error1.pixels, rotation1, translation1);
};
@jcmellado jcmellado added the bug label Apr 9, 2015
@jcmellado
Copy link
Owner

Ok, it took me a lot of time, but here is:
Uncaught TypeError: Cannot read property 'euclidean' of undefined - posit1.js:119

Looking at the code, I think that the issue happens when the iterative POSIT algorithm (used to estimate the pose of the camera) converges before the first iteration:

  var error;
  ...
  while( iteration ++ < 100 && !converged ){
    ...
    // bla, bla, ... error = some value (never reached)
    ...
  }
  return error; // <= undefined

I'll try to fix it.

In the meantime, you should try with the second POSIT algorithm (posit2.js) already included with the library. Just change this import: <script type="text/javascript" src="posit1.js"> to ..."posit2.js">

@jcmellado jcmellado self-assigned this Apr 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants