errors for IK solver -- need help. Thanks

Hello,

I tried the example of the Inverse Kinematics solver ChainIkSolverPos_NR and make it work.

(1)The first problem is that if there is no calculation on Forward kinematics solver before I call IK solver, program will crush at iksolverpos.CartToJnt();

"Unhandled exception at 0x77c615de in KDL_Test3.exe: 0xC0000005: Access violation."

(2)The I tried to make some calculation on FK solver before I call IK solver. The problem above solved. I put IK example into a IKTest() function. When IKTest() function returns, program will crush.

"Unhandled exception at 0x77c615de in KDL_Test3.exe: 0xC0000005: Access violation reading location 0x0000008a."

What's wrong with it? How can this example do not work on my computer? windows 7 + visual studio 2008.

Thanks.

Leo Ma

ChainIkSolverVel_pinv caused the problem

I found the problem was caused by ChainIkSolverVel_pinv. I make a test as simple as the following -- IKtest2(). Only one ChainIkSolverVel_pinv is created. When this function returns, "Unhandled exception" happens in dbgheap.c at line 1260.

void IKtest2() {

    KDL::Chain chain;
    chain.addSegment(Segment(Joint(Joint::RotZ),Frame(Vector(0.0,0.0,1.020))));
    chain.addSegment(Segment(Joint(Joint::RotX),Frame(Vector(0.0,0.0,0.480))));
    chain.addSegment(Segment(Joint(Joint::RotX),Frame(Vector(0.0,0.0,0.645))));
    chain.addSegment(Segment(Joint(Joint::RotZ)));
    chain.addSegment(Segment(Joint(Joint::RotX),Frame(Vector(0.0,0.0,0.120))));
    chain.addSegment(Segment(Joint(Joint::RotZ)));

    ChainIkSolverVel_pinv iksolver1v(chain);//Inverse velocity solver

    return;
}

operating system is wondows 7 64 bits. The configuration of project is win32.

A little bit different when I add a ChainFkSolverPos_recursive

Actually it is part of the IK sample from KDL. Now when IKtest2 function returns, the "Unhandled exception" will happen in "free.c" line 109.

void IKtest2() {

    KDL::Chain chain;
    chain.addSegment(Segment(Joint(Joint::RotZ),Frame(Vector(0.0,0.0,1.020))));
    chain.addSegment(Segment(Joint(Joint::RotX),Frame(Vector(0.0,0.0,0.480))));
    chain.addSegment(Segment(Joint(Joint::RotX),Frame(Vector(0.0,0.0,0.645))));
    chain.addSegment(Segment(Joint(Joint::RotZ)));
    chain.addSegment(Segment(Joint(Joint::RotX),Frame(Vector(0.0,0.0,0.120))));
    chain.addSegment(Segment(Joint(Joint::RotZ)));

    ChainFkSolverPos_recursive fksolver1(chain);//Forward position solver
    ChainIkSolverVel_pinv iksolver1v(chain);//Inverse velocity solver

    return;
}

test environment is visual studio 2008.

A little bit different when I add a ChainFkSolverPos_recursive

Dear Leonard,

Actually it is part of the IK sample from KDL. Now when IKtest2 function
> returns, the "Unhandled exception" will happen in "free.c" line 109.
>
> void IKtest2()
> {
> KDL::Chain chain;
>
> chain.addSegment(Segment(Joint(Joint::RotZ),Frame(Vector(0.0,0.0,1.020))));
>
> chain.addSegment(Segment(Joint(Joint::RotX),Frame(Vector(0.0,0.0,0.480))));
>
> chain.addSegment(Segment(Joint(Joint::RotX),Frame(Vector(0.0,0.0,0.645))));
> chain.addSegment(Segment(Joint(Joint::RotZ)));
>
> chain.addSegment(Segment(Joint(Joint::RotX),Frame(Vector(0.0,0.0,0.120))));
> chain.addSegment(Segment(Joint(Joint::RotZ)));
>
> ChainFkSolverPos_recursive fksolver1(chain);//Forward position
> solver
> ChainIkSolverVel_pinv iksolver1v(chain);//Inverse velocity solver
>
> return;
> }
>
> test environment is visual studio 2008.
>
I tried your IKtest2 function, and my test program run just fine. (No
unhandled exceptions, no core dumps...)..I also checked in case of memory
leaks, the following is the result:

==5472== HEAP SUMMARY:
> ==5472== in use at exit: 0 bytes in 0 blocks
> ==5472== total heap usage: 56 allocs, 56 frees, 30,330 bytes allocated
> ==5472==
> ==5472== All heap blocks were freed -- no leaks are possible
> ==5472==
> ==5472== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)
> --5472--
> --5472-- used_suppression: 2 dl-hack3-cond-1
> ==5472==
> ==5472== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)

I compiled the test program using both gcc (4.6.1 and 4.8.1) and clang
(3.0) on Ubuntu 12.04
I can be wrong, but with the information that you reported, it looks like
the problem is on your system toolchain (win+visual_studio+MS compiler...)
Did you tried to change compiler?

Regards,
- Enea

I have to use windows as operating system.

Do you have any suggestion on changing my tool chain? for example, other compiler. Thanks.

Best regards,

Leo

I have to use windows as operating system.

Hi Leo,

On Wed, Aug 28, 2013 at 5:22 PM, <leonard [dot] kdl [..] ...> wrote:

> Do you have any suggestion on changing my tool chain? for example, other
> compiler. Thanks.
>

For windows, we only have these instructions:
http://www.orocos.org/wiki/rtt/rtt-ms-windows

But afaikt, the full toolchain is not supported, only RTT + OCL.

Peter

I think so

Thanks.

Actually the problem happened in "free.c" which is a file from Microsoft. It seems like it is a compatible issue between KDL and Windows.

I did not try to change my toolchain yet. The problem is that my software has to run on Windows.

Sorry. the comments above are not clear

I tried the example of the Inverse Kinematics solver ChainIkSolverPos_NR and make it work.

(1)The first problem is that if there is no calculation on Forward kinematics solver before I call IK solver, program will crush at iksolverpos.CartToJnt();

"Unhandled exception at 0x77c615de in KDL_Test3.exe: 0xC0000005: Access violation."

Then I tried to make some calculation on FK solver before I call IK solver. The problem above solved. I don't know if this is solution.

(2) I put IK example into a IKTest() function. Now after the IK calculation, the result seems correct. When IKTest() function returns, again , program will crush.

"Unhandled exception at 0x77c615de in KDL_Test3.exe: 0xC0000005: Access violation reading location 0x0000008a."

What's wrong with it? How can this example do not work on my computer? windows 7 + visual studio 2008.

Thanks.