question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not position but Orientation for IK solver

See original GitHub issue

I tested your library, pretty decent by selecting active joints. However your library minimize its IK solver error by position not by its Orientation. In other words it solves for the Position of the Homo. Transformation Matrix and after that it checks orientation.

How I can solve for orientation as priority?

As I see in the code:

    def optimize_target(x):
        # y = np.append(starting_nodes_angles[:chain.first_active_joint], x)
        y = chain.active_to_full(x, starting_nodes_angles)
        squared_distance = np.linalg.norm(chain.forward_kinematics(y)[:3, -1] - target)
        return squared_distance

This section is specified for target which is position. Any suggestion for Orientation?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
AhmetMericOzcancommented, Aug 22, 2019

Hello for all faces same problem as me, I found the solution by changing optimization function for orientatition priority. I changed he code as follows:

    # Only get the orientation
    target = target_frame[:-1, 0:3]

    if starting_nodes_angles is None:
        raise ValueError("starting_nodes_angles must be specified")

    # Compute orientation difference
    def optimize_target(x):
        # y = np.append(starting_nodes_angles[:chain.first_active_joint], x)
        y = chain.active_to_full(x, starting_nodes_angles)
        squared_distance = np.linalg.norm(chain.forward_kinematics(y)[:-1, 0:3] - target)
        return squared_distance

With these lines you can use it for orientation too. In this code I cut the rotation matrix from HM and I optimized the code through the difference of target rotation and current rotation. I believe this is how I did it at least 😃

It worked now my local library uses this orientation matrix but not the position. Perfect! Cheers

2reactions
AhmetMericOzcancommented, Aug 23, 2019

Ok mate, Did you understand the logic behind my code? how Itry to decrease the error for orientation? You should do the same for position amd orientation!! Mate check how I cut the HT matrix. I cut it from only rotational Matrix in other words 3×3 Matrix. other 3×1 matrix is position. If you cut the target as 3×4 matrix with out the last line, you can make the error function for your orientation and position together. It is simple try it yourself maybe it xan solve yoyr problem.

More over even if doesnt, try to make the error function depended to the position and orientation together. I believe it can solve your problems. Just try a little

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solving Inverse Kinematics with unknown orientation
My current approach has been to use DH-parameters to solve for each angle. This works, assuming I know the orientation of the end...
Read more >
Chapter 6. Inverse kinematics
In this problem the target is not just to reach a single point (xD,yD,zD) in space, but also a desired tool orientation RD∈...
Read more >
Inverse Kinematics | ROS Robotics
Under-actuated manipulator can reach a target position but it may not achieve the target orientation within the workspace. ​. Fully Actuated Manipulators:.
Read more >
Moveit Inverse Kinematics Solver not working properly
The other two commands only set the position or orientation. Everytime one is called, all other goals are removed. Below is the script...
Read more >
Rotate Plane IK solver - Maya - Autodesk Knowledge Network
... the rotate plane solver to calculate the rotations of all the joints in its IK chain, but not the joint chain's overall...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found