-
Notifications
You must be signed in to change notification settings - Fork 26
Add add_cost method in the inverse kinematics
#130
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds extensibility features to the inverse kinematics solver by introducing methods to retrieve optimization variables and add custom cost terms. The changes also include a precomputed homogeneous transformation matrix for the base.
- Addition of
get_opti_variables()method to expose optimization variables to users - Implementation of
add_cost()method for adding custom cost terms to the optimization problem - Precomputation of base homogeneous transformation matrix from position and quaternion
| - "base_pos": Position of the base (3D vector). | ||
| - "base_quat": Quaternion representing the base orientation (4D vector with x, y, z, w). | ||
| - "joint_var": Joint variables (1D vector with length equal to the number of joints). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not remember how fixed joints are handled in adam, but I am not sure if this sentence is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I am not sure about the "joint variables" name. Perhaps "joint positions" is more clear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right! Done in 8e9caef
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
If @traversaro is fine I think we can merge it |
|
Thanks @traversaro and @GiulioRomualdi! :) |
This pull request enhances the inverse kinematics solver in
src/adam/casadi/inverse_kinematics.pyby introducing new features and improving code clarity. The key changes include the addition of a homogeneous transformation matrix for the base, a new method to retrieve optimization variables, and functionality to add custom cost terms to the optimization problem.New features:
Homogeneous transformation matrix:
self.base_homogeneous, which computes the homogeneous transformation matrix of the base using its position and quaternion. ([src/adam/casadi/inverse_kinematics.pyR64-R66](https://github.com/gbionics/adam/pull/130/files#diff-92636529c4bff705bc52b6921d13c06319f84c74610c40fc35d376e6a589d8a7R64-R66))Retrieve optimization variables:
get_opti_variablesmethod, which returns a dictionary of all optimization variables, including the new homogeneous transformation matrix. ([src/adam/casadi/inverse_kinematics.pyR88-R106](https://github.com/gbionics/adam/pull/130/files#diff-92636529c4bff705bc52b6921d13c06319f84c74610c40fc35d376e6a589d8a7R88-R106))Custom cost terms:
add_costmethod to allow users to add custom cost terms to the optimization problem, enhancing flexibility. ([src/adam/casadi/inverse_kinematics.pyR581-R589](https://github.com/gbionics/adam/pull/130/files#diff-92636529c4bff705bc52b6921d13c06319f84c74610c40fc35d376e6a589d8a7R581-R589))📚 Documentation preview 📚: https://adam-docs--130.org.readthedocs.build/en/130/