rod 0.3.5.dev8__tar.gz → 0.3.5.dev14__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/.pre-commit-config.yaml +2 -2
  2. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/PKG-INFO +19 -1
  3. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/README.md +18 -0
  4. rod-0.3.5.dev14/src/rod/__main__.py +115 -0
  5. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod.egg-info/PKG-INFO +19 -1
  6. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod.egg-info/SOURCES.txt +1 -0
  7. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/.gitattributes +0 -0
  8. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/.github/CODEOWNERS +0 -0
  9. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/.github/workflows/ci_cd.yml +0 -0
  10. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/.gitignore +0 -0
  11. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/LICENSE +0 -0
  12. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/pixi.lock +0 -0
  13. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/pyproject.toml +0 -0
  14. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/setup.cfg +0 -0
  15. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/setup.py +0 -0
  16. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/__init__.py +0 -0
  17. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/builder/__init__.py +0 -0
  18. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/builder/primitive_builder.py +0 -0
  19. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/builder/primitives.py +0 -0
  20. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/kinematics/__init__.py +0 -0
  21. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/kinematics/kinematic_tree.py +0 -0
  22. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/kinematics/tree_transforms.py +0 -0
  23. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/logging.py +0 -0
  24. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/pretty_printer.py +0 -0
  25. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/sdf/__init__.py +0 -0
  26. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/sdf/collision.py +0 -0
  27. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/sdf/common.py +0 -0
  28. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/sdf/element.py +0 -0
  29. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/sdf/geometry.py +0 -0
  30. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/sdf/joint.py +0 -0
  31. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/sdf/link.py +0 -0
  32. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/sdf/material.py +0 -0
  33. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/sdf/model.py +0 -0
  34. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/sdf/physics.py +0 -0
  35. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/sdf/scene.py +0 -0
  36. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/sdf/sdf.py +0 -0
  37. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/sdf/visual.py +0 -0
  38. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/sdf/world.py +0 -0
  39. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/tree/__init__.py +0 -0
  40. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/tree/directed_tree.py +0 -0
  41. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/tree/tree_elements.py +0 -0
  42. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/urdf/__init__.py +0 -0
  43. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/urdf/exporter.py +0 -0
  44. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/utils/__init__.py +0 -0
  45. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/utils/frame_convention.py +0 -0
  46. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/utils/gazebo.py +0 -0
  47. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/utils/resolve_frames.py +0 -0
  48. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod/utils/resolve_uris.py +0 -0
  49. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod.egg-info/dependency_links.txt +0 -0
  50. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod.egg-info/requires.txt +0 -0
  51. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/src/rod.egg-info/top_level.txt +0 -0
  52. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/tests/test_meshbuilder.py +0 -0
  53. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/tests/test_urdf_exporter.py +0 -0
  54. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/tests/test_urdf_parsing.py +0 -0
  55. {rod-0.3.5.dev8 → rod-0.3.5.dev14}/tests/utils_models.py +0 -0
@@ -17,7 +17,7 @@ repos:
17
17
  - id: trailing-whitespace
18
18
 
19
19
  - repo: https://github.com/psf/black-pre-commit-mirror
20
- rev: 24.8.0
20
+ rev: 24.10.0
21
21
  hooks:
22
22
  - id: black
23
23
  args: ["--check", "--diff"]
@@ -29,6 +29,6 @@ repos:
29
29
  args: ["--check", "--diff"]
30
30
 
31
31
  - repo: https://github.com/astral-sh/ruff-pre-commit
32
- rev: v0.6.9
32
+ rev: v0.8.6
33
33
  hooks:
34
34
  - id: ruff
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rod
3
- Version: 0.3.5.dev8
3
+ Version: 0.3.5.dev14
4
4
  Summary: The ultimate Python tool for RObot Descriptions processing.
5
5
  Author-email: Diego Ferigo <dgferigo@gmail.com>
6
6
  Maintainer-email: Filippo Luca Ferretti <filippo.ferretti@iit.it>, Carlotta Sartore <carlotta.sartore@iit.it>
@@ -334,6 +334,24 @@ print(urdf_string)
334
334
 
335
335
  </details>
336
336
 
337
+ ## Command Line Interface
338
+
339
+ ROD provides a command line interface (CLI) for processing robot description files. You can use the CLI to display file attributes or convert files between URDF and SDF formats.
340
+
341
+ ### Usage
342
+
343
+ - Display the attributes of an SDF file:
344
+
345
+ ```sh
346
+ rod --file /path/to/file.sdf --show
347
+ ```
348
+
349
+ - Convert an SDF file to URDF:
350
+
351
+ ```sh
352
+ rod --file /path/to/file.sdf -o /path/to/file.urdf
353
+ ```
354
+
337
355
  ## Similar projects
338
356
 
339
357
  - https://github.com/gazebosim/sdformat
@@ -252,6 +252,24 @@ print(urdf_string)
252
252
 
253
253
  </details>
254
254
 
255
+ ## Command Line Interface
256
+
257
+ ROD provides a command line interface (CLI) for processing robot description files. You can use the CLI to display file attributes or convert files between URDF and SDF formats.
258
+
259
+ ### Usage
260
+
261
+ - Display the attributes of an SDF file:
262
+
263
+ ```sh
264
+ rod --file /path/to/file.sdf --show
265
+ ```
266
+
267
+ - Convert an SDF file to URDF:
268
+
269
+ ```sh
270
+ rod --file /path/to/file.sdf -o /path/to/file.urdf
271
+ ```
272
+
255
273
  ## Similar projects
