reachy-mini 1.0.0__py3-none-any.whl

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.

Potentially problematic release.


This version of reachy-mini might be problematic. Click here for more details.

Files changed (385) hide show
  1. reachy_mini/__init__.py +4 -0
  2. reachy_mini/apps/__init__.py +24 -0
  3. reachy_mini/apps/app.py +121 -0
  4. reachy_mini/apps/manager.py +183 -0
  5. reachy_mini/apps/sources/__init__.py +4 -0
  6. reachy_mini/apps/sources/hf_space.py +25 -0
  7. reachy_mini/apps/sources/local_common_venv.py +44 -0
  8. reachy_mini/apps/templates/README.md.j2 +1 -0
  9. reachy_mini/apps/templates/main.py.j2 +46 -0
  10. reachy_mini/apps/templates/pyproject.toml.j2 +18 -0
  11. reachy_mini/apps/utils.py +30 -0
  12. reachy_mini/assets/config/hardware_config.yaml +119 -0
  13. reachy_mini/assets/confused1.wav +0 -0
  14. reachy_mini/assets/count.wav +0 -0
  15. reachy_mini/assets/dance1.wav +0 -0
  16. reachy_mini/assets/go_sleep.wav +0 -0
  17. reachy_mini/assets/impatient1.wav +0 -0
  18. reachy_mini/assets/kinematics_data.json +253 -0
  19. reachy_mini/assets/models/fknetwork.dynamic.onnx +0 -0
  20. reachy_mini/assets/models/fknetwork.onnx +0 -0
  21. reachy_mini/assets/models/fknetwork_int8.onnx +0 -0
  22. reachy_mini/assets/models/iknetwork.onnx +0 -0
  23. reachy_mini/assets/wake_up.wav +0 -0
  24. reachy_mini/daemon/__init__.py +1 -0
  25. reachy_mini/daemon/app/__init__.py +1 -0
  26. reachy_mini/daemon/app/bg_job_register.py +142 -0
  27. reachy_mini/daemon/app/dashboard/static/assets/KO-cartoon-static.svg +40 -0
  28. reachy_mini/daemon/app/dashboard/static/assets/awake-cartoon-static.svg +42 -0
  29. reachy_mini/daemon/app/dashboard/static/assets/awake-cartoon.svg +6 -0
  30. reachy_mini/daemon/app/dashboard/static/assets/go-to-sleep-cartoon.svg +6 -0
  31. reachy_mini/daemon/app/dashboard/static/assets/no-wifi-cartoon-static.svg +50 -0
  32. reachy_mini/daemon/app/dashboard/static/assets/no-wifi-cartoon.svg +6 -0
  33. reachy_mini/daemon/app/dashboard/static/assets/reachy-mini-awake.svg +18 -0
  34. reachy_mini/daemon/app/dashboard/static/assets/reachy-mini-connection-lost-animation.svg +6 -0
  35. reachy_mini/daemon/app/dashboard/static/assets/reachy-mini-go-to-sleep-animation.svg +6 -0
  36. reachy_mini/daemon/app/dashboard/static/assets/reachy-mini-ko-animation.svg +6 -0
  37. reachy_mini/daemon/app/dashboard/static/assets/reachy-mini-ko.svg +22 -0
  38. reachy_mini/daemon/app/dashboard/static/assets/reachy-mini-sleeping-static.svg +41 -0
  39. reachy_mini/daemon/app/dashboard/static/assets/reachy-mini-sleeping.svg +18 -0
  40. reachy_mini/daemon/app/dashboard/static/assets/reachy-mini-wake-up-animation.svg +6 -0
  41. reachy_mini/daemon/app/dashboard/static/js/3rdparty/gstwebrtc-api-2.0.0.min.js +5 -0
  42. reachy_mini/daemon/app/dashboard/static/js/apps.js +304 -0
  43. reachy_mini/daemon/app/dashboard/static/js/appstore.js +150 -0
  44. reachy_mini/daemon/app/dashboard/static/js/daemon.js +163 -0
  45. reachy_mini/daemon/app/dashboard/static/js/move_player.js +132 -0
  46. reachy_mini/daemon/app/dashboard/static/js/setup_wifi.js +94 -0
  47. reachy_mini/daemon/app/dashboard/static/js/update.js +80 -0
  48. reachy_mini/daemon/app/dashboard/static/style.css +83 -0
  49. reachy_mini/daemon/app/dashboard/templates/base.html +23 -0
  50. reachy_mini/daemon/app/dashboard/templates/index.html +17 -0
  51. reachy_mini/daemon/app/dashboard/templates/sections/apps.html +8 -0
  52. reachy_mini/daemon/app/dashboard/templates/sections/appstore.html +29 -0
  53. reachy_mini/daemon/app/dashboard/templates/sections/daemon.html +36 -0
  54. reachy_mini/daemon/app/dashboard/templates/sections/move_player.html +27 -0
  55. reachy_mini/daemon/app/dashboard/update.html +22 -0
  56. reachy_mini/daemon/app/dashboard/wifi_config.html +41 -0
  57. reachy_mini/daemon/app/dependencies.py +41 -0
  58. reachy_mini/daemon/app/main.py +262 -0
  59. reachy_mini/daemon/app/models.py +147 -0
  60. reachy_mini/daemon/app/routers/apps.py +114 -0
  61. reachy_mini/daemon/app/routers/daemon.py +80 -0
  62. reachy_mini/daemon/app/routers/kinematics.py +57 -0
  63. reachy_mini/daemon/app/routers/motors.py +41 -0
  64. reachy_mini/daemon/app/routers/move.py +257 -0
  65. reachy_mini/daemon/app/routers/state.py +146 -0
  66. reachy_mini/daemon/backend/__init__.py +1 -0
  67. reachy_mini/daemon/backend/abstract.py +750 -0
  68. reachy_mini/daemon/backend/mujoco/__init__.py +36 -0
  69. reachy_mini/daemon/backend/mujoco/backend.py +304 -0
  70. reachy_mini/daemon/backend/mujoco/utils.py +59 -0
  71. reachy_mini/daemon/backend/mujoco/video_udp.py +53 -0
  72. reachy_mini/daemon/backend/robot/__init__.py +8 -0
  73. reachy_mini/daemon/backend/robot/backend.py +535 -0
  74. reachy_mini/daemon/daemon.py +444 -0
  75. reachy_mini/daemon/utils.py +114 -0
  76. reachy_mini/descriptions/reachy_mini/mjcf/additional.xml +6 -0
  77. reachy_mini/descriptions/reachy_mini/mjcf/assets/5w_speaker.part +13 -0
  78. reachy_mini/descriptions/reachy_mini/mjcf/assets/5w_speaker.stl +0 -0
  79. reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna.part +13 -0
  80. reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna.stl +0 -0
  81. reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna_body_3dprint.part +13 -0
  82. reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna_body_3dprint.stl +0 -0
  83. reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna_holder_l_3dprint.part +13 -0
  84. reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna_holder_l_3dprint.stl +0 -0
  85. reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna_holder_r_3dprint.part +13 -0
  86. reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna_holder_r_3dprint.stl +0 -0
  87. reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna_interface_3dprint.part +13 -0
  88. reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna_interface_3dprint.stl +0 -0
  89. reachy_mini/descriptions/reachy_mini/mjcf/assets/arducam.part +13 -0
  90. reachy_mini/descriptions/reachy_mini/mjcf/assets/arducam.stl +0 -0
  91. reachy_mini/descriptions/reachy_mini/mjcf/assets/b3b_eh.part +13 -0
  92. reachy_mini/descriptions/reachy_mini/mjcf/assets/b3b_eh.stl +0 -0
  93. reachy_mini/descriptions/reachy_mini/mjcf/assets/b3b_eh_1.part +13 -0
  94. reachy_mini/descriptions/reachy_mini/mjcf/assets/b3b_eh_1.stl +0 -0
  95. reachy_mini/descriptions/reachy_mini/mjcf/assets/bearing_85x110x13.part +13 -0
  96. reachy_mini/descriptions/reachy_mini/mjcf/assets/bearing_85x110x13.stl +0 -0
  97. reachy_mini/descriptions/reachy_mini/mjcf/assets/big_lens_d40.part +13 -0
  98. reachy_mini/descriptions/reachy_mini/mjcf/assets/big_lens_d40.stl +0 -0
  99. reachy_mini/descriptions/reachy_mini/mjcf/assets/body_down_3dprint.part +13 -0
  100. reachy_mini/descriptions/reachy_mini/mjcf/assets/body_down_3dprint.stl +0 -0
  101. reachy_mini/descriptions/reachy_mini/mjcf/assets/body_foot_3dprint.part +13 -0
  102. reachy_mini/descriptions/reachy_mini/mjcf/assets/body_foot_3dprint.stl +0 -0
  103. reachy_mini/descriptions/reachy_mini/mjcf/assets/body_top_3dprint.part +13 -0
  104. reachy_mini/descriptions/reachy_mini/mjcf/assets/body_top_3dprint.stl +0 -0
  105. reachy_mini/descriptions/reachy_mini/mjcf/assets/body_turning_3dprint.part +13 -0
  106. reachy_mini/descriptions/reachy_mini/mjcf/assets/body_turning_3dprint.stl +0 -0
  107. reachy_mini/descriptions/reachy_mini/mjcf/assets/bts2_m2_6x8.part +13 -0
  108. reachy_mini/descriptions/reachy_mini/mjcf/assets/bts2_m2_6x8.stl +0 -0
  109. reachy_mini/descriptions/reachy_mini/mjcf/assets/croissant_1k.blend/croissant_1k.obj +5021 -0
  110. reachy_mini/descriptions/reachy_mini/mjcf/assets/croissant_1k.blend/textures/croissant_diff_1k.png +0 -0
  111. reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_case_b_dummy.part +13 -0
  112. reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_case_b_dummy.stl +0 -0
  113. reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_case_f_dummy.part +13 -0
  114. reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_case_f_dummy.stl +0 -0
  115. reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_case_m_dummy.part +13 -0
  116. reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_case_m_dummy.stl +0 -0
  117. reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_horn_dummy.part +13 -0
  118. reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_horn_dummy.stl +0 -0
  119. reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_led_cap2_dummy.part +13 -0
  120. reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_led_cap2_dummy.stl +0 -0
  121. reachy_mini/descriptions/reachy_mini/mjcf/assets/food_apple_01_1k.blend/food_apple_01_1k.obj +18045 -0
  122. reachy_mini/descriptions/reachy_mini/mjcf/assets/food_apple_01_1k.blend/textures/food_apple_01_diff_1k.png +0 -0
  123. reachy_mini/descriptions/reachy_mini/mjcf/assets/glasses_dolder_3dprint.part +13 -0
  124. reachy_mini/descriptions/reachy_mini/mjcf/assets/glasses_dolder_3dprint.stl +0 -0
  125. reachy_mini/descriptions/reachy_mini/mjcf/assets/head_back_3dprint.part +13 -0
  126. reachy_mini/descriptions/reachy_mini/mjcf/assets/head_back_3dprint.stl +0 -0
  127. reachy_mini/descriptions/reachy_mini/mjcf/assets/head_front_3dprint.part +13 -0
  128. reachy_mini/descriptions/reachy_mini/mjcf/assets/head_front_3dprint.stl +0 -0
  129. reachy_mini/descriptions/reachy_mini/mjcf/assets/head_mic_3dprint.part +13 -0
  130. reachy_mini/descriptions/reachy_mini/mjcf/assets/head_mic_3dprint.stl +0 -0
  131. reachy_mini/descriptions/reachy_mini/mjcf/assets/lens_cap_d30_3dprint.part +13 -0
  132. reachy_mini/descriptions/reachy_mini/mjcf/assets/lens_cap_d30_3dprint.stl +0 -0
  133. reachy_mini/descriptions/reachy_mini/mjcf/assets/lens_cap_d40_3dprint.part +13 -0
  134. reachy_mini/descriptions/reachy_mini/mjcf/assets/lens_cap_d40_3dprint.stl +0 -0
  135. reachy_mini/descriptions/reachy_mini/mjcf/assets/m12_fisheye_lens_1_8mm.part +13 -0
  136. reachy_mini/descriptions/reachy_mini/mjcf/assets/m12_fisheye_lens_1_8mm.stl +0 -0
  137. reachy_mini/descriptions/reachy_mini/mjcf/assets/mp01062_stewart_arm_3.part +13 -0
  138. reachy_mini/descriptions/reachy_mini/mjcf/assets/mp01062_stewart_arm_3.stl +0 -0
  139. reachy_mini/descriptions/reachy_mini/mjcf/assets/neck_reference_3dprint.part +13 -0
  140. reachy_mini/descriptions/reachy_mini/mjcf/assets/neck_reference_3dprint.stl +0 -0
  141. reachy_mini/descriptions/reachy_mini/mjcf/assets/phs_1_7x20_5_dc10.part +13 -0
  142. reachy_mini/descriptions/reachy_mini/mjcf/assets/phs_1_7x20_5_dc10.stl +0 -0
  143. reachy_mini/descriptions/reachy_mini/mjcf/assets/phs_1_7x20_5_dc10_1.part +13 -0
  144. reachy_mini/descriptions/reachy_mini/mjcf/assets/phs_1_7x20_5_dc10_1.stl +0 -0
  145. reachy_mini/descriptions/reachy_mini/mjcf/assets/phs_1_7x20_5_dc10_2.part +13 -0
  146. reachy_mini/descriptions/reachy_mini/mjcf/assets/phs_1_7x20_5_dc10_2.stl +0 -0
  147. reachy_mini/descriptions/reachy_mini/mjcf/assets/phs_1_7x20_5_dc10_3.part +13 -0
  148. reachy_mini/descriptions/reachy_mini/mjcf/assets/phs_1_7x20_5_dc10_3.stl +0 -0
  149. reachy_mini/descriptions/reachy_mini/mjcf/assets/pp01102_arducam_carter.part +13 -0
  150. reachy_mini/descriptions/reachy_mini/mjcf/assets/pp01102_arducam_carter.stl +0 -0
  151. reachy_mini/descriptions/reachy_mini/mjcf/assets/rubber_duck_toy_1k.blend/rubber_duck_toy_1k.obj +8940 -0
  152. reachy_mini/descriptions/reachy_mini/mjcf/assets/rubber_duck_toy_1k.blend/textures/rubber_duck_toy_diff_1k.png +0 -0
  153. reachy_mini/descriptions/reachy_mini/mjcf/assets/small_lens_d30.part +13 -0
  154. reachy_mini/descriptions/reachy_mini/mjcf/assets/small_lens_d30.stl +0 -0
  155. reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_link_ball.part +13 -0
  156. reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_link_ball.stl +0 -0
  157. reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_link_ball__2.part +13 -0
  158. reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_link_ball__2.stl +0 -0
  159. reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_link_rod.part +13 -0
  160. reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_link_rod.stl +0 -0
  161. reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_main_plate_3dprint.part +13 -0
  162. reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_main_plate_3dprint.stl +0 -0
  163. reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_tricap_3dprint.part +13 -0
  164. reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_tricap_3dprint.stl +0 -0
  165. reachy_mini/descriptions/reachy_mini/mjcf/assets/wooden_table_02_1k.blend/textures/wooden_table_02_diff_1k.png +0 -0
  166. reachy_mini/descriptions/reachy_mini/mjcf/assets/wooden_table_02_1k.blend/wooden_table_02_1k.obj +485 -0
  167. reachy_mini/descriptions/reachy_mini/mjcf/config.json +21 -0
  168. reachy_mini/descriptions/reachy_mini/mjcf/joints_properties.xml +29 -0
  169. reachy_mini/descriptions/reachy_mini/mjcf/reachy_mini.xml +613 -0
  170. reachy_mini/descriptions/reachy_mini/mjcf/reachy_mini.xml.bak +442 -0
  171. reachy_mini/descriptions/reachy_mini/mjcf/scene.xml +24 -0
  172. reachy_mini/descriptions/reachy_mini/mjcf/scenes/empty.xml +27 -0
  173. reachy_mini/descriptions/reachy_mini/mjcf/scenes/minimal.xml +131 -0
  174. reachy_mini/descriptions/reachy_mini/urdf/assets/5w_speaker.part +13 -0
  175. reachy_mini/descriptions/reachy_mini/urdf/assets/5w_speaker.stl +0 -0
  176. reachy_mini/descriptions/reachy_mini/urdf/assets/antenna.part +13 -0
  177. reachy_mini/descriptions/reachy_mini/urdf/assets/antenna.stl +0 -0
  178. reachy_mini/descriptions/reachy_mini/urdf/assets/antenna_body_3dprint.part +13 -0
  179. reachy_mini/descriptions/reachy_mini/urdf/assets/antenna_body_3dprint.stl +0 -0
  180. reachy_mini/descriptions/reachy_mini/urdf/assets/antenna_holder_l_3dprint.part +13 -0
  181. reachy_mini/descriptions/reachy_mini/urdf/assets/antenna_holder_l_3dprint.stl +0 -0
  182. reachy_mini/descriptions/reachy_mini/urdf/assets/antenna_holder_r_3dprint.part +13 -0
  183. reachy_mini/descriptions/reachy_mini/urdf/assets/antenna_holder_r_3dprint.stl +0 -0
  184. reachy_mini/descriptions/reachy_mini/urdf/assets/antenna_interface_3dprint.part +13 -0
  185. reachy_mini/descriptions/reachy_mini/urdf/assets/antenna_interface_3dprint.stl +0 -0
  186. reachy_mini/descriptions/reachy_mini/urdf/assets/arducam.part +13 -0
  187. reachy_mini/descriptions/reachy_mini/urdf/assets/arducam.stl +0 -0
  188. reachy_mini/descriptions/reachy_mini/urdf/assets/arm.part +13 -0
  189. reachy_mini/descriptions/reachy_mini/urdf/assets/arm.stl +0 -0
  190. reachy_mini/descriptions/reachy_mini/urdf/assets/b3b_eh.part +13 -0
  191. reachy_mini/descriptions/reachy_mini/urdf/assets/b3b_eh.stl +0 -0
  192. reachy_mini/descriptions/reachy_mini/urdf/assets/b3b_eh_1.part +13 -0
  193. reachy_mini/descriptions/reachy_mini/urdf/assets/b3b_eh_1.stl +0 -0
  194. reachy_mini/descriptions/reachy_mini/urdf/assets/ball.part +13 -0
  195. reachy_mini/descriptions/reachy_mini/urdf/assets/ball.stl +0 -0
  196. reachy_mini/descriptions/reachy_mini/urdf/assets/bearing_85x110x13.part +13 -0
  197. reachy_mini/descriptions/reachy_mini/urdf/assets/bearing_85x110x13.stl +0 -0
  198. reachy_mini/descriptions/reachy_mini/urdf/assets/big_lens.part +13 -0
  199. reachy_mini/descriptions/reachy_mini/urdf/assets/big_lens.stl +0 -0
  200. reachy_mini/descriptions/reachy_mini/urdf/assets/big_lens_d40.part +13 -0
  201. reachy_mini/descriptions/reachy_mini/urdf/assets/big_lens_d40.stl +0 -0
  202. reachy_mini/descriptions/reachy_mini/urdf/assets/body_down_3dprint.part +13 -0
  203. reachy_mini/descriptions/reachy_mini/urdf/assets/body_down_3dprint.stl +0 -0
  204. reachy_mini/descriptions/reachy_mini/urdf/assets/body_foot_3dprint.part +13 -0
  205. reachy_mini/descriptions/reachy_mini/urdf/assets/body_foot_3dprint.stl +0 -0
  206. reachy_mini/descriptions/reachy_mini/urdf/assets/body_top_3dprint.part +13 -0
  207. reachy_mini/descriptions/reachy_mini/urdf/assets/body_top_3dprint.stl +0 -0
  208. reachy_mini/descriptions/reachy_mini/urdf/assets/body_turning_3dprint.part +13 -0
  209. reachy_mini/descriptions/reachy_mini/urdf/assets/body_turning_3dprint.stl +0 -0
  210. reachy_mini/descriptions/reachy_mini/urdf/assets/bottom_body.part +13 -0
  211. reachy_mini/descriptions/reachy_mini/urdf/assets/bottom_body.stl +0 -0
  212. reachy_mini/descriptions/reachy_mini/urdf/assets/bts2_m2_6x8.part +13 -0
  213. reachy_mini/descriptions/reachy_mini/urdf/assets/bts2_m2_6x8.stl +0 -0
  214. reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_case_b_dummy.part +13 -0
  215. reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_case_b_dummy.stl +0 -0
  216. reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_case_f_dummy.part +13 -0
  217. reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_case_f_dummy.stl +0 -0
  218. reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_case_m_dummy.part +13 -0
  219. reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_case_m_dummy.stl +0 -0
  220. reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_horn_dummy.part +13 -0
  221. reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_horn_dummy.stl +0 -0
  222. reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_led_cap2_dummy.part +13 -0
  223. reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_led_cap2_dummy.stl +0 -0
  224. reachy_mini/descriptions/reachy_mini/urdf/assets/drive_palonier__configuration_default.part +14 -0
  225. reachy_mini/descriptions/reachy_mini/urdf/assets/drive_palonier__configuration_default.stl +0 -0
  226. reachy_mini/descriptions/reachy_mini/urdf/assets/drive_palonier__configuration_simple_axe.part +14 -0
  227. reachy_mini/descriptions/reachy_mini/urdf/assets/drive_palonier__configuration_simple_axe.stl +0 -0
  228. reachy_mini/descriptions/reachy_mini/urdf/assets/eye_support.part +13 -0
  229. reachy_mini/descriptions/reachy_mini/urdf/assets/eye_support.stl +0 -0
  230. reachy_mini/descriptions/reachy_mini/urdf/assets/foot.part +13 -0
  231. reachy_mini/descriptions/reachy_mini/urdf/assets/foot.stl +0 -0
  232. reachy_mini/descriptions/reachy_mini/urdf/assets/glasses_dolder_3dprint.part +13 -0
  233. reachy_mini/descriptions/reachy_mini/urdf/assets/glasses_dolder_3dprint.stl +0 -0
  234. reachy_mini/descriptions/reachy_mini/urdf/assets/head_back_3dprint.part +13 -0
  235. reachy_mini/descriptions/reachy_mini/urdf/assets/head_back_3dprint.stl +0 -0
  236. reachy_mini/descriptions/reachy_mini/urdf/assets/head_front_3dprint.part +13 -0
  237. reachy_mini/descriptions/reachy_mini/urdf/assets/head_front_3dprint.stl +0 -0
  238. reachy_mini/descriptions/reachy_mini/urdf/assets/head_head_back.part +13 -0
  239. reachy_mini/descriptions/reachy_mini/urdf/assets/head_head_back.stl +0 -0
  240. reachy_mini/descriptions/reachy_mini/urdf/assets/head_interface.part +13 -0
  241. reachy_mini/descriptions/reachy_mini/urdf/assets/head_interface.stl +0 -0
  242. reachy_mini/descriptions/reachy_mini/urdf/assets/head_mic_3dprint.part +13 -0
  243. reachy_mini/descriptions/reachy_mini/urdf/assets/head_mic_3dprint.stl +0 -0
  244. reachy_mini/descriptions/reachy_mini/urdf/assets/head_shell_front.part +13 -0
  245. reachy_mini/descriptions/reachy_mini/urdf/assets/head_shell_front.stl +0 -0
  246. reachy_mini/descriptions/reachy_mini/urdf/assets/lens_cap_d30_3dprint.part +13 -0
  247. reachy_mini/descriptions/reachy_mini/urdf/assets/lens_cap_d30_3dprint.stl +0 -0
  248. reachy_mini/descriptions/reachy_mini/urdf/assets/lens_cap_d40_3dprint.part +13 -0
  249. reachy_mini/descriptions/reachy_mini/urdf/assets/lens_cap_d40_3dprint.stl +0 -0
  250. reachy_mini/descriptions/reachy_mini/urdf/assets/m12_fisheye_lens_1_8mm.part +13 -0
  251. reachy_mini/descriptions/reachy_mini/urdf/assets/m12_fisheye_lens_1_8mm.stl +0 -0
  252. reachy_mini/descriptions/reachy_mini/urdf/assets/m12_lens.part +13 -0
  253. reachy_mini/descriptions/reachy_mini/urdf/assets/m12_lens.stl +0 -0
  254. reachy_mini/descriptions/reachy_mini/urdf/assets/main_plate.part +13 -0
  255. reachy_mini/descriptions/reachy_mini/urdf/assets/main_plate.stl +0 -0
  256. reachy_mini/descriptions/reachy_mini/urdf/assets/mid_plate.part +13 -0
  257. reachy_mini/descriptions/reachy_mini/urdf/assets/mid_plate.stl +0 -0
  258. reachy_mini/descriptions/reachy_mini/urdf/assets/mp01062_stewart_arm_3.part +13 -0
  259. reachy_mini/descriptions/reachy_mini/urdf/assets/mp01062_stewart_arm_3.stl +0 -0
  260. reachy_mini/descriptions/reachy_mini/urdf/assets/neck_reference_3dprint.part +13 -0
  261. reachy_mini/descriptions/reachy_mini/urdf/assets/neck_reference_3dprint.stl +0 -0
  262. reachy_mini/descriptions/reachy_mini/urdf/assets/phs_1_7x20_5_dc10.part +13 -0
  263. reachy_mini/descriptions/reachy_mini/urdf/assets/phs_1_7x20_5_dc10.stl +0 -0
  264. reachy_mini/descriptions/reachy_mini/urdf/assets/phs_1_7x20_5_dc10_1.part +13 -0
  265. reachy_mini/descriptions/reachy_mini/urdf/assets/phs_1_7x20_5_dc10_1.stl +0 -0
  266. reachy_mini/descriptions/reachy_mini/urdf/assets/phs_1_7x20_5_dc10_2.part +13 -0
  267. reachy_mini/descriptions/reachy_mini/urdf/assets/phs_1_7x20_5_dc10_2.stl +0 -0
  268. reachy_mini/descriptions/reachy_mini/urdf/assets/phs_1_7x20_5_dc10_3.part +13 -0
  269. reachy_mini/descriptions/reachy_mini/urdf/assets/phs_1_7x20_5_dc10_3.stl +0 -0
  270. reachy_mini/descriptions/reachy_mini/urdf/assets/plateform.part +13 -0
  271. reachy_mini/descriptions/reachy_mini/urdf/assets/plateform.stl +0 -0
  272. reachy_mini/descriptions/reachy_mini/urdf/assets/pp00xxx_stewart_rod.part +13 -0
  273. reachy_mini/descriptions/reachy_mini/urdf/assets/pp00xxx_stewart_rod.stl +0 -0
  274. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01062_stewart_arm.part +13 -0
  275. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01062_stewart_arm.stl +0 -0
  276. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01063_stewart_plateform.part +13 -0
  277. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01063_stewart_plateform.stl +0 -0
  278. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01064_stewart_main_plate.part +13 -0
  279. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01064_stewart_main_plate.stl +0 -0
  280. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01065_stewart_side_plate.part +13 -0
  281. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01065_stewart_side_plate.stl +0 -0
  282. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01066_stewart_mid_plate.part +13 -0
  283. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01066_stewart_mid_plate.stl +0 -0
  284. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01067_bottom_body.part +13 -0
  285. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01067_bottom_body.stl +0 -0
  286. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01068_top_body.part +13 -0
  287. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01068_top_body.stl +0 -0
  288. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01069_head_shell_front.part +13 -0
  289. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01069_head_shell_front.stl +0 -0
  290. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01070_head_head_back.part +13 -0
  291. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01070_head_head_back.stl +0 -0
  292. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01071_turning_bowl.part +13 -0
  293. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01071_turning_bowl.stl +0 -0
  294. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01072_turning_end.part +13 -0
  295. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01072_turning_end.stl +0 -0
  296. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01078_glasses.part +13 -0
  297. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01078_glasses.stl +0 -0
  298. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01079_back_big_eye.part +13 -0
  299. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01079_back_big_eye.stl +0 -0
  300. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01080_back_small_eye.part +13 -0
  301. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01080_back_small_eye.stl +0 -0
  302. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01102_arducam_carter.part +13 -0
  303. reachy_mini/descriptions/reachy_mini/urdf/assets/pp01102_arducam_carter.stl +0 -0
  304. reachy_mini/descriptions/reachy_mini/urdf/assets/rod.part +13 -0
  305. reachy_mini/descriptions/reachy_mini/urdf/assets/rod.stl +0 -0
  306. reachy_mini/descriptions/reachy_mini/urdf/assets/shape.part +13 -0
  307. reachy_mini/descriptions/reachy_mini/urdf/assets/shape.stl +0 -0
  308. reachy_mini/descriptions/reachy_mini/urdf/assets/side_plate.part +13 -0
  309. reachy_mini/descriptions/reachy_mini/urdf/assets/side_plate.stl +0 -0
  310. reachy_mini/descriptions/reachy_mini/urdf/assets/small_lens.part +13 -0
  311. reachy_mini/descriptions/reachy_mini/urdf/assets/small_lens.stl +0 -0
  312. reachy_mini/descriptions/reachy_mini/urdf/assets/small_lens_d30.part +13 -0
  313. reachy_mini/descriptions/reachy_mini/urdf/assets/small_lens_d30.stl +0 -0
  314. reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_link_ball.part +13 -0
  315. reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_link_ball.stl +0 -0
  316. reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_link_ball__2.part +13 -0
  317. reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_link_ball__2.stl +0 -0
  318. reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_link_rod.part +13 -0
  319. reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_link_rod.stl +0 -0
  320. reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_main_plate_3dprint.part +13 -0
  321. reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_main_plate_3dprint.stl +0 -0
  322. reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_tricap_3dprint.part +13 -0
  323. reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_tricap_3dprint.stl +0 -0
  324. reachy_mini/descriptions/reachy_mini/urdf/assets/test_antenna.part +13 -0
  325. reachy_mini/descriptions/reachy_mini/urdf/assets/test_antenna.stl +0 -0
  326. reachy_mini/descriptions/reachy_mini/urdf/assets/test_antenna_body.part +13 -0
  327. reachy_mini/descriptions/reachy_mini/urdf/assets/test_antenna_body.stl +0 -0
  328. reachy_mini/descriptions/reachy_mini/urdf/assets/top_body.part +13 -0
  329. reachy_mini/descriptions/reachy_mini/urdf/assets/top_body.stl +0 -0
  330. reachy_mini/descriptions/reachy_mini/urdf/assets/turning_bowl.part +13 -0
  331. reachy_mini/descriptions/reachy_mini/urdf/assets/turning_bowl.stl +0 -0
  332. reachy_mini/descriptions/reachy_mini/urdf/assets/uc_a37_rev_a_step.part +13 -0
  333. reachy_mini/descriptions/reachy_mini/urdf/assets/uc_a37_rev_a_step.stl +0 -0
  334. reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0122topcabinetcase_95__configuration_default.part +14 -0
  335. reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0122topcabinetcase_95__configuration_default.stl +0 -0
  336. reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0122topcabinetcase_95__configuration_simple_axe.part +14 -0
  337. reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0122topcabinetcase_95__configuration_simple_axe.stl +0 -0
  338. reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0123middlecase_56__configuration_default.part +14 -0
  339. reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0123middlecase_56__configuration_default.stl +0 -0
  340. reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0123middlecase_56__configuration_simple_axe.part +14 -0
  341. reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0123middlecase_56__configuration_simple_axe.stl +0 -0
  342. reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0124bottomcase_45__configuration_default.part +14 -0
  343. reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0124bottomcase_45__configuration_default.stl +0 -0
  344. reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0124bottomcase_45__configuration_simple_axe.part +14 -0
  345. reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0124bottomcase_45__configuration_simple_axe.stl +0 -0
  346. reachy_mini/descriptions/reachy_mini/urdf/config.json +18 -0
  347. reachy_mini/descriptions/reachy_mini/urdf/robot.urdf +3281 -0
  348. reachy_mini/descriptions/reachy_mini/urdf/robot.urdf.bak +3282 -0
  349. reachy_mini/descriptions/reachy_mini/urdf/robot_no_collision.urdf +2316 -0
  350. reachy_mini/io/__init__.py +1 -0
  351. reachy_mini/io/abstract.py +70 -0
  352. reachy_mini/io/protocol.py +44 -0
  353. reachy_mini/io/zenoh_client.py +258 -0
  354. reachy_mini/io/zenoh_server.py +183 -0
  355. reachy_mini/kinematics/__init__.py +68 -0
  356. reachy_mini/kinematics/analytical_kinematics.py +102 -0
  357. reachy_mini/kinematics/nn_kinematics.py +100 -0
  358. reachy_mini/kinematics/placo_kinematics.py +666 -0
  359. reachy_mini/media/__init__.py +1 -0
  360. reachy_mini/media/audio_base.py +163 -0
  361. reachy_mini/media/audio_gstreamer.py +195 -0
  362. reachy_mini/media/audio_sounddevice.py +226 -0
  363. reachy_mini/media/audio_utils.py +27 -0
  364. reachy_mini/media/camera_base.py +63 -0
  365. reachy_mini/media/camera_constants.py +13 -0
  366. reachy_mini/media/camera_gstreamer.py +162 -0
  367. reachy_mini/media/camera_opencv.py +61 -0
  368. reachy_mini/media/camera_utils.py +60 -0
  369. reachy_mini/media/media_manager.py +194 -0
  370. reachy_mini/motion/__init__.py +4 -0
  371. reachy_mini/motion/goto.py +71 -0
  372. reachy_mini/motion/move.py +36 -0
  373. reachy_mini/motion/recorded_move.py +132 -0
  374. reachy_mini/reachy_mini.py +705 -0
  375. reachy_mini/utils/__init__.py +46 -0
  376. reachy_mini/utils/constants.py +9 -0
  377. reachy_mini/utils/interpolation.py +227 -0
  378. reachy_mini/utils/parse_urdf_for_kinematics.py +110 -0
  379. reachy_mini/utils/rerun.py +546 -0
  380. reachy_mini-1.0.0.dist-info/METADATA +286 -0
  381. reachy_mini-1.0.0.dist-info/RECORD +385 -0
  382. reachy_mini-1.0.0.dist-info/WHEEL +5 -0
  383. reachy_mini-1.0.0.dist-info/entry_points.txt +3 -0
  384. reachy_mini-1.0.0.dist-info/licenses/LICENSE +201 -0
  385. reachy_mini-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,304 @@
