Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

float type modelTpl fails when calling pinocchio::urdf::buildModel #2037

Closed
modu-robotics opened this issue Aug 19, 2023 · 1 comment
Closed

Comments

@modu-robotics
Copy link

Bug description

When I call buildModel<float> for ModelTpl<float> with a urdf file, the code has a compilation error saying:

error: no matching function for call to 'parseRootTree'
      details::parseRootTree(filename, visitor);
candidate function not viable: no known conversion from 'details::UrdfVisitor<float, 0, pinocchio::JointCollectionDefaultTpl>' to 'pinocchio::urdf::details::UrdfVisitorBase &' (aka 'UrdfVisitorBaseTpl<double, 0> &') for 2nd argument
      void PINOCCHIO_DLLAPI parseRootTree(const std::string & filename,

I think this is a bug since parseRootTree takes UrdfVisitorBase instead of UrdfVisitorBaseTpl.

Expected behavior

Create float type model and load urdf file.

Reproduction steps

Steps to reproduce the behavior:

 pinocchio::ModelTpl<float> model_f;
 pinocchio::urdf::buildModel<float>(urdf_file, model_f);

System

  • OS: [e.g. Mac]
  • Pinocchio version: Installed it from brew
@jcarpent
Copy link
Contributor

URDF parsers (urdfdom) only consider double types.
I would advise you to load using the ModelTpl type, and then cast it to float type using:

ModelTpl<double> model_double;
// load the model stored in model_double
ModelTpl<float> model_float = model_double.cast<float>();

@stack-of-tasks stack-of-tasks locked and limited conversation to collaborators Aug 19, 2023
@jcarpent jcarpent converted this issue into discussion #2038 Aug 19, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants