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

Missing is/asPrismaticJoint in bindings #881

Closed
Nicogene opened this issue Jul 5, 2021 · 1 comment · Fixed by #882
Closed

Missing is/asPrismaticJoint in bindings #881

Nicogene opened this issue Jul 5, 2021 · 1 comment · Fixed by #882

Comments

@Nicogene
Copy link
Member

Nicogene commented Jul 5, 2021

It is possible to get the handle of the RevoluteJoint and FixedJoint using the (python) bindings thanks to

bool isRevoluteJoint() const
{
const iDynTree::RevoluteJoint * p =
dynamic_cast<const iDynTree::RevoluteJoint*>($self);
return (p != 0);
}
bool isFixedJoint() const
{
const iDynTree::FixedJoint * p =
dynamic_cast<const iDynTree::FixedJoint*>($self);
return (p != 0);
}
iDynTree::RevoluteJoint * asRevoluteJoint()
{
iDynTree::RevoluteJoint * p =
static_cast<iDynTree::RevoluteJoint*>($self);
return p;
}
iDynTree::FixedJoint * asFixedJoint()
{
iDynTree::FixedJoint * p =
static_cast<iDynTree::FixedJoint*>($self);
return p;
}

It would be nice if these can be extended to other types of joints, in particular I would be like to have is/asPrismaticJoint

@traversaro
Copy link
Member

It should be sufficient to add the code similar to the revolute one for the other types, feel free to open a PR, thanks!

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

Successfully merging a pull request may close this issue.

2 participants