robits 0.5.0__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 (133) hide show
  1. robits-0.5.0/LICENSE.md +0 -0
  2. robits-0.5.0/PKG-INFO +219 -0
  3. robits-0.5.0/README.md +150 -0
  4. robits-0.5.0/pyproject.toml +109 -0
  5. robits-0.5.0/robits/__init__.py +0 -0
  6. robits-0.5.0/robits/agents/__init__.py +0 -0
  7. robits-0.5.0/robits/agents/base_agent.py +63 -0
  8. robits-0.5.0/robits/agents/mello_agent.py +72 -0
  9. robits-0.5.0/robits/agents/sam2act_agent.py +29 -0
  10. robits-0.5.0/robits/app/__init__.py +13 -0
  11. robits-0.5.0/robits/app/extrinsics_app.py +339 -0
  12. robits-0.5.0/robits/app/misc/slider_widget.py +88 -0
  13. robits-0.5.0/robits/audio/__init__.py +0 -0
  14. robits-0.5.0/robits/audio/audio.py +99 -0
  15. robits-0.5.0/robits/audio/cache_utils.py +45 -0
  16. robits-0.5.0/robits/audio/speech.py +96 -0
  17. robits-0.5.0/robits/audio/utils.py +53 -0
  18. robits-0.5.0/robits/cli/__init__.py +26 -0
  19. robits-0.5.0/robits/cli/agents/mello_cli.py +57 -0
  20. robits-0.5.0/robits/cli/agents/sam2act_cli.py +151 -0
  21. robits-0.5.0/robits/cli/base_cli.py +75 -0
  22. robits-0.5.0/robits/cli/cli_options.py +26 -0
  23. robits-0.5.0/robits/cli/cli_utils.py +71 -0
  24. robits-0.5.0/robits/cli/commands/config_cli.py +150 -0
  25. robits-0.5.0/robits/cli/commands/dataset_cli.py +199 -0
  26. robits-0.5.0/robits/cli/commands/move_cli.py +140 -0
  27. robits-0.5.0/robits/cli/commands/scene_visu.py +34 -0
  28. robits-0.5.0/robits/cli/commands/service_cli.py +88 -0
  29. robits-0.5.0/robits/cli/commands/speech_cli.py +76 -0
  30. robits-0.5.0/robits/cli/devices/camera_cli.py +305 -0
  31. robits-0.5.0/robits/cli/devices/gripper_cli.py +61 -0
  32. robits-0.5.0/robits/cli/devices/panda_cli.py +58 -0
  33. robits-0.5.0/robits/cli/devices/robot_cli.py +63 -0
  34. robits-0.5.0/robits/cli/main.py +23 -0
  35. robits-0.5.0/robits/core/__init__.py +3 -0
  36. robits-0.5.0/robits/core/abc/__init__.py +0 -0
  37. robits-0.5.0/robits/core/abc/audio.py +66 -0
  38. robits-0.5.0/robits/core/abc/camera.py +99 -0
  39. robits-0.5.0/robits/core/abc/control.py +292 -0
  40. robits-0.5.0/robits/core/abc/gripper.py +66 -0
  41. robits-0.5.0/robits/core/abc/robot.py +269 -0
  42. robits-0.5.0/robits/core/abc/speech.py +19 -0
  43. robits-0.5.0/robits/core/compat.py +14 -0
  44. robits-0.5.0/robits/core/config.py +261 -0
  45. robits-0.5.0/robits/core/config_manager.py +321 -0
  46. robits-0.5.0/robits/core/data_model/__init__.py +0 -0
  47. robits-0.5.0/robits/core/data_model/action.py +165 -0
  48. robits-0.5.0/robits/core/data_model/camera_capture.py +81 -0
  49. robits-0.5.0/robits/core/data_model/dataset.py +50 -0
  50. robits-0.5.0/robits/core/factory.py +197 -0
  51. robits-0.5.0/robits/core/utils.py +111 -0
  52. robits-0.5.0/robits/dataset/__init__.py +0 -0
  53. robits-0.5.0/robits/dataset/camera.py +82 -0
  54. robits-0.5.0/robits/dataset/io/__init__.py +0 -0
  55. robits-0.5.0/robits/dataset/io/reader.py +161 -0
  56. robits-0.5.0/robits/dataset/io/recorder.py +160 -0
  57. robits-0.5.0/robits/dataset/io/stats_writer.py +105 -0
  58. robits-0.5.0/robits/dataset/io/writer.py +185 -0
  59. robits-0.5.0/robits/dataset/robot.py +105 -0
  60. robits-0.5.0/robits/real/__init__.py +18 -0
  61. robits-0.5.0/robits/real/franka/__init__.py +1 -0
  62. robits-0.5.0/robits/real/franka/control.py +191 -0
  63. robits-0.5.0/robits/real/franka/franka_web_client.py +94 -0
  64. robits-0.5.0/robits/real/franka/gripper.py +143 -0
  65. robits-0.5.0/robits/real/franka/robot.py +223 -0
  66. robits-0.5.0/robits/real/realsense_camera.py +238 -0
  67. robits-0.5.0/robits/real/robotiq_gripper.py +154 -0
  68. robits-0.5.0/robits/remote/__init__.py +0 -0
  69. robits-0.5.0/robits/remote/client/__init__.py +0 -0
  70. robits-0.5.0/robits/remote/client/camera.py +45 -0
  71. robits-0.5.0/robits/remote/client/client_base.py +47 -0
  72. robits-0.5.0/robits/remote/client/gripper.py +31 -0
  73. robits-0.5.0/robits/remote/client/robot.py +94 -0
  74. robits-0.5.0/robits/remote/server/__init__.py +0 -0
  75. robits-0.5.0/robits/remote/server/camera.py +11 -0
  76. robits-0.5.0/robits/remote/server/gripper.py +11 -0
  77. robits-0.5.0/robits/remote/server/robot.py +11 -0
  78. robits-0.5.0/robits/remote/server/server_base.py +101 -0
  79. robits-0.5.0/robits/sim/__init__.py +0 -0
  80. robits-0.5.0/robits/sim/blueprints.py +138 -0
  81. robits-0.5.0/robits/sim/camera.py +75 -0
  82. robits-0.5.0/robits/sim/control.py +285 -0
  83. robits-0.5.0/robits/sim/env.py +141 -0
  84. robits-0.5.0/robits/sim/env_client.py +118 -0
  85. robits-0.5.0/robits/sim/env_design.py +134 -0
  86. robits-0.5.0/robits/sim/gripper.py +87 -0
  87. robits-0.5.0/robits/sim/model_factory.py +212 -0
  88. robits-0.5.0/robits/sim/robot.py +225 -0
  89. robits-0.5.0/robits/sim/utils.py +119 -0
  90. robits-0.5.0/robits/tools/visualize_dataset.py +160 -0
  91. robits-0.5.0/robits/utils/__init__.py +0 -0
  92. robits-0.5.0/robits/utils/process_utils.py +76 -0
  93. robits-0.5.0/robits/utils/service_launcher.py +50 -0
  94. robits-0.5.0/robits/utils/system_utils.py +41 -0
  95. robits-0.5.0/robits/utils/transform_utils.py +20 -0
  96. robits-0.5.0/robits/utils/vision_utils.py +106 -0
  97. robits-0.5.0/robits/vis/scene_visualizer.py +188 -0
  98. robits-0.5.0/robits/vlm/__init__.py +0 -0
  99. robits-0.5.0/robits/vlm/openai_vlm.py +67 -0
  100. robits-0.5.0/robits/vlm/vlm_cli.py +73 -0
  101. robits-0.5.0/robits_config/__init__.py +0 -0
  102. robits-0.5.0/robits_config/additional_config/__init__.py +0 -0
  103. robits-0.5.0/robits_config/additional_config/remote_config/__init__.py +1 -0
  104. robits-0.5.0/robits_config/additional_config/remote_config/camera_client.json +6 -0
  105. robits-0.5.0/robits_config/additional_config/remote_config/gripper_client.json +6 -0
  106. robits-0.5.0/robits_config/additional_config/remote_config/robot_client.json +6 -0
  107. robits-0.5.0/robits_config/additional_config/sim/__init__.py +1 -0
  108. robits-0.5.0/robits_config/additional_config/sim/gripper_xarm_sim.json +14 -0
  109. robits-0.5.0/robits_config/additional_config/sim/robot_g1_sim.json +69 -0
  110. robits-0.5.0/robits_config/additional_config/sim/robot_gen3_sim.json +18 -0
  111. robits-0.5.0/robits_config/additional_config/sim/robot_h1_sim.json +49 -0
  112. robits-0.5.0/robits_config/additional_config/sim/robot_iiwa14_sim.json +36 -0
  113. robits-0.5.0/robits_config/additional_config/sim/robot_spot_sim.json +22 -0
  114. robits-0.5.0/robits_config/additional_config/sim/robot_xarm_sim.json +50 -0
  115. robits-0.5.0/robits_config/audio/__init__.py +0 -0
  116. robits-0.5.0/robits_config/audio/audio_whisper.json +4 -0
  117. robits-0.5.0/robits_config/camera/__init__.py +0 -0
  118. robits-0.5.0/robits_config/camera/camera_front_real.json +8 -0
  119. robits-0.5.0/robits_config/camera/camera_front_sim.json +7 -0
  120. robits-0.5.0/robits_config/camera_data/__init__.py +0 -0
  121. robits-0.5.0/robits_config/camera_data/calibration_front_camera.json +49 -0
  122. robits-0.5.0/robits_config/gripper/__init__.py +0 -0
  123. robits-0.5.0/robits_config/gripper/gripper_panda_real.json +5 -0
  124. robits-0.5.0/robits_config/gripper/gripper_panda_sim.json +12 -0
  125. robits-0.5.0/robits_config/gripper/gripper_robotiq_real.json +4 -0
  126. robits-0.5.0/robits_config/gripper/gripper_robotiq_sim.json +12 -0
  127. robits-0.5.0/robits_config/robot/__init__.py +0 -0
  128. robits-0.5.0/robits_config/robot/robot_panda_real.json +16 -0
  129. robits-0.5.0/robits_config/robot/robot_panda_sim.json +27 -0
  130. robits-0.5.0/robits_config/robot/robot_ur10e_sim.json +28 -0
  131. robits-0.5.0/robits_config/speech/__init__.py +0 -0
  132. robits-0.5.0/robits_config/speech/speech_espeek.json +5 -0
  133. robits-0.5.0/robits_config/speech/speech_openai.json +4 -0
File without changes
robits-0.5.0/PKG-INFO ADDED
@@ -0,0 +1,219 @@
1
+ Metadata-Version: 2.3
2
+ Name: robits
3
+ Version: 0.5.0
4
+ Summary: Lightweight, modular, and scalable software stack for AI-driven robotic manipulation.
5
+ Keywords: robotics,AI,manipulation,research,perception,control,simulation
6
+ Author: Markus Grotz
7
+ Author-email: grotz@uw.edu
8
+ Requires-Python: >=3.9,<3.13
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Environment :: Console
11
+ Classifier: Framework :: Robot Framework
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Scientific/Engineering
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Provides-Extra: all
23
+ Provides-Extra: audio
24
+ Provides-Extra: dev
25
+ Provides-Extra: real
26
+ Provides-Extra: remote
27
+ Provides-Extra: sim
28
+ Provides-Extra: ur
29
+ Provides-Extra: usd
30
+ Provides-Extra: xarm
31
+ Requires-Dist: black[dev] (>=25.1.0,<26.0.0) ; extra == "dev"
32
+ Requires-Dist: click-prompt (>=0.6.0)
33
+ Requires-Dist: dm-control[all,sim] (>=1.0.30,<2.0.0) ; extra == "sim" or extra == "usd" or extra == "all"
34
+ Requires-Dist: franky-panda[all,real] ; (platform_machine == "x86_64") and (extra == "real" or extra == "all")
35
+ Requires-Dist: ipython (>=8.0)
36
+ Requires-Dist: matplotlib (>=3.7.5,<4.0.0)
37
+ Requires-Dist: mujoco[all,sim] (>=3.3,<4.0) ; extra == "sim" or extra == "usd" or extra == "all"
38
+ Requires-Dist: myst-parser[dev] (==3.0.1) ; extra == "dev"
39
+ Requires-Dist: numpy (>=1.24)
40
+ Requires-Dist: open3d (==0.18.*) ; python_version < "3.10"
41
+ Requires-Dist: open3d (>=0.18) ; python_version >= "3.10"
42
+ Requires-Dist: openai-whisper[audio] (>=20240930,<20240931) ; extra == "audio"
43
+ Requires-Dist: openai[audio] (>=1.64.0,<2.0.0) ; extra == "audio"
44
+ Requires-Dist: psutil[all,remote] (>=7.0.0,<8.0.0) ; extra == "all" or extra == "remote"
45
+ Requires-Dist: pyrealsense2 (>=2.55.1,<3.0.0) ; (python_version < "3.12" and platform_machine == "x86_64") and (extra == "real" or extra == "all")
46
+ Requires-Dist: pyrealsense2-beta (==2.56.0.8430) ; (python_version >= "3.12" and platform_machine == "x86_64") and (extra == "real" or extra == "all")
47
+ Requires-Dist: pyzmq[all,remote] (>=26.4.0,<27.0.0) ; extra == "all" or extra == "remote"
48
+ Requires-Dist: rich-click (>=1,<2)
49
+ Requires-Dist: robot-descriptions[all,sim] (>=1.14.0,<2.0.0) ; extra == "sim" or extra == "usd" or extra == "all"
50
+ Requires-Dist: ruff[dev] (>=0.11.11,<0.12.0) ; extra == "dev"
51
+ Requires-Dist: scipy (>=1.13,<2.0)
52
+ Requires-Dist: sounddevice[audio] (>=0.5.2,<0.6.0) ; extra == "audio"
53
+ Requires-Dist: sphinx-rtd-theme[dev] (>=3.0.2,<4.0.0) ; extra == "dev"
54
+ Requires-Dist: sphinx[dev] (==7.4.7) ; extra == "dev"
55
+ Requires-Dist: sphinxcontrib-video[dev] (>=0.4.1,<0.5.0) ; extra == "dev"
56
+ Requires-Dist: textual (>=1.0.0,<2.0.0)
57
+ Requires-Dist: textual-slider (>=0.1.2,<0.2.0)
58
+ Requires-Dist: toml[dev] (>=0.10.2,<0.11.0) ; extra == "dev"
59
+ Requires-Dist: urx[all,ur] (>=0.11.0,<0.12.0) ; extra == "ur"
60
+ Requires-Dist: usd-core[all,usd] (>=23.5.0,<24.0.0) ; (python_full_version >= "3.8.1" and python_version < "3.11") and (extra == "usd" or extra == "all")
61
+ Requires-Dist: xarm-python-sdk[all,xarm] (>=1.15.3,<2.0.0) ; extra == "xarm"
62
+ Requires-Dist: zmq[all,remote] (>=0.0.0,<0.0.1) ; extra == "all" or extra == "remote"
63
+ Project-URL: documentation, https://robits.readthedocs.io/en/latest/
64
+ Project-URL: homepage, https://github.com/markusgrotz/robits
65
+ Project-URL: repository, https://github.com/markusgrotz/robits
66
+ Project-URL: tracker, https://github.com/markusgrotz/robits/issues
67
+ Description-Content-Type: text/markdown
68
+
69
+ # RoBits - Bits and Bytes for Robotic Manipulation
70
+
71
+ ## `from robits import ♥`
72
+
73
+ [![Supported Python Versions](https://img.shields.io/pypi/pyversions/robits)](https://pypi.org/project/robits/)
74
+ [![PyPI version](https://img.shields.io/pypi/v/robits)](https://pypi.org/project/robits/)
75
+ [![License](https://img.shields.io/pypi/l/robits)](https://github.com/markusgrotz/robits/LICENSE.md)
76
+ [![Code style](https://img.shields.io/badge/code%20style-black-black)](https://black.readthedocs.io/en/stable/)
77
+
78
+
79
+ RoBits is a lightweight, modular and scalable software stack for AI-driven
80
+ robotic manipulation. It is designed for seamless integration with robotic
81
+ manipulation policies, by providing essential tools for perception and robotic
82
+ control.
83
+
84
+ RoBits features an intuitive command-line interface to get started quickly.
85
+ It's user-friendly and ensures adaptability, efficiency, and ease of use across
86
+ diverse robotic applications to help with research experiments.
87
+
88
+ If you are using this work or find it otherwise useful please cite:
89
+ ```
90
+ M. Grotz, M. Shridhar, Y. Chao, T. Asfour and D. Fox
91
+ PerAct2: Benchmarking and Learning for Robotic Bimanual Manipulation Tasks.
92
+ https://doi.org/10.48550/arXiv.2407.00278
93
+ ```
94
+
95
+ Also consider citing additional resources if necessary (See [Acknowledgement](#Acknowledgement))
96
+
97
+
98
+ ![Logo](https://raw.githubusercontent.com/markusgrotz/robits/master/docs/source/_static/logo.png)
99
+
100
+
101
+ ## Quickstart
102
+
103
+ RoBits comes with some default configurations, for example for the Franka Panda
104
+ robot. Run `pip install 'robits[all]'`. This will install necessary dependencies and
105
+ provide an entry point command `rb`. You can use `rb` to get a list of
106
+ commands. For example `rb move home` moves the robot to a default joint
107
+ position.
108
+
109
+ ## Command-Line-Interface
110
+
111
+ Once you have installed `RoBits` you can access the CLI with `rb` in your shell:
112
+ ```bash
113
+ (robits-py3.8) markus @ sockeye ➜ ~ rb [2025-02-23 19:53:43]
114
+
115
+ Usage: rb [OPTIONS] COMMAND [ARGS]...
116
+
117
+ RoBits command line interface for robotic manipulation.
118
+ This is the main entry point for all RoBits CLI commands. It provides global
119
+ verbosity controls and sets up logging configuration.
120
+ Use --verbose/-v to increase log detail level (can be used multiple times).
121
+ Use --quiet/-q to suppress all but error messages.
122
+ Example: rb -vv move home --robot-name robot_panda_sim
123
+
124
+ ╭─ Options ────────────────────────────────────────────────────────────────────╮
125
+ │ --verbose -v INTEGER RANGE Increase verbosity of the logging output. Can │
126
+ │ base used multiple times │
127
+ │ --quiet -q Suppress all logging output except critical │
128
+ │ and error messages │
129
+ │ --help Show this message and exit. │
130
+ ╰──────────────────────────────────────────────────────────────────────────────╯
131
+ ╭─ Commands ───────────────────────────────────────────────────────────────────╮
132
+ │ camera Commands for working with cameras and visual data. │
133
+ │ config Commands for viewing and managing system configurations. │
134
+ │ dataset Dataset related commands │
135
+ │ gripper Gripper related commands │
136
+ │ info Read various information about the current robot state │
137
+ │ move Commands for moving the robot in different directions. │
138
+ │ panda Franka Panda related commands │
139
+ │ shell Creates an interactive shell. Use robot variable to interact │
140
+ │ speech Audio related commands │
141
+ ╰──────────────────────────────────────────────────────────────────────────────╯
142
+ ```
143
+ To learn more about a command you can write for example `rb dataset --help`,
144
+ which will list the subcommands that are related to dataset.
145
+
146
+
147
+ ### Configuration
148
+
149
+ You can display available config files with `rb config list`. To show the
150
+ actual content use `rb config show <config_name>` where `config_name`
151
+ specifies the name of the config file, e.g., `rb config show robot_panda_real`.
152
+ You can specify a user configuration by exporting `ROBITS_CONFIG_DIR`. E.g. by adding
153
+ ```bash
154
+ export ROBITS_CONFIG_DIR=/home/markus/robits_config
155
+ ```
156
+ to your `.bashrc`.
157
+ This allows you to specify additional configurations for robots, cameras,
158
+ grippers. For example, you can change the serial number of the camera or the
159
+ ip address of a robot.
160
+ Once you set your user confiuration folder you can copy and modify an existing configuration with:
161
+ ```bash
162
+ rb config copy
163
+ ```
164
+ Select the configuration you want to modify and open it with your favorite text editor
165
+
166
+
167
+ #### Robot setup
168
+
169
+ Best practice is to install a RT (Real-Time) kernel. See the script for more details.
170
+ With some patches, you can install the NVIDIA driver and access the GPU through
171
+ PyTorch on a real-time kernel system. This avoids unnecessary networking calls
172
+ and removes the burden of deploying the software as everything can be run from a
173
+ single repository.
174
+ Once that is done you can get the robot pose with:
175
+ `rb info pose`
176
+ To move the robot, use one of the `rb move` commands, e.g.:
177
+ `rb move up`
178
+
179
+ #### Camera setup
180
+
181
+ To test your camera setup you can use:
182
+ `rb camera view` and `rb camera point-cloud view`
183
+ For calibration to get the extrinsics, you can use:
184
+ `rb camera calibrate extrinsics`
185
+ This will launch a TUI. Select the camera and press "connect". Then use the
186
+ sliders to adjust the camera pose. Press "save" to store the camera calibration
187
+ to your user config directory, which is set by the environment variable
188
+ `ROBITS_CONFIG_DIR`.
189
+
190
+ #### Gripper setup
191
+
192
+ Basic commands for the gripper are `rb gripper open` or `rb gripper close`.
193
+ Please note that there are some limitations with the Franka Panda gripper.
194
+ Basically, the robot stops when the gripper is active. See the implementation
195
+ for details.
196
+
197
+ ### Data Collection and Replay
198
+
199
+ To replay collected data, use `rb dataset replay`. You can specify the path, the control method, and the robot name:
200
+ ```bash
201
+ rb dataset replay --input-path ~/data/demo_0000/ --robot-name robot_panda_sim --control-method position
202
+ ```
203
+
204
+
205
+ ## Libraries Acknowledgement
206
+
207
+ - Libraries
208
+ - [NumPy](https://numpy.org), [SciPy](https://scipy.org/), [Open3D](https://www.open3d.org/), and more
209
+ - Real robots and grippers
210
+ - [libfranka](https://github.com/frankaemika/libfranka)
211
+ - [Franky](https://github.com/TimSchneider42/franky)
212
+ - pyRobotiqGripper originally from [castetsb/pyRobotiqGripper](https://github.com/castetsb/pyRobotiqGripper)
213
+ - [xArm Python SDK](https://github.com/xArm-Developer/xArm-Python-SDK)
214
+ - [Python URx](https://github.com/SintefManufacturing/python-urx)
215
+ - Simulation
216
+ - [MuJoCo](https://mujoco.org/)
217
+ - [MuJoCo Menagerie](https://github.com/google-deepmind/mujoco_menagerie) and [Robot Descriptions](https://github.com/robot-descriptions/robot_descriptions)
218
+ - [MuJoCo Controllers](https://github.com/kevinzakka/mjctrl)
219
+
robits-0.5.0/README.md ADDED
@@ -0,0 +1,150 @@
1
+ # RoBits - Bits and Bytes for Robotic Manipulation
2
+
3
+ ## `from robits import ♥`
4
+
5
+ [![Supported Python Versions](https://img.shields.io/pypi/pyversions/robits)](https://pypi.org/project/robits/)
6
+ [![PyPI version](https://img.shields.io/pypi/v/robits)](https://pypi.org/project/robits/)
7
+ [![License](https://img.shields.io/pypi/l/robits)](https://github.com/markusgrotz/robits/LICENSE.md)
8
+ [![Code style](https://img.shields.io/badge/code%20style-black-black)](https://black.readthedocs.io/en/stable/)
9
+
10
+
11
+ RoBits is a lightweight, modular and scalable software stack for AI-driven
12
+ robotic manipulation. It is designed for seamless integration with robotic
13
+ manipulation policies, by providing essential tools for perception and robotic
14
+ control.
15
+
16
+ RoBits features an intuitive command-line interface to get started quickly.
17
+ It's user-friendly and ensures adaptability, efficiency, and ease of use across
18
+ diverse robotic applications to help with research experiments.
19
+
20
+ If you are using this work or find it otherwise useful please cite:
21
+ ```
22
+ M. Grotz, M. Shridhar, Y. Chao, T. Asfour and D. Fox
23
+ PerAct2: Benchmarking and Learning for Robotic Bimanual Manipulation Tasks.
24
+ https://doi.org/10.48550/arXiv.2407.00278
25
+ ```
26
+
27
+ Also consider citing additional resources if necessary (See [Acknowledgement](#Acknowledgement))
28
+
29
+
30
+ ![Logo](https://raw.githubusercontent.com/markusgrotz/robits/master/docs/source/_static/logo.png)
31
+
32
+
33
+ ## Quickstart
34
+
35
+ RoBits comes with some default configurations, for example for the Franka Panda
36
+ robot. Run `pip install 'robits[all]'`. This will install necessary dependencies and
37
+ provide an entry point command `rb`. You can use `rb` to get a list of
38
+ commands. For example `rb move home` moves the robot to a default joint
39
+ position.
40
+
41
+ ## Command-Line-Interface
42
+
43
+ Once you have installed `RoBits` you can access the CLI with `rb` in your shell:
44
+ ```bash
45
+ (robits-py3.8) markus @ sockeye ➜ ~ rb [2025-02-23 19:53:43]
46
+
47
+ Usage: rb [OPTIONS] COMMAND [ARGS]...
48
+
49
+ RoBits command line interface for robotic manipulation.
50
+ This is the main entry point for all RoBits CLI commands. It provides global
51
+ verbosity controls and sets up logging configuration.
52
+ Use --verbose/-v to increase log detail level (can be used multiple times).
53
+ Use --quiet/-q to suppress all but error messages.
54
+ Example: rb -vv move home --robot-name robot_panda_sim
55
+
56
+ ╭─ Options ────────────────────────────────────────────────────────────────────╮
57
+ │ --verbose -v INTEGER RANGE Increase verbosity of the logging output. Can │
58
+ │ base used multiple times │
59
+ │ --quiet -q Suppress all logging output except critical │
60
+ │ and error messages │
61
+ │ --help Show this message and exit. │
62
+ ╰──────────────────────────────────────────────────────────────────────────────╯
63
+ ╭─ Commands ───────────────────────────────────────────────────────────────────╮
64
+ │ camera Commands for working with cameras and visual data. │
65
+ │ config Commands for viewing and managing system configurations. │
66
+ │ dataset Dataset related commands │
67
+ │ gripper Gripper related commands │
68
+ │ info Read various information about the current robot state │
69
+ │ move Commands for moving the robot in different directions. │
70
+ │ panda Franka Panda related commands │
71
+ │ shell Creates an interactive shell. Use robot variable to interact │
72
+ │ speech Audio related commands │
73
+ ╰──────────────────────────────────────────────────────────────────────────────╯
74
+ ```
75
+ To learn more about a command you can write for example `rb dataset --help`,
76
+ which will list the subcommands that are related to dataset.
77
+
78
+
79
+ ### Configuration
80
+
81
+ You can display available config files with `rb config list`. To show the
82
+ actual content use `rb config show <config_name>` where `config_name`
83
+ specifies the name of the config file, e.g., `rb config show robot_panda_real`.
84
+ You can specify a user configuration by exporting `ROBITS_CONFIG_DIR`. E.g. by adding
85
+ ```bash
86
+ export ROBITS_CONFIG_DIR=/home/markus/robits_config
87
+ ```
88
+ to your `.bashrc`.
89
+ This allows you to specify additional configurations for robots, cameras,
90
+ grippers. For example, you can change the serial number of the camera or the
91
+ ip address of a robot.
92
+ Once you set your user confiuration folder you can copy and modify an existing configuration with:
93
+ ```bash
94
+ rb config copy
95
+ ```
96
+ Select the configuration you want to modify and open it with your favorite text editor
97
+
98
+
99
+ #### Robot setup
100
+
101
+ Best practice is to install a RT (Real-Time) kernel. See the script for more details.
102
+ With some patches, you can install the NVIDIA driver and access the GPU through
103
+ PyTorch on a real-time kernel system. This avoids unnecessary networking calls
104
+ and removes the burden of deploying the software as everything can be run from a
105
+ single repository.
106
+ Once that is done you can get the robot pose with:
107
+ `rb info pose`
108
+ To move the robot, use one of the `rb move` commands, e.g.:
109
+ `rb move up`
110
+
111
+ #### Camera setup
112
+
113
+ To test your camera setup you can use:
114
+ `rb camera view` and `rb camera point-cloud view`
115
+ For calibration to get the extrinsics, you can use:
116
+ `rb camera calibrate extrinsics`
117
+ This will launch a TUI. Select the camera and press "connect". Then use the
118
+ sliders to adjust the camera pose. Press "save" to store the camera calibration
119
+ to your user config directory, which is set by the environment variable
120
+ `ROBITS_CONFIG_DIR`.
121
+
122
+ #### Gripper setup
123
+
124
+ Basic commands for the gripper are `rb gripper open` or `rb gripper close`.
125
+ Please note that there are some limitations with the Franka Panda gripper.
126
+ Basically, the robot stops when the gripper is active. See the implementation
127
+ for details.
128
+
129
+ ### Data Collection and Replay
130
+
131
+ To replay collected data, use `rb dataset replay`. You can specify the path, the control method, and the robot name:
132
+ ```bash
133
+ rb dataset replay --input-path ~/data/demo_0000/ --robot-name robot_panda_sim --control-method position
134
+ ```
135
+
136
+
137
+ ## Libraries Acknowledgement
138
+
139
+ - Libraries
140
+ - [NumPy](https://numpy.org), [SciPy](https://scipy.org/), [Open3D](https://www.open3d.org/), and more
141
+ - Real robots and grippers
142
+ - [libfranka](https://github.com/frankaemika/libfranka)
143
+ - [Franky](https://github.com/TimSchneider42/franky)
144
+ - pyRobotiqGripper originally from [castetsb/pyRobotiqGripper](https://github.com/castetsb/pyRobotiqGripper)
145
+ - [xArm Python SDK](https://github.com/xArm-Developer/xArm-Python-SDK)
146
+ - [Python URx](https://github.com/SintefManufacturing/python-urx)
147
+ - Simulation
148
+ - [MuJoCo](https://mujoco.org/)
149
+ - [MuJoCo Menagerie](https://github.com/google-deepmind/mujoco_menagerie) and [Robot Descriptions](https://github.com/robot-descriptions/robot_descriptions)
150
+ - [MuJoCo Controllers](https://github.com/kevinzakka/mjctrl)
@@ -0,0 +1,109 @@
1
+ [tool.poetry]
2
+ name = "robits"
3
+ version = "0.5.0"
4
+ description = "Lightweight, modular, and scalable software stack for AI-driven robotic manipulation."
5
+ authors = ["Markus Grotz <grotz@uw.edu>"]
6
+ packages = [{include = "robits"}, {include = "robits_config"}]
7
+ readme = "README.md"
8
+ keywords = ["robotics", "AI", "manipulation", "research", "perception", "control", "simulation"]
9
+
10
+ classifiers = [
11
+ "Development Status :: 4 - Beta",
12
+ "Programming Language :: Python :: 3",
13
+ "Programming Language :: Python :: 3.9",
14
+ "Programming Language :: Python :: 3.10",
15
+ "Programming Language :: Python :: 3.11",
16
+ "Programming Language :: Python :: 3.12",
17
+ "Operating System :: OS Independent",
18
+ "Framework :: Robot Framework",
19
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
20
+ "Topic :: Scientific/Engineering",
21
+ "Intended Audience :: Science/Research",
22
+ "Intended Audience :: Developers",
23
+ "Environment :: Console",
24
+ ]
25
+
26
+ [tool.poetry.urls]
27
+ homepage = "https://github.com/markusgrotz/robits"
28
+ repository = "https://github.com/markusgrotz/robits"
29
+ documentation = "https://robits.readthedocs.io/en/latest/"
30
+ tracker = "https://github.com/markusgrotz/robits/issues"
31
+
32
+ [tool.poetry.dependencies]
33
+ python = ">=3.9,<3.13" # open3d is not available yet for newer version
34
+ numpy = ">=1.24"
35
+ open3d = [
36
+ { version = "0.18.*", markers = "python_version < '3.10'" },
37
+ { version = ">=0.18", markers = "python_version >= '3.10'" }
38
+ ]
39
+ matplotlib = "^3.7.5"
40
+ scipy = "^1.13"
41
+
42
+ ipython = ">=8.0"
43
+ rich-click = "^1"
44
+ click-prompt = ">=0.6.0"
45
+
46
+ textual = "^1.0.0"
47
+ textual-slider = "^0.1.2"
48
+
49
+ # sim
50
+ mujoco = {version = "^3.3", extras = ["sim", "all"], optional = true}
51
+ robot-descriptions = {version = "^1.14.0", extras = ["sim", "all"], optional = true}
52
+ dm-control = {version = "^1.0.30", extras = ["sim", "all"], optional = true}
53
+
54
+ # real
55
+
56
+ # For Python versions less than 3.12
57
+ pyrealsense2 = { version = "^2.55.1", markers = "python_version < '3.12' and platform_machine == 'x86_64'", optional = true }
58
+
59
+ # For Python 3.12 and above, using the beta version
60
+ pyrealsense2-beta = { version = "2.56.0.8430", markers = "python_version >= '3.12' and platform_machine == 'x86_64'", optional = true }
61
+ #pyrobotiqgripper = {git = "https://github.com/markusgrotz/pyRobotiqGripper.git", extras = ["real", "all"], optional = true}
62
+ franky-panda = { version = "*", markers = "platform_machine == 'x86_64'", extras = ["real", "all"], optional = true}
63
+ urx = {version = "^0.11.0", extras = ["ur", "all"], optional = true}
64
+ xarm-python-sdk = {version ="^1.15.3", extras = ["xarm", "all"], optional = true}
65
+
66
+ # remote
67
+ zmq = {version = "^0.0.0", extras = ["remote", "all"], optional = true}
68
+ pyzmq = {version = "^26.4.0", extras = ["remote", "all"], optional = true}
69
+ psutil = {version = "^7.0.0", extras = ["remote", "all"], optional = true}
70
+
71
+ # optional
72
+ openai = {version = "^1.64.0", extras = ["audio"], optional = true}
73
+ openai-whisper = {version = "^20240930", extras = ["audio"], optional = true}
74
+ sounddevice = {version = "^0.5.2", extras = ["audio"], optional = true}
75
+
76
+ # usd - only compatible with Python < 3.11
77
+ usd-core = {version = "^23.5.0", python = ">=3.8.1,<3.11", extras = ["usd", "all"], optional = true}
78
+
79
+ # dev
80
+ toml = {version = "^0.10.2", extras = ["dev"], optional = true}
81
+ sphinx-rtd-theme = {version = "^3.0.2", extras = ["dev"], optional = true}
82
+ sphinxcontrib-video = {version = "^0.4.1", extras = ["dev"], optional = true}
83
+ myst-parser = {version = "3.0.1", extras = ["dev"], optional = true}
84
+ sphinx = {version = "7.4.7", extras = ["dev"], optional = true}
85
+ ruff = {version = "^0.11.11", extras = ["dev"], optional = true}
86
+ black = {version = "^25.1.0", extras = ["dev"], optional = true}
87
+
88
+
89
+ [tool.poetry.extras]
90
+ real = ["franky-panda", "pyrealsense2", "pyrealsense2-beta"] #"pyrobotiqgripper"
91
+ sim = ["mujoco", "robot-descriptions", "dm-control"]
92
+ usd = ["usd-core", "mujoco", "robot-descriptions", "dm-control"]
93
+ all = ["franky-panda", "pyrealsense2", "pyrealsense2-beta", "mujoco", "robot-descriptions", "dm-control", "usd-core", "zmq", "pyzmq", "psutil"] #"pyrobotiqgripper",
94
+ dev = ["sphinx", "toml", "myst-parser", "sphinx-rtd-theme", "sphinxcontrib-video", "black", "ruff"]
95
+ ur = ["urx"]
96
+ xarm = ["xarm-python-sdk"]
97
+ remote = ["zmq", "pyzmq", "psutil"]
98
+ audio = ["openai", "openai-whisper", "sounddevice"]
99
+
100
+ [build-system]
101
+ requires = ["poetry-core>=1.0.8"]
102
+ build-backend = "poetry.core.masonry.api"
103
+
104
+ [tool.poetry.scripts]
105
+ rb = 'robits.cli.main:cli'
106
+ panda = 'robits.cli.devices.panda_cli:panda'
107
+ gripper = 'robits.cli.devices.gripper_cli:gripper'
108
+ camera = 'robits.cli.devices.camera_cli:camera'
109
+ sam2act-agent = 'robits.cli.agents.sam2act_cli:cli'
File without changes
File without changes
@@ -0,0 +1,63 @@
1
+ from abc import ABC
2
+ from abc import abstractmethod
3
+
4
+ import logging
5
+
6
+ import numpy as np
7
+
8
+
9
+ logger = logging.getLogger(__name__)
10
+
11
+
12
+ class BaseAgent(ABC):
13
+ """ """
14
+
15
+ agent_name: str
16
+
17
+ lang_goal: str
18
+
19
+ def prepare_observation(self, obs, i, episode_length):
20
+
21
+ from clip import tokenize
22
+ import torch
23
+
24
+ logger.info("Using language goal %s", self.lang_goal)
25
+
26
+ obs["lang_goal_tokens"] = tokenize([self.lang_goal])[0].numpy()
27
+
28
+ elapsed_time = (1.0 - (i / float(episode_length - 1))) * 2.0 - 1.0
29
+ gripper_joint_positions = obs["gripper_joint_positions"][
30
+ 0:1
31
+ ] # gripper is normalized here
32
+ logger.info("timestamp: %.2f", elapsed_time)
33
+
34
+ obs["ignore_collisions"] = np.array([0])
35
+ obs["low_dim_state"] = np.concatenate(
36
+ [
37
+ gripper_joint_positions,
38
+ gripper_joint_positions,
39
+ gripper_joint_positions,
40
+ elapsed_time,
41
+ ],
42
+ axis=None,
43
+ )
44
+
45
+ for k, v in obs.items():
46
+ if v is None:
47
+ logger.info("No values for key %s", k)
48
+ # obs[k] = torch.tensor([np.zeros(4)], device=self.device).unsqueeze(0)
49
+ continue
50
+
51
+ if isinstance(v, np.ndarray):
52
+ v = v.astype(np.float32)
53
+ logger.debug("Item %s has shape %s", k, v.shape)
54
+ else:
55
+ logger.debug("Key %s is not a numpy array", k)
56
+
57
+ obs[k] = torch.tensor([v], device=self.device).unsqueeze(0)
58
+
59
+ return obs
60
+
61
+ @abstractmethod
62
+ def get_action(self, step, observation):
63
+ pass
@@ -0,0 +1,72 @@
1
+ from typing import Optional
2
+ import logging
3
+ import time
4
+ import requests
5
+
6
+ from dataclasses import dataclass
7
+
8
+ import numpy as np
9
+
10
+
11
+ logger = logging.getLogger(__name__)
12
+
13
+
14
+ @dataclass(frozen=True)
15
+ class MelloConfig:
16
+
17
+ max_delta: float = 0.25
18
+
19
+ initial_joint_positions: Optional[np.ndarray] = None
20
+
21
+
22
+ class MelloAgent:
23
+
24
+ def __init__(self, device_addr, robot):
25
+ self.device_addr = device_addr
26
+ self.robot = robot
27
+ self.max_delta = 0.25
28
+
29
+ def get_mello_data(self):
30
+ data = requests.get(self.device_addr).json()
31
+ joint_positions = np.array(data["joint_positions"])
32
+ joint_positions = np.deg2rad(joint_positions)
33
+ joint_positions *= -1
34
+
35
+ joint_velocities = np.array(data["joint_velocities"])
36
+ joint_velocities = np.deg2rad(joint_velocities)
37
+ joint_velocities *= -1
38
+ return joint_positions, joint_velocities
39
+
40
+ def get_mello_joint_positions(self):
41
+ joint_positions = np.array(
42
+ requests.get(self.device_addr).json()["joint_positions"]
43
+ )
44
+ joint_positions = np.deg2rad(joint_positions)
45
+ joint_positions *= -1
46
+ return joint_positions
47
+
48
+ def get_action(self) -> np.ndarray:
49
+ mello_joint_positions = self.get_mello_joint_positions()
50
+ robot_joint_positions = self.robot.get_proprioception_data(False, False)[
51
+ "joint_positions"
52
+ ]
53
+ delta = mello_joint_positions - robot_joint_positions
54
+ delta = np.clip(delta, -self.max_delta, self.max_delta)
55
+ new_joint_positions = robot_joint_positions + delta
56
+ return new_joint_positions
57
+
58
+ def wait_for_pose(self):
59
+ delta = np.ones_like(self.get_mello_joint_positions()) * self.max_delta
60
+ while np.any(delta >= self.max_delta):
61
+ mello_joint_positions = self.get_mello_joint_positions()
62
+ robot_joint_positions = self.robot.get_joint_obs(False, False)[
63
+ "joint_positions"
64
+ ]
65
+ delta = np.abs(mello_joint_positions - robot_joint_positions)
66
+ logger.info(
67
+ "Delta between robot and mello is too large %s. Should be with %s",
68
+ np.rad2deg(delta),
69
+ np.rad2deg(self.max_delta),
70
+ )
71
+ time.sleep(0.25)
72
+ logger.info("Done.")
@@ -0,0 +1,29 @@
1
+ import logging
2
+
3
+ import torch
4
+
5
+ from sam2act.eval import load_agent
6
+ from robits.agents.base_agent import BaseAgent
7
+
8
+ logger = logging.getLogger(__name__)
9
+
10
+
11
+ class SAM2Act(BaseAgent):
12
+
13
+ def __init__(self, model_path):
14
+ self.device = torch.device("cuda:0")
15
+
16
+ self.agent = load_agent(model_path)
17
+ self.agent.load_clip()
18
+ self.agent.eval()
19
+ self.lang_goal = "push the buttons in the following order: red, green, blue"
20
+
21
+ def get_action(self, step, observation):
22
+
23
+ if not observation:
24
+ logger.error("Nothing todo.")
25
+ return
26
+
27
+ with torch.jit.optimized_execution(False):
28
+ act_result = self.agent.act(step, observation, deterministic=True)
29
+ return act_result
@@ -0,0 +1,13 @@
1
+ """
2
+ Interactive applications for the RoBits framework.
3
+
4
+ This package provides user interface applications for interacting with
5
+ robots, cameras, and other components of the RoBits system. These applications
6
+ use terminal-based UI libraries to provide graphical interfaces that work
7
+ in both terminal and GUI environments.
8
+
9
+ Components:
10
+
11
+ - robot_app: An interactive TUI for controlling robot arms
12
+ - extrinsics_app: An application for calibrating camera extrinsics
13
+ """