Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Questions regarding Niryo Ned2 SolveIK_All using C++ API

#1
Hello, I am using RoboDk with the C++ API.

I want to simulate and check accessibility for a Niryo Ned2 robot.

When using ned2 in the RoboDK environment, if I use the rotary button to move the Ned2 along X, Y or Z axis  or Rx, Ry, Rz there is no problem the ned2 is moving correctly in the right direction.

So I guess the IK behind the rotary button is working fine.

But... now I would like to use the IK from C++ API.
From my code I am calling SolveIK_All like this:

 itm->SolveIK_All(pose, &tool);
pose is the pose to reach and tool the current tcp pose.

Even if the pose is accessible, sometimes I got some results ans sometimes not.

But... when SolveIK_All works and gives me joints solution, the joints I get from the function are definitely not corresponding to the requested pose.

As I had doubts about the rotation convention used and my own code transcription of these conventions (ned2 is supposed to be ZYX but defined as XYZ in robodk, easy to manage convention switch in code but an error is always possible) I tried "  itm->SolveIK_All(tool, &tool); ".
In other words : "give me the joints value of the current position"

I expected to get at least one solution corresponding to the current configuration of the ned2.

But SolveIK_All(tool, &tool) gave me no solution....

I am probably doing something wrong, but I do not know where is my mistake.
But perhaps also the solveIK_All called from the API is not the same as the one called from robodk interface...
Because this ned2 setup is just a replication of a kuka setup, and the kuka setup is working fine through the same c++ api...

Well... I need help, I made tons of tests, checked several times my calculation for rotation convention etc.... and I'm still stuck in the tunnel with no light in sight... except you :-)
#2
The SolveIK, SolveFK and SolveIK_All functions use the robot flange and robot base by default. You specified the tool but you should also specify the coordinate system you are using with your pose.

Another option is to rely on the SolveFK for the current robot solution and apply an offset from there.

For example, if you want to apply a delta pose offset along the Z axis you could do something like this:
Code:
tJoints joints = robot->Joints();
Mat pose = robot->SolveFK(joints) * pose_tool;
Mat pose_offset = pose * transl(0,0,10);
joints2 = robot->SolveIK(pose_offset, &pose_tool);
  




Users browsing this thread:
1 Guest(s)