forum.alglib.net

ALGLIB forum
It is currently Sun Dec 22, 2024 9:22 am

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: minlmoptimize invalid use
PostPosted: Fri Dec 14, 2018 9:35 am 
Offline

Joined: Fri Dec 14, 2018 9:20 am
Posts: 1
Dear all,

I'm trying to use the Levenberg Marquardt algorithm. If I compile, I get the error "invalid use of non-static member" in the line "minlmoptimize(state, problemMeasurementEquipmentPositon);". First thought, no problem, I make the method problemMeasurementEquipmentPositon(...) static. This would work, if the called methods within this method would be static too, but they aren't. I have never had such a problem and I don't know how to solve it. I would be very grateful if somebody could help. Thanks.

Code:
void RobotProblemSolver::solveMeasurementEquipment(){

        int equations=para.getNumberOfMeasurements()*3;

        real_1d_array x = "[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]";
        real_1d_array bndl = "[-1,-1,-1,-10,-1,-1,-1,-10,-1,-1,-1,-10,-0.1,-0.1,-0.1]";
        real_1d_array bndu = "[+1,+1,+1,+10,+1,+1,+1,+10,+1,+1,+1,+10,+0.1,+0.1,+0.1]";
        double epsx = 0.0000000001;
        ae_int_t maxits = 0;
        minlmstate state;
        minlmreport rep;

        minlmcreatev(equations, x, 0.0001, state);
        minlmsetbc(state, bndl, bndu);
        minlmsetcond(state, epsx, maxits);
        minlmoptimize(state, problemMeasurementEquipmentPositon);
        minlmresults(state, x, rep);

        Transformation t(x[0],x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10],x[11],0,0,0,1);

        std::cout << t.toString() << std::endl;
        std::cout << "Tool: "<<x[12]<<" "<<x[13]<<" "<<x[14]<<std::endl;


}

void RobotProblemSolver::problemMeasurementEquipmentPositon(const real_1d_array &x, real_1d_array &fi, void *ptr){

    double phi[6];
    double coordinates[3];
    Transformation pose;
    Transformation toolTrans(1,0,0,x[12],
                             0,1,0,x[13],
                             0,0,1,x[14],
                             0,0,0,1);
    Tool tool(toolTrans);

    for(int i=0; i<para.getNumberOfMeasurements(); i++){

        para.getMeasure(i,phi,coordinates);
        robotModel.directKinematics(phi,tool,pose);

        fi[i*3+0]=coordinates[0]*x[0]+coordinates[1]*x[1]+coordinates[2]*x[2]+x[3]-pose[3];
        fi[i*3+1]=coordinates[0]*x[4]+coordinates[1]*x[5]+coordinates[2]*x[6]+x[7]-pose[7];
        fi[i*3+2]=coordinates[0]*x[8]+coordinates[1]*x[9]+coordinates[2]*x[10]+x[11]-pose[11];
    }

}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 41 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group