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

Prepare a conda-forge package for easier installation and use of urdf2casadi-matlab #16

Open
singhbal-baljinder opened this issue Jul 27, 2021 · 4 comments
Assignees

Comments

@singhbal-baljinder
Copy link
Collaborator

It would be nice to make urdf2casadi-matlab a conda package and make it available on conda-forge. An initial reference on how to contribute with new packages on conda-forge can be found in https://conda-forge.org/docs/maintainer/adding_pkgs.html.

@traversaro
Copy link
Member

I am not sure if conda-forge would accept a MATLAB package. Furthermore, this package would need to depend on casadi-matlab-bindings that is hosted on the robotology channel, so probably it could make sense to have urdf2casadi-matlab package as part of the robotology channel. We can probably just add urdf2casadi-matlab to the ROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS robotology-superbuild profile, this should give us for free the urdf2casadi-conda package.

@singhbal-baljinder
Copy link
Collaborator Author

Looking at the developers-faqs the general steps could be the following:

  • write a Build****.cmake file, maybe something like:
# Copyright (C) Fondazione Istituto Italiano di Tecnologia
# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT
include(YCMEPHelper)
include(FindOrBuildPackage)

find_or_build_package(idyntree-matlab-bindings QUIET)
find_or_build_package(casadi-matlab-bindings QUIET)


set(urdf2casadi-matlab_DEPENDS "")
list(APPEND urdf2casadi-matlab_DEPENDS idyntree-matlab-bindings)
list(APPEND urdf2casadi-matlab_DEPENDS casadi-matlab-bindings)

ycm_ep_helper(urdf2casadi-matlab TYPE GIT
              STYLE GITHUB
              REPOSITORY robotology/urdf2casadi-matlab.git
              TAG master
              FOLDER src
              DEPENDS ${urdf2casadi-matlab_DEPENDS})

@traversaro Let me know if I am missing something.

@traversaro
Copy link
Member

That is all correct, the only diffrence is that in the Build file you need to do:

if(ROBOTOLOGY_GENERATE_CONDA_RECIPES)
  find_or_build_package(idyntree-matlab-bindings QUIET)
else()
  find_or_build_package(iDynTree QUIET)
endif()
find_or_build_package(casadi-matlab-bindings QUIET)

set(urdf2casadi-matlab_DEPENDS "")
if(ROBOTOLOGY_GENERATE_CONDA_RECIPES)
  list(APPEND urdf2casadi-matlab_DEPENDS idyntree-matlab-bindings)
else()
  list(APPEND urdf2casadi-matlab_DEPENDS iDynTree)
endif()
list(APPEND urdf2casadi-matlab_DEPENDS casadi-matlab-bindings)

This is because the idyntree-matlab-bindings is a special package that is only existing when ROBOTOLOGY_GENERATE_CONDA_RECIPES is ON, see https://github.com/robotology/robotology-superbuild/blob/9a436af6b921278d0202bd56694725cb1da4cfb9/cmake/RobotologySuperbuildLogic.cmake#L40 .

@traversaro
Copy link
Member

traversaro commented Jul 27, 2021

Furthermore, it may be convenient if urdf2casadi-matlab installed its files in a MATLAB namespaces like +urdf2casadi or similar, to avoid polluting the MATLAB path with a lot of functions in the global namespace. However, this would probably imply that we need to review our code to add the namespace.

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

No branches or pull requests

2 participants