1
+ const installedApps = {
2
+ refreshAppList: async () => {
3
+ const appsData = await installedApps.fetchInstalledApps();
4
+ await installedApps.displayInstalledApps(appsData);
5
+ },
6
+
7
+ currentlyRunningApp: null,
8
+ busy: false,
9
+ toggles: {},
10
+
11
+ startApp: async (appName) => {
12
+ if (installedApps.busy) {
13
+ console.log(`Another app is currently being started or stopped.`);
14
+ return;
15
+ }
16
+ installedApps.setBusy(true);
17
+
18
+ console.log(`Current running app: ${installedApps.currentlyRunningApp}`);
19
+
20
+ if (installedApps.currentlyRunningApp) {
21
+ console.log(`Stopping currently running app: ${installedApps.currentlyRunningApp}...`);
22
+ await installedApps.stopApp(installedApps.currentlyRunningApp, true);
23
+ }
24
+
25
+ console.log(`Starting app: ${appName}...`);
26
+ const endpoint = `/api/apps/start-app/${appName}`;
27
+ const resp = await fetch(endpoint, { method: 'POST' });
28
+ if (!resp.ok) {
29
+ console.error(`Failed to staret app ${appName}: ${resp.statusText}`);
30
+ installedApps.toggles[appName].setChecked(false);
31
+ installedApps.setBusy(false);
32
+ return;
33
+ } else {
34
+ console.log(`App ${appName} started successfully.`);
35
+ }
36
+
37
+ installedApps.currentlyRunningApp = appName;
38
+ installedApps.setBusy(false);
39
+ },
40
+
41
+ stopApp: async (appName, force = false) => {
42
+ if (installedApps.busy && !force) {
43
+ console.log(`Another app is currently being started or stopped.`);
44
+ return;
45
+ }
46
+ installedApps.setBusy(true);
47
+
48
+ console.log(`Stopping app: ${appName}...`);
49
+
50
+ if (force) {
51
+ console.log(`Force stopping app: ${appName}...`);
52
+ installedApps.toggles[appName].setChecked(false);
53
+ }
54
+
55
+ const endpoint = `/api/apps/stop-current-app`;
56
+ const resp = await fetch(endpoint, { method: 'POST' });
57
+ if (!resp.ok) {
58
+ console.error(`Failed to stop app ${appName}: ${resp.statusText}`);
59
+ installedApps.setBusy(false);
60
+ return;
61
+ } else {
62
+ console.log(`App ${appName} stopped successfully.`);
63
+ installedApps.toggles[appName].setChecked(false);
64
+ }
65
+
66
+ if (installedApps.currentlyRunningApp === appName) {
67
+ installedApps.currentlyRunningApp = null;
68
+ }
69
+ installedApps.setBusy(false);
70
+ },
71
+
72
+ setBusy: (isBusy) => {
73
+ installedApps.busy = isBusy;
74
+ for (const toggle of Object.values(installedApps.toggles)) {
75
+ if (isBusy) {
76
+ toggle.disable();
77
+ } else {
78
+ toggle.enable();
79
+ }
80
+ }
81
+ },
82
+
83
+ fetchInstalledApps: async () => {
84
+ const resp = await fetch('/api/apps/list-available/installed');
85
+ const appsData = await resp.json();
86
+ return appsData;
87
+ },
88
+
89
+ displayInstalledApps: async (appsData) => {
90
+ const appsListElement = document.getElementById('installed-apps');
91
+ appsListElement.innerHTML = '';
92
+
93
+ if (!appsData || appsData.length === 0) {
94
+ appsListElement.innerHTML = '<li>No installed apps found.</li>';
95
+ return;
96
+ }
97
+
98
+ const runningApp = await installedApps.getRunningApp();
99
+
100
+ installedApps.toggles = {};
101
+ appsData.forEach(app => {
102
+ const li = document.createElement('li');
103
+ li.className = 'app-list-item';
104
+ const isRunning = (app.name === runningApp);
105
+ li.appendChild(installedApps.createAppElement(app, isRunning));
106
+ appsListElement.appendChild(li);
107
+ });
108
+ },
109
+
110
+ createAppElement: (app, isRunning) => {
111
+ const container = document.createElement('div');
112
+ container.className = 'grid grid-cols-[auto_6rem_2rem] justify-stretch gap-x-2';
113
+
114
+ const title = document.createElement('div');
115
+ title.className = 'installed-app-title top-1/2 ';
116
+ title.innerHTML = app.name;
117
+ container.appendChild(title);
118
+
119
+ const slider = document.createElement('div');
120
+ const toggle = new ToggleSlider({
121
+ checked: isRunning,
122
+ onChange: (checked) => {
123
+ if (installedApps.busy) {
124
+ toggle.setChecked(!checked);
125
+ return;
126
+ }
127
+ if (checked) {
128
+ installedApps.startApp(app.name);
129
+ } else {
130
+ installedApps.stopApp(app.name);
131
+ }
132
+ }
133
+ });
134
+ installedApps.toggles[app.name] = toggle;
135
+ slider.appendChild(toggle.element);
136
+ container.appendChild(slider);
137
+
138
+ const remove = document.createElement('button');
139
+ remove.innerHTML = '🗑️';
140
+ remove.className = '-translate-y-1 text-xl';
141
+ container.appendChild(remove);
142
+ remove.onclick = async () => {
143
+ console.log(`Removing ${app.name}...`);
144
+ const resp = await fetch(`/api/apps/remove/${app.name}`, { method: 'POST' });
145
+ const data = await resp.json();
146
+ const jobId = data.job_id;
147
+
148
+ installedApps.appUninstallLogHandler(app.name, jobId);
149
+ };
150
+
151
+ return container;
152
+ },
153
+
154
+ getRunningApp: async () => {
155
+ const resp = await fetch('/api/apps/current-app-status');
156
+ const data = await resp.json();
157
+ if (!data) {
158
+ return null;
159
+ }
160
+ installedApps.currentlyRunningApp = data.info.name;
161
+ return data.info.name;
162
+ },
163
+
164
+ appUninstallLogHandler: async (appName, jobId) => {
165
+ const installModal = document.getElementById('install-modal');
166
+ const modalTitle = installModal.querySelector('#modal-title');
167
+ modalTitle.textContent = `Uninstalling ${appName}...`;
168
+ installModal.classList.remove('hidden');
169
+
170
+ const logsDiv = document.getElementById('install-logs');
171
+ logsDiv.textContent = '';
172
+
173
+ const closeButton = document.getElementById('modal-close-button');
174
+ closeButton.onclick = () => {
175
+ installModal.classList.add('hidden');
176
+ };
177
+ closeButton.classList = "hidden";
178
+ closeButton.textContent = '';
179
+
180
+ const ws = new WebSocket(`ws://${location.host}/api/apps/ws/apps-manager/${jobId}`);
181
+ ws.onmessage = (event) => {
182
+ try {
183
+ const data = JSON.parse(event.data);
184
+ console.log(data.status);
185
+
186
+ if (data.status === "failed") {
187
+ closeButton.classList = "text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800";
188
+ closeButton.textContent = 'Close';
189
+ console.error(`Uninstallation of ${appName} failed.`);
190
+ } else if (data.status === "done") {
191
+ closeButton.classList = "text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800";
192
+ closeButton.textContent = 'Uninstall done';
193
+ console.log(`Uninstallation of ${appName} completed.`);
194
+
195
+ }
196
+ } catch {
197
+ logsDiv.innerHTML += event.data + '\n';
198
+ logsDiv.scrollTop = logsDiv.scrollHeight;
199
+ }
200
+ };
201
+ ws.onclose = async () => {
202
+ hfAppsStore.refreshAppList();
203
+ installedApps.refreshAppList();
204
+ };
205
+ },
206
+ };
207
+
208
+ class ToggleSlider {
209
+ constructor({ checked = false, onChange = null } = {}) {
210
+ this.label = document.createElement('label');
211
+ this.label.className = 'relative inline-block w-28 h-8 cursor-pointer';
212
+
213
+ this.input = document.createElement('input');
214
+ this.input.type = 'checkbox';
215
+ this.input.className = 'sr-only peer';
216
+ this.input.checked = checked;
217
+ this.label.appendChild(this.input);
218
+
219
+ // Off label
220
+ this.offLabel = document.createElement('span');
221
+ this.offLabel.textContent = 'Off';
222
+ this.offLabel.className = 'absolute left-0 top-1/2 -translate-x-8 -translate-y-1/2 text-base select-none transition-colors duration-200 text-gray-900 peer-checked:text-gray-400';
223
+ this.label.appendChild(this.offLabel);
224
+
225
+ this.track = document.createElement('div');
226
+ this.track.className = 'absolute top-0 left-0 w-16 h-8 bg-gray-200 rounded-full transition-colors duration-200 peer-checked:bg-blue-800 dark:bg-gray-400 dark:peer-checked:bg-blue-800';
227
+ this.label.appendChild(this.track);
228
+
229
+ this.thumb = document.createElement('div');
230
+ this.thumb.className = 'absolute top-0.5 left-0.5 w-7 h-7 bg-white border border-gray-300 rounded-full transition-all duration-200';
231
+ this.track.appendChild(this.thumb);
232
+
233
+ // On label
234
+ this.onLabel = document.createElement('span');
235
+ this.onLabel.textContent = 'On';
236
+ this.onLabel.className = 'absolute right-0 top-1/2 -translate-y-1/2 -translate-x-4 text-base select-none transition-colors duration-200 text-gray-400 peer-checked:text-gray-900';
237
+ this.label.appendChild(this.onLabel);
238
+
239
+
240
+ this.input.addEventListener('change', () => {
241
+ if (this.input.checked) {
242
+ this.thumb.style.transform = 'translateX(31px)';
243
+ this.onLabel.classList.remove('text-gray-400');
244
+ this.onLabel.classList.add('text-gray-900');
245
+ this.offLabel.classList.remove('text-gray-900');
246
+ this.offLabel.classList.add('text-gray-400');
247
+ } else {
248
+ this.thumb.style.transform = 'translateX(0)';
249
+ this.onLabel.classList.remove('text-gray-900');
250
+ this.onLabel.classList.add('text-gray-400');
251
+ this.offLabel.classList.remove('text-gray-400');
252
+ this.offLabel.classList.add('text-gray-900');
253
+ }
254
+ if (onChange) onChange(this.input.checked);
255
+ });
256
+
257
+ // Set initial thumb and label color
258
+ if (checked) {
259
+ this.thumb.style.transform = 'translateX(31px)';
260
+ this.onLabel.classList.remove('text-gray-400');
261
+ this.onLabel.classList.add('text-gray-900');
262
+ } else {
263
+ this.onLabel.classList.remove('text-gray-900');
264
+ this.onLabel.classList.add('text-gray-400');
265
+ }
266
+
267
+ this.element = this.label;
268
+ }
269
+
270
+ setChecked(val) {
271
+ this.input.checked = val;
272
+ if (this.input.checked) {
273
+ this.thumb.style.transform = 'translateX(48px)';
274
+ this.onLabel.classList.remove('text-gray-400');
275
+ this.onLabel.classList.add('text-gray-900');
276
+ this.offLabel.classList.remove('text-gray-900');
277
+ this.offLabel.classList.add('text-gray-400');
278
+ } else {
279
+ this.thumb.style.transform = 'translateX(0)';
280
+ this.onLabel.classList.remove('text-gray-900');
281
+ this.onLabel.classList.add('text-gray-400');
282
+ this.offLabel.classList.remove('text-gray-400');
283
+ this.offLabel.classList.add('text-gray-900');
284
+ }
285
+ }
286
+
287
+ getChecked() {
288
+ return this.input.checked;
289
+ }
290
+
291
+ disable() {
292
+ this.input.disabled = true;
293
+ this.label.classList.add('opacity-50', 'pointer-events-none');
294
+ }
295
+
296
+ enable() {
297
+ this.input.disabled = false;
298
+ this.label.classList.remove('opacity-50', 'pointer-events-none');
299
+ }
300
+ };
301
+
302
+ window.addEventListener('load', async () => {
303
+ await installedApps.refreshAppList();
304
+ });
@@ -0,0 +1,150 @@
1
+
2
+ const hfAppsStore = {
3
+ refreshAppList: async () => {
4
+ const appsData = await hfAppsStore.fetchAvailableApps();
5
+ await hfAppsStore.displayAvailableApps(appsData);
6
+ },
7
+ fetchAvailableApps: async () => {
8
+ const resAvailable = await fetch('/api/apps/list-available');
9
+ const appsData = await resAvailable.json();
10
+ return appsData;
11
+ },
12
+
13
+ isInstalling: false,
14
+
15
+ installApp: async (app) => {
16
+ if (hfAppsStore.isInstalling) {
17
+ console.warn('An installation is already in progress.');
18
+ return;
19
+ }
20
+ hfAppsStore.isInstalling = true;
21
+
22
+ const appName = app.extra.cardData.title || app.name;
23
+ console.log(`Installing ${app.name}...`);
24
+
25
+ const resp = await fetch('/api/apps/install', {
26
+ method: 'POST',
27
+ headers: { 'Content-Type': 'application/json' },
28
+ body: JSON.stringify(app)
29
+ });
30
+ const data = await resp.json();
31
+ const jobId = data.job_id;
32
+
33
+ hfAppsStore.appInstallLogHandler(appName, jobId);
34
+ },
35
+
36
+ displayAvailableApps: async (appsData) => {
37
+ const appsListElement = document.getElementById('hf-available-apps');
38
+ appsListElement.innerHTML = '';
39
+
40
+ if (!appsData || appsData.length === 0) {
41
+ appsListElement.innerHTML = '<li>No available apps found.</li>';
42
+ return;
43
+ }
44
+
45
+ const hfApps = appsData.filter(app => app.source_kind === 'hf_space');
46
+ const installedApps = appsData.filter(app => app.source_kind === 'installed');
47
+
48
+ hfApps.forEach(app => {
49
+ const li = document.createElement('li');
50
+ li.className = 'app-list-item';
51
+ const isInstalled = installedApps.some(installedApp => installedApp.name === app.name);
52
+ li.appendChild(hfAppsStore.createAppElement(app, isInstalled));
53
+ appsListElement.appendChild(li);
54
+ });
55
+ },
56
+
57
+ createAppElement: (app, isInstalled) => {
58
+ const container = document.createElement('div');
59
+ container.className = 'grid grid-cols-[2rem_auto_8rem] justify-stretch gap-x-6';
60
+
61
+ const iconDiv = document.createElement('div');
62
+ iconDiv.className = 'hf-app-icon row-span-2 my-1';
63
+ iconDiv.textContent = app.extra.cardData.emoji || '📦';
64
+ container.appendChild(iconDiv);
65
+
66
+ const nameDiv = document.createElement('div');
67
+ nameDiv.className = 'flex flex-col';
68
+
69
+ const titleDiv = document.createElement('a');
70
+ titleDiv.href = app.url;
71
+ titleDiv.target = '_blank';
72
+ titleDiv.rel = 'noopener noreferrer';
73
+ titleDiv.className = 'hf-app-title';
74
+ titleDiv.textContent = app.extra.cardData.title || app.name;
75
+ nameDiv.appendChild(titleDiv);
76
+ const descriptionDiv = document.createElement('span');
77
+ descriptionDiv.className = 'hf-app-description';
78
+ descriptionDiv.textContent = app.description || 'No description available.';
79
+ nameDiv.appendChild(descriptionDiv);
80
+ container.appendChild(nameDiv);
81
+
82
+ const installButtonDiv = document.createElement('button');
83
+ installButtonDiv.className = 'row-span-2 my-2 hf-app-install-button';
84
+
85
+ if (isInstalled) {
86
+ installButtonDiv.classList.add('bg-gray-400', 'cursor-not-allowed');
87
+ installButtonDiv.textContent = 'Installed';
88
+ installButtonDiv.disabled = true;
89
+ } else {
90
+ installButtonDiv.classList.add('border', 'border-red-600');
91
+ installButtonDiv.textContent = 'Install';
92
+ installButtonDiv.onclick = async () => {
93
+ hfAppsStore.installApp(app);
94
+ };
95
+ }
96
+
97
+ container.appendChild(installButtonDiv);
98
+
99
+ return container;
100
+ },
101
+
102
+ appInstallLogHandler: async (appName, jobId) => {
103
+ const installModal = document.getElementById('install-modal');
104
+ const modalTitle = installModal.querySelector('#modal-title');
105
+ modalTitle.textContent = `Installing ${appName}...`;
106
+ installModal.classList.remove('hidden');
107
+
108
+ const logsDiv = document.getElementById('install-logs');
109
+ logsDiv.textContent = '';
110
+
111
+ const closeButton = document.getElementById('modal-close-button');
112
+ closeButton.onclick = () => {
113
+ installModal.classList.add('hidden');
114
+ };
115
+ closeButton.classList = "hidden";
116
+ closeButton.textContent = '';
117
+
118
+ const ws = new WebSocket(`ws://${location.host}/api/apps/ws/apps-manager/${jobId}`);
119
+ ws.onmessage = (event) => {
120
+ try {
121
+ const data = JSON.parse(event.data);
122
+ console.log(data.status);
123
+
124
+ if (data.status === "failed") {
125
+ closeButton.classList = "text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800";
126
+ closeButton.textContent = 'Close';
127
+ console.error(`Installation of ${appName} failed.`);
128
+ } else if (data.status === "done") {
129
+ closeButton.classList = "text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800";
130
+ closeButton.textContent = 'Install done';
131
+ console.log(`Installation of ${appName} completed.`);
132
+
133
+ }
134
+ } catch {
135
+ logsDiv.innerHTML += event.data + '\n';
136
+ logsDiv.scrollTop = logsDiv.scrollHeight;
137
+ }
138
+ };
139
+ ws.onclose = async () => {
140
+ hfAppsStore.isInstalling = false;
141
+ hfAppsStore.refreshAppList();
142
+ installedApps.refreshAppList();
143
+ };
144
+ },
145
+ };
146
+
147
+
148
+ window.addEventListener('load', async () => {
149
+ await hfAppsStore.refreshAppList();
150
+ });
@@ -0,0 +1,163 @@
1
+
2
+
3
+
4
+ const daemon = {
5
+ currentStatus: {},
6
+
7
+ start: async (wakeUp) => {
8
+ fetch(`/api/daemon/start?wake_up=${wakeUp}`, {
9
+ method: 'POST',
10
+ })
11
+ .then((response) => {
12
+ if (!response.ok) {
13
+ throw new Error(`HTTP error! status: ${response.status}`);
14
+ }
15
+ return response.json();
16
+ })
17
+ .then(async (data) => {
18
+ await daemon.checkStatusUpdate();
19
+ })
20
+ .catch((error) => {
21
+ console.error('Error starting daemon:', error);
22
+ });
23
+ },
24
+
25
+ stop: async (gotoSleep) => {
26
+ fetch(`/api/daemon/stop?goto_sleep=${gotoSleep}`, {
27
+ method: 'POST',
28
+ })
29
+ .then((response) => {
30
+ if (!response.ok) {
31
+ throw new Error(`HTTP error! status: ${response.status}`);
32
+ }
33
+ return response.json();
34
+ })
35
+ .then(async (data) => {
36
+ await daemon.checkStatusUpdate();
37
+ })
38
+ .catch((error) => {
39
+ console.error('Error stopping daemon:', error);
40
+ });
41
+ },
42
+
43
+ getStatus: async () => {
44
+ fetch('/api/daemon/status')
45
+ .then((response) => response.json())
46
+ .then(async (data) => {
47
+ let previousState = daemon.currentStatus.state;
48
+ daemon.currentStatus = data;
49
+
50
+ if (previousState !== daemon.currentStatus.state) {
51
+ await daemon.updateUI();
52
+ }
53
+ })
54
+ .catch((error) => {
55
+ console.error('Error fetching daemon status:', error);
56
+ });
57
+ },
58
+
59
+ checkStatusUpdate: async (initialState) => {
60
+ await daemon.getStatus();
61
+
62
+ if (!initialState) {
63
+ initialState = daemon.currentStatus.state;
64
+ }
65
+
66
+ let currentState = daemon.currentStatus.state;
67
+
68
+ if (currentState === initialState || currentState === "starting" || currentState === "stopping") {
69
+ setTimeout(() => {
70
+ daemon.checkStatusUpdate(initialState);
71
+ }, 500);
72
+ }
73
+ },
74
+
75
+ toggleSwitch: async () => {
76
+ const toggleDaemonSwitch = document.getElementById('daemon-toggle');
77
+
78
+ if (toggleDaemonSwitch.checked) {
79
+ console.log('Toggle switched ON. Starting daemon...');
80
+ await daemon.start(true);
81
+ } else {
82
+ console.log('Toggle switched OFF. Stopping daemon...');
83
+ await daemon.stop(true);
84
+ }
85
+
86
+ await daemon.updateToggle();
87
+ },
88
+
89
+ updateUI: async () => {
90
+ const daemonStatusAnim = document.getElementById('daemon-status-anim');
91
+ const toggleDaemonSwitch = document.getElementById('daemon-toggle');
92
+ const backendStatusIcon = document.getElementById('backend-status-icon');
93
+ const backendStatusText = document.getElementById('backend-status-text');
94
+
95
+ let daemonState = daemon.currentStatus.state;
96
+
97
+ toggleDaemonSwitch.disabled = false;
98
+ backendStatusIcon.classList.remove('bg-green-500', 'bg-yellow-500', 'bg-red-500');
99
+
100
+ if (daemonState === 'starting') {
101
+ // daemonStatusAnim.setAttribute('data', '/static/assets/reachy-mini-wake-up-animation.svg');
102
+ daemonStatusAnim.setAttribute('data', '/static/assets/awake-cartoon.svg');
103
+ toggleDaemonSwitch.disabled = true;
104
+ toggleDaemonSwitch.checked = true;
105
+ backendStatusIcon.classList.add('bg-yellow-500');
106
+ backendStatusText.textContent = 'Waking up...';
107
+ }
108
+ else if (daemonState === 'running') {
109
+ // daemonStatusAnim.setAttribute('data', '/static/assets/reachy-mini-awake.svg');
110
+ daemonStatusAnim.setAttribute('data', '/static/assets/awake-cartoon-static.svg');
111
+ toggleDaemonSwitch.checked = true;
112
+ backendStatusIcon.classList.add('bg-green-500');
113
+ backendStatusText.textContent = 'Up and ready';
114
+ }
115
+ else if (daemonState === 'stopping') {
116
+ // daemonStatusAnim.setAttribute('data', '/static/assets/reachy-mini-go-to-sleep-animation.svg');
117
+ daemonStatusAnim.setAttribute('data', '/static/assets/go-to-sleep-cartoon.svg');
118
+ toggleDaemonSwitch.disabled = true;
119
+ toggleDaemonSwitch.checked = false;
120
+ backendStatusIcon.classList.add('bg-yellow-500');
121
+ backendStatusText.textContent = 'Going to sleep...';
122
+ }
123
+ else if (daemonState === 'stopped' || daemonState === 'not_initialized') {
124
+ // daemonStatusAnim.setAttribute('data', '/static/assets/reachy-mini-sleeping.svg');
125
+ daemonStatusAnim.setAttribute('data', '/static/assets/reachy-mini-sleeping-static.svg');
126
+ toggleDaemonSwitch.checked = false;
127
+ backendStatusIcon.classList.add('bg-yellow-500');
128
+ backendStatusText.textContent = 'Stopped';
129
+ }
130
+ else if (daemonState === 'error') {
131
+ // daemonStatusAnim.setAttribute('data', '/static/assets/reachy-mini-ko-animation.svg');
132
+ daemonStatusAnim.setAttribute('data', '/static/assets/no-wifi-cartoon.svg');
133
+ toggleDaemonSwitch.checked = false;
134
+ backendStatusIcon.classList.add('bg-red-500');
135
+ backendStatusText.textContent = 'Error occurred';
136
+ }
137
+
138
+ await daemon.updateToggle();
139
+ },
140
+
141
+ updateToggle: async () => {
142
+ const toggle = document.getElementById('daemon-toggle');
143
+ const toggleSlider = document.getElementById('daemon-toggle-slider');
144
+ const toggleOnLabel = document.getElementById('daemon-toggle-on');
145
+ const toggleOffLabel = document.getElementById('daemon-toggle-off');
146
+
147
+ toggleSlider.classList.remove('hidden');
148
+
149
+ if (toggle.checked) {
150
+ toggleOnLabel.classList.remove('hidden');
151
+ toggleOffLabel.classList.add('hidden');
152
+ } else {
153
+ toggleOnLabel.classList.add('hidden');
154
+ toggleOffLabel.classList.remove('hidden');
155
+ }
156
+ },
157
+ };
158
+
159
+
160
+ window.addEventListener('load', async () => {
161
+ document.getElementById('daemon-toggle').onchange = daemon.toggleSwitch;
162
+ await daemon.getStatus();
163
+ });