Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target has an offset when setting chain_length #4

Open
Flrefly opened this issue Nov 19, 2019 · 2 comments
Open

Target has an offset when setting chain_length #4

Flrefly opened this issue Nov 19, 2019 · 2 comments

Comments

@Flrefly
Copy link

Flrefly commented Nov 19, 2019

When I set the effector->chain_length to something smaller than number of nodes-2, the solution has a constant offset to my specified effector->target_position. And this offset gets bigger with smaller chain_lengths.

Am I doing something wrong or is this a bug?
I am using the latest master branch.

@Flrefly Flrefly changed the title Target has an offset when settingchain_length Target has an offset when setting chain_length Nov 19, 2019
@TheComet
Copy link
Owner

This does sound like a bug. Can you explain your setup a bit more in detail so I can try and reproduce it? Maybe even share relevant code?

@Flrefly
Copy link
Author

Flrefly commented Jan 20, 2020

project.zip

I uploaded the whole project in case the error is somewhere on my side. It's just a small project, where I tried to get familiar with your library. It creates a simple kinematic chain and the end-effector should follow the cursor position.

The relevant file is the KChain.cpp. I set up the solver in line 25-48 (the ik.init already happended in the Application constructor). The method solveIK (line 75-82) is called once per frame.

The effector->chain_length is set in line 42. If I delete this line or set it to number of joints or number of joints -1, everything works fine. The error occures when I set it to number of joints -2 or smaller (in the current example 4 or smaller).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants