LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using non linear unconstrained optimizers

Hi,

 

I am having an issue using the uncontrained optimization vi. I have used the template for the objective function provided but I can't seem to get it to work. My error message says "LabVIEW:  An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @."

 

My application is to find an optimum set of quaternion parameters which describe a rotation between 2 vectors. The vector in this case contains six elements as there are 2 vectors (1 each from individual sensors). To begin with, the obj funciton should be equal to zero (no rotation) and I input the correct quaternion describing this into the optimizer (hence solution is already a minimum??).

 

But when I run it, the control within the obj function describing the quaterion parameters is NaN and not what I wire to the "Start" input.

 

Does anyone know what is going on and is able to help me?

 

Thanks very much,

Tom

(code is attached)

0 Kudos
Message 1 of 5
(2,512 Views)

Hi tlin067,

 

I am having so trouble running the code you sent. It appears I am missing Quaternion to Rotation Matrix.vi. Could you resend the code and make sure all the subvi's are included. 

 

Thanks,

 

Josh Brown

Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(2,483 Views)

HI Josh,

 

Thanks for the reply. That vi is part of the robotics toolbox. That may mean you are unable to help me?

 

Cheers,

Tom

0 Kudos
Message 3 of 5
(2,478 Views)

Hey Tom,

 

I am going to install the robotics toolbox and take another look at your code. I will get back to you when I have something.

 

Josh Brown

Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(2,469 Views)

Hey Tom,

 

So I installed the robotics kit and was able to recreate your error. I think I have figured out were it is actually happening. In your main vi open the Unconstrained Optimization. Then within this vi open Armijo rule stepsize reduction. Then within this open unco_function and gradient. Then open the call object fuction.vi. The error appears to taking place at the reference node within this vi. My computer was giving me the following error: call by reference node in NI_Gmath.lvlib:ucno_call objective funtion.vi:28. I believe this is the root of your problem so try to figure out what is going on with the reference node. I hope this helps.

 

Josh Brown

Applications Engineer
National Instruments
0 Kudos
Message 5 of 5
(2,454 Views)