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

Add Human inverse kinematic class #15

Merged
merged 40 commits into from
Jan 9, 2024
Merged

Add Human inverse kinematic class #15

merged 40 commits into from
Jan 9, 2024

Conversation

davidegorbani
Copy link
Collaborator

@davidegorbani davidegorbani commented Dec 1, 2023

This PR aims to create a first skeleton of the class HumanIK that has to compute the inverse kinematics of the human.

@davidegorbani davidegorbani self-assigned this Dec 1, 2023
@davidegorbani davidegorbani changed the title Add inverse kinematic Add Human inverse kinematic class Dec 1, 2023
@davidegorbani davidegorbani added the enhancement New feature or request label Dec 4, 2023
@davidegorbani davidegorbani marked this pull request as ready for review December 6, 2023 11:10
@GiulioRomualdi
Copy link
Member

Hi @davidegorbani if the pr is ready for review I can take it a look

@davidegorbani
Copy link
Collaborator Author

Yes, I have also started adding the task relative to the SO(3) task.

ci_env.yml Outdated
name: biomechanical-analysis-framework
channels:
- conda-forge
- robotology
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems all the packages you use are from the conda-forge channel, we can probably remove this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed!

ci_env.yml Outdated
- robotology
dependencies:
- cmake
- clangxx>=14.0.0
Copy link
Contributor

@traversaro traversaro Dec 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We tipically use the compilers meta package to get the compiler, do you have any need specifically for clang?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it was already there so I left it.

Comment on lines 43 to 49
# Print the environment variables to simplify development and debugging
# Use conda for main dependencies
- uses: conda-incubator/setup-miniconda@v2
if: matrix.os == 'ubuntu-latest'
with:
miniforge-variant: Mambaforge
miniforge-version: latest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can use setup-micromamba for both, if we need to install anything else I think we can do that via micromamba install instead of mamba install .

.github/workflows/ci.yml Outdated Show resolved Hide resolved
src/IK/src/InverseKinematics.cpp Outdated Show resolved Hide resolved
src/IK/src/InverseKinematics.cpp Outdated Show resolved Hide resolved
src/IK/src/InverseKinematics.cpp Outdated Show resolved Hide resolved
Copy link
Member

@lrapetti lrapetti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me we can proceed merging. I don't know if also @GiulioRomualdi is planning to review the PR, or if @traversaro has further comments. Otherwise we can proceed merging.

@davidegorbani
Copy link
Collaborator Author

Ok, I will wait before merging.

Comment on lines 61 to 63
public:
HumanIK(){}; // constructor
~HumanIK(){}; // destructor
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would document the code using doxygen format. Similar to the one in bipedal locomotion framework. This will can be used to automatically generate the documentation

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will do it!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/IK/src/InverseKinematics.cpp Outdated Show resolved Hide resolved
Comment on lines 68 to 71
double HumanIK::getDt() const
{
return m_dtIntegration.count();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be returned in nanoseconds. Is this wanted?

Copy link
Collaborator Author

@davidegorbani davidegorbani Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, probably it is better to return the dt in seconds.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it and now it returns the value in seconds.

src/IK/src/InverseKinematics.cpp Outdated Show resolved Hide resolved
Comment on lines 145 to 150
bool HumanIK::getJointVelocities(Eigen::Ref<Eigen::VectorXd> jointVelocities) const
{
jointVelocities = m_jointVelocities;

return true;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should check if the size of jointVelocities is correct

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done it.

@GiulioRomualdi
Copy link
Member

Thank you @davidegorbani! Feel free to merge it :)

@davidegorbani
Copy link
Collaborator Author

Thank you! Merging!

@davidegorbani davidegorbani merged commit f4cb926 into main Jan 9, 2024
6 checks passed
@davidegorbani davidegorbani deleted the add_IK branch January 9, 2024 12:55
@DanielePucci
Copy link
Member

Super! @ami-iit/ifeel @ami-iit/ergocub

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

Successfully merging this pull request may close these issues.

5 participants