256
274
 
257
275
  - https://github.com/gazebosim/sdformat
@@ -0,0 +1,115 @@
1
+ import argparse
2
+ import importlib.metadata
3
+ import logging
4
+ import sys
5
+
6
+ from rod import logging as rodlogging
7
+
8
+
9
+ def main() -> None:
10
+ """
11
+ Main function of the ROD command line interface.
12
+ """
13
+ parser = argparse.ArgumentParser(
14
+ prog="rod",
15
+ description="ROD: The ultimate Python tool for RObot Descriptions processing.",
16
+ usage="%(prog)s [options] file",
17
+ )
18
+
19
+ # Version.
20
+ parser.add_argument(
21
+ "-V",
22
+ "--version",
23
+ action="version",
24
+ version=f"%(prog)s {importlib.metadata.version('rod')}",
25
+ )
26
+
27
+ # Verbose output.
28
+ parser.add_argument(
29
+ "-vv",
30
+ "--verbose",
31
+ action="store_true",
32
+ help="enable verbose output.",
33
+ )
34
+
35
+ # File to parse.
36
+ parser.add_argument(
37
+ "-f",
38
+ "--file",
39
+ type=str,
40
+ help="path to the file to parse.",
41
+ required=False,
42
+ )
43
+
44
+ # Option to display the parser file attributes.
45
+ parser.add_argument(
46
+ "-s",
47
+ "--show",
48
+ action="store_true",
49
+ help="show the robot model attributes.",
50
+ )
51
+
52
+ # Option to output a URDF or SDF file.
53
+ parser.add_argument(
54
+ "-o",
55
+ "--output",
56
+ type=str,
57
+ help="Output file path.",
58
+ )
59
+
60
+ args = parser.parse_args()
61
+
62
+ log_level = logging.DEBUG if args.verbose else logging.INFO
63
+
64
+ logging.basicConfig(level=log_level)
65
+
66
+ from rod.urdf.exporter import UrdfExporter
67
+
68
+ # Ensure file argument is provided if output or `show` is specified.
69
+ if not args.file and (args.output or args.show):
70
+ parser.error(
71
+ "The `--file` argument is required when using `--output` or `--show`."
72
+ )
73
+
74
+ # Show the file attributes if no output file is specified.
75
+ if args.file and not (args.output or args.show):
76
+ args.show = True
77
+
78
+ # Display the parsed file attributes.
79
+ if args.file:
80
+ from rod import Sdf
81
+
82
+ try:
83
+ sdf = Sdf.load(sdf=args.file)
84
+ except Exception as e:
85
+ rodlogging.error(f"Error loading file: {e}")
86
+ sys.exit(1)
87
+
88
+ if args.show:
89
+ print(sdf.to_string())
90
+
91
+ # Output the URDF or SDF file.
92
+ if args.output:
93
+
94
+ try:
95
+ if args.output.endswith(".urdf"):
96
+ with open(args.output, "w") as file:
97
+ file.write(UrdfExporter(pretty=True).to_urdf_string(sdf=sdf))
98
+
99
+ elif args.output.endswith(".sdf"):
100
+ with open(args.output, "w") as file:
101
+ file.write(sdf.serialize(pretty=True))
102
+
103
+ else:
104
+ rodlogging.error(
105
+ f"Unsupported output file extension for '{args.output}'. Supported extensions are '.urdf' and '.sdf'."
106
+ )
107
+ sys.exit(1)
108
+
109
+ except Exception as e:
110
+ rodlogging.exception(f"Error writing output file: {e}")
111
+ sys.exit(1)
112
+
113
+
114
+ if __name__ == "__main__":
115
+ main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rod
3
- Version: 0.3.5.dev8
3
+ Version: 0.3.5.dev14
4
4
  Summary: The ultimate Python tool for RObot Descriptions processing.
5
5
  Author-email: Diego Ferigo <dgferigo@gmail.com>
6
6
  Maintainer-email: Filippo Luca Ferretti <filippo.ferretti@iit.it>, Carlotta Sartore <carlotta.sartore@iit.it>
@@ -334,6 +334,24 @@ print(urdf_string)
334
334
 
335
335
  </details>
336
336
 
337
+ ## Command Line Interface
338
+
339
+ ROD provides a command line interface (CLI) for processing robot description files. You can use the CLI to display file attributes or convert files between URDF and SDF formats.
340
+
341
+ ### Usage
342
+
343
+ - Display the attributes of an SDF file:
344
+
345
+ ```sh
346
+ rod --file /path/to/file.sdf --show
347
+ ```
348
+
349
+ - Convert an SDF file to URDF:
350
+
351
+ ```sh
352
+ rod --file /path/to/file.sdf -o /path/to/file.urdf
353
+ ```
354
+
337
355
  ## Similar projects
338
356
 
339
357
  - https://github.com/gazebosim/sdformat
@@ -9,6 +9,7 @@ setup.py
9
9
  .github/CODEOWNERS
10
10
  .github/workflows/ci_cd.yml
11
11
  src/rod/__init__.py
12
+ src/rod/__main__.py
12
13
  src/rod/logging.py
13
14
  src/rod/pretty_printer.py
14
15
  src/rod.egg-info/PKG-INFO
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes