-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reimplement the python machinery to get the model location in pure py…
…thon - Remove the pybind11 dependency - Implement setup.py and setup.cfg to install the icub_models package
- Loading branch information
1 parent
fcdcc24
commit a8d5d01
Showing
9 changed files
with
91 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright (C) 2022 Istituto Italiano di Tecnologia (IIT). All rights reserved. | ||
# This software may be modified and distributed under the terms of the | ||
# Released under the terms of the BSD 3-Clause License | ||
|
||
[build-system] | ||
build-backend = "setuptools.build_meta" | ||
requires = [ | ||
"wheel", | ||
"setuptools>=45", | ||
"setuptools_scm[toml]>=6.0", | ||
] | ||
|
||
[tool.black] | ||
line-length = 88 | ||
|
||
[tool.isort] | ||
profile = "black" | ||
multi_line_output = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .icub_models import get_model_file, get_robot_names, get_models_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# @file icub_models.py | ||
# @authors Giulio Romualdi | ||
# @copyright 2022 Istituto Italiano di Tecnologia Released under the terms of the Creative Commons Attribution Share Alike 4.0 International | ||
|
||
from os import listdir | ||
from os.path import dirname, join, isdir, exists | ||
from typing import List | ||
|
||
|
||
def get_models_path() -> str: | ||
root = dirname(dirname(dirname(dirname(dirname(__file__))))) | ||
return join(root, 'share', 'icub_models', 'iCub', 'robots') | ||
|
||
def get_robot_names() -> List[str]: | ||
return listdir(get_models_path()) | ||
|
||
def get_model_file(robot_name: str) -> str: | ||
model_file = join(get_models_path(), robot_name, 'model.urdf') | ||
|
||
if exists(model_file): | ||
return model_file | ||
else: | ||
return '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright (C) 2022 Istituto Italiano di Tecnologia (IIT). All rights reserved. | ||
# This software may be modified and distributed under the terms of the | ||
# Released under the terms of the BSD 3-Clause License | ||
|
||
[metadata] | ||
name = icub_models | ||
description = Visualizer for robot logger | ||
author = 'Giulio Romualdi' | ||
author_email = 'giulio.romualdi@iit.it' | ||
license = Creative Commons Attribution Share Alike 4.0 International | ||
license_file = LICENSE | ||
url = /~https://github.com/robotolgy/icub-models | ||
version = 1.23.0 | ||
platforms = any | ||
|
||
keywords = | ||
robotics | ||
gazebo | ||
urdf | ||
ros | ||
icub | ||
gazebo-models | ||
gazebo-simulators | ||
|
||
[options] | ||
packages = find: | ||
python_requires = >=3.8 | ||
package_dir = | ||
= python | ||
|
||
[options.packages.find] | ||
where = python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright (C) 2022 Istituto Italiano di Tecnologia (IIT). All rights reserved. | ||
# This software may be modified and distributed under the terms of the | ||
# Released under the terms of the BSD 3-Clause License | ||
|
||
from setuptools import setup | ||
from glob import glob | ||
import os | ||
|
||
|
||
if __name__ == '__main__': | ||
|
||
all_files = glob('./iCub/**/*.*', recursive=True) | ||
data_files = [(os.path.join('share', 'icub_models', os.path.split(path)[0]), | ||
[os.path.join(os.path.split(path)[0], os.path.split(path)[1])]) | ||
for path in all_files] | ||
|
||
setup(data_files = data_files) |