-
Notifications
You must be signed in to change notification settings - Fork 222
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
Inverse kinematics. Currrent state of the arm not taken into account to compute the solution? #58
Comments
The iterative IK algorithms start with the current configuration specified via setPosition() in the given rl::mdl::Kinematic model. They will retry from a randomly generated configuration in case they get stuck until the duration or iteration limit is reached. You can influence this by setting duration and iterations to zero. NloptInverseKinematics also allows to set upper/lower bounds to limit the search to a given section of the configuration space, e.g., the joint ranges suitable for your task similar to "left/right", "elbow up/down" in analytical IKs. |
Still the same results. This is my code, am I doing something wrong?
|
Even with an initial guess provided via For If you only want to find solutions that can be reached via a direct inverse/transpose Jacobian iteration from your initial guess, you can use Please make sure to check the value of |
Then, what is the point of having an initial guess? If there is an option to give an initial guess it's because you want to have the closest solution to this initial guess, if you randomly look for a solution giving an initial guess is pointless. I would suggest you work a little bit on this inverse kinematics function. It would be very useful to have a solution near the initial guess to use it for trajectory interpolations. By the way, these Going back to my problem, moving the end-effector only 2mm in the x-direction I get these two joint configurations: Is there a way to have closer results or should I start looking for another library? |
The initial guess is the starting value for the iterative solvers and the solutions adhere to the specified boundary conditions. In particular for NLopt's SLSQP, you can only influence the mentioned parameters and tolerances. The random restarts are only performed in case the solvers fail and the alternative would be to return no solution. If the Jacobian solver cannot find a solution from the initial guess without restart, the target pose likely requires a different joint configuration and a straight-line interpolation is not possible due to singularities or joint limits. Adding a parameter to the iterative solvers that defines the number of random restarts is certainly possible. The For trajectory interpolation I would recommend to directly use the Jacobian matrix inverse similar to how JacobianInverseKinematics works so you can decide how to handle moving through singularities and control velocity and acceleration values. |
Trajectory interpolation is a commonly used function that many people may need. Could you provide an example? |
I'm using this library for a 7 DOF arm. When I compute the inverse kinematics the solution obtained is correct. The problem occurs when I compute ik for a pose near the current one, the solution is normally very far at joint space, i.e. the joint angles are very different from the current ones. This happens always and it's not related to a singular position. Am I right and the algorithm is not taking into account the current state of the arm? If it is implemented, why am I getting these results? this happens with JacobianInverseKinematics and NloptInverseKinematics methods.
The text was updated successfully, but these errors were encountered: