reachy-mini 1.2.5rc1__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.
- reachy_mini/__init__.py +4 -0
- reachy_mini/apps/__init__.py +25 -0
- reachy_mini/apps/app.py +258 -0
- reachy_mini/apps/assistant.py +787 -0
- reachy_mini/apps/manager.py +312 -0
- reachy_mini/apps/sources/__init__.py +4 -0
- reachy_mini/apps/sources/hf_space.py +106 -0
- reachy_mini/apps/sources/local_common_venv.py +567 -0
- reachy_mini/apps/templates/README.md.j2 +12 -0
- reachy_mini/apps/templates/gitignore.j2 +3 -0
- reachy_mini/apps/templates/index.html.j2 +40 -0
- reachy_mini/apps/templates/main.py.j2 +74 -0
- reachy_mini/apps/templates/pyproject.toml.j2 +28 -0
- reachy_mini/apps/templates/static/index.html.j2 +27 -0
- reachy_mini/apps/templates/static/main.js.j2 +47 -0
- reachy_mini/apps/templates/static/style.css.j2 +25 -0
- reachy_mini/apps/templates/style.css.j2 +411 -0
- reachy_mini/apps/utils.py +30 -0
- reachy_mini/assets/config/hardware_config.yaml +164 -0
- reachy_mini/assets/confused1.wav +0 -0
- reachy_mini/assets/count.wav +0 -0
- reachy_mini/assets/dance1.wav +0 -0
- reachy_mini/assets/firmware/CHANGELOG.md +15 -0
- reachy_mini/assets/firmware/reachymini_ua_io16_lin_v2.1.2.bin +0 -0
- reachy_mini/assets/firmware/reachymini_ua_io16_lin_v2.1.3.bin +0 -0
- reachy_mini/assets/firmware/update.sh +9 -0
- reachy_mini/assets/go_sleep.wav +0 -0
- reachy_mini/assets/impatient1.wav +0 -0
- reachy_mini/assets/kinematics_data.json +253 -0
- reachy_mini/assets/models/fknetwork.dynamic.onnx +0 -0
- reachy_mini/assets/models/fknetwork.onnx +0 -0
- reachy_mini/assets/models/fknetwork_int8.onnx +0 -0
- reachy_mini/assets/models/iknetwork.onnx +0 -0
- reachy_mini/assets/wake_up.wav +0 -0
- reachy_mini/daemon/__init__.py +1 -0
- reachy_mini/daemon/app/__init__.py +1 -0
- reachy_mini/daemon/app/bg_job_register.py +142 -0
- reachy_mini/daemon/app/dashboard/static/assets/KO-cartoon-static.svg +40 -0
- reachy_mini/daemon/app/dashboard/static/assets/awake-cartoon-static.svg +42 -0
- reachy_mini/daemon/app/dashboard/static/assets/awake-cartoon.svg +6 -0
- reachy_mini/daemon/app/dashboard/static/assets/go-to-sleep-cartoon.svg +6 -0
- reachy_mini/daemon/app/dashboard/static/assets/no-wifi-cartoon-static.svg +50 -0
- reachy_mini/daemon/app/dashboard/static/assets/no-wifi-cartoon.svg +6 -0
- reachy_mini/daemon/app/dashboard/static/assets/reachy-mini-awake.svg +18 -0
- reachy_mini/daemon/app/dashboard/static/assets/reachy-mini-connection-lost-animation.svg +6 -0
- reachy_mini/daemon/app/dashboard/static/assets/reachy-mini-go-to-sleep-animation.svg +6 -0
- reachy_mini/daemon/app/dashboard/static/assets/reachy-mini-ko-animation.svg +6 -0
- reachy_mini/daemon/app/dashboard/static/assets/reachy-mini-ko.svg +22 -0
- reachy_mini/daemon/app/dashboard/static/assets/reachy-mini-sleeping-static.svg +41 -0
- reachy_mini/daemon/app/dashboard/static/assets/reachy-mini-sleeping.svg +18 -0
- reachy_mini/daemon/app/dashboard/static/assets/reachy-mini-wake-up-animation.svg +6 -0
- reachy_mini/daemon/app/dashboard/static/css/app.css +1433 -0
- reachy_mini/daemon/app/dashboard/static/fonts/Archivo-Italic-VariableFont_wdth,wght.ttf +0 -0
- reachy_mini/daemon/app/dashboard/static/fonts/Archivo-VariableFont_wdth,wght.ttf +0 -0
- reachy_mini/daemon/app/dashboard/static/fonts/Asap-Italic-VariableFont_wdth,wght.ttf +0 -0
- reachy_mini/daemon/app/dashboard/static/fonts/Asap-VariableFont_wdth,wght.ttf +0 -0
- reachy_mini/daemon/app/dashboard/static/js/3rdparty/gstwebrtc-api-2.0.0.min.js +5 -0
- reachy_mini/daemon/app/dashboard/static/js/apps.js +323 -0
- reachy_mini/daemon/app/dashboard/static/js/appstore.js +167 -0
- reachy_mini/daemon/app/dashboard/static/js/daemon.js +169 -0
- reachy_mini/daemon/app/dashboard/static/js/health_check.js +9 -0
- reachy_mini/daemon/app/dashboard/static/js/move_player.js +132 -0
- reachy_mini/daemon/app/dashboard/static/js/notification.js +41 -0
- reachy_mini/daemon/app/dashboard/static/js/update.js +132 -0
- reachy_mini/daemon/app/dashboard/static/js/volume_control.js +252 -0
- reachy_mini/daemon/app/dashboard/static/js/wifi.js +176 -0
- reachy_mini/daemon/app/dashboard/tailwindcss/README.md +15 -0
- reachy_mini/daemon/app/dashboard/tailwindcss/package-lock.json +1127 -0
- reachy_mini/daemon/app/dashboard/tailwindcss/package.json +6 -0
- reachy_mini/daemon/app/dashboard/tailwindcss/pnpm-lock.yaml +608 -0
- reachy_mini/daemon/app/dashboard/tailwindcss/postcss.config.js +6 -0
- reachy_mini/daemon/app/dashboard/tailwindcss/styles/app.css +185 -0
- reachy_mini/daemon/app/dashboard/tailwindcss/tailwind.config.js +11 -0
- reachy_mini/daemon/app/dashboard/templates/base.html +21 -0
- reachy_mini/daemon/app/dashboard/templates/index.html +20 -0
- reachy_mini/daemon/app/dashboard/templates/sections/apps.html +8 -0
- reachy_mini/daemon/app/dashboard/templates/sections/appstore.html +35 -0
- reachy_mini/daemon/app/dashboard/templates/sections/daemon.html +45 -0
- reachy_mini/daemon/app/dashboard/templates/sections/move_player.html +121 -0
- reachy_mini/daemon/app/dashboard/templates/sections/notification.html +19 -0
- reachy_mini/daemon/app/dashboard/templates/sections/update.html +54 -0
- reachy_mini/daemon/app/dashboard/templates/sections/wifi.html +46 -0
- reachy_mini/daemon/app/dashboard/templates/settings.html +14 -0
- reachy_mini/daemon/app/dependencies.py +41 -0
- reachy_mini/daemon/app/main.py +469 -0
- reachy_mini/daemon/app/models.py +149 -0
- reachy_mini/daemon/app/routers/apps.py +114 -0
- reachy_mini/daemon/app/routers/daemon.py +85 -0
- reachy_mini/daemon/app/routers/kinematics.py +57 -0
- reachy_mini/daemon/app/routers/motors.py +41 -0
- reachy_mini/daemon/app/routers/move.py +265 -0
- reachy_mini/daemon/app/routers/state.py +146 -0
- reachy_mini/daemon/app/routers/update.py +86 -0
- reachy_mini/daemon/app/routers/volume.py +423 -0
- reachy_mini/daemon/app/routers/wifi_config.py +219 -0
- reachy_mini/daemon/app/services/__init__.py +1 -0
- reachy_mini/daemon/app/services/bluetooth/bluetooth_service.py +796 -0
- reachy_mini/daemon/app/services/bluetooth/commands/HOTSPOT.sh +7 -0
- reachy_mini/daemon/app/services/bluetooth/commands/RESTART_DAEMON.sh +4 -0
- reachy_mini/daemon/app/services/bluetooth/commands/SOFTWARE_RESET.sh +7 -0
- reachy_mini/daemon/app/services/bluetooth/install_service_bluetooth.sh +39 -0
- reachy_mini/daemon/app/services/gpio_shutdown/__init__.py +1 -0
- reachy_mini/daemon/app/services/gpio_shutdown/install_service.sh +33 -0
- reachy_mini/daemon/app/services/gpio_shutdown/launcher.sh +3 -0
- reachy_mini/daemon/app/services/gpio_shutdown/shutdown_monitor.py +28 -0
- reachy_mini/daemon/app/services/wireless/generate_asoundrc.sh +70 -0
- reachy_mini/daemon/app/services/wireless/install_service.sh +33 -0
- reachy_mini/daemon/app/services/wireless/launcher.sh +5 -0
- reachy_mini/daemon/backend/__init__.py +1 -0
- reachy_mini/daemon/backend/abstract.py +815 -0
- reachy_mini/daemon/backend/mujoco/__init__.py +36 -0
- reachy_mini/daemon/backend/mujoco/backend.py +395 -0
- reachy_mini/daemon/backend/mujoco/utils.py +59 -0
- reachy_mini/daemon/backend/mujoco/video_udp.py +57 -0
- reachy_mini/daemon/backend/robot/__init__.py +8 -0
- reachy_mini/daemon/backend/robot/backend.py +597 -0
- reachy_mini/daemon/daemon.py +651 -0
- reachy_mini/daemon/utils.py +116 -0
- reachy_mini/descriptions/reachy_mini/mjcf/additional.xml +6 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/5w_speaker.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/5w_speaker.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna_body_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna_body_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna_holder_l_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna_holder_l_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna_holder_r_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna_holder_r_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna_interface_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/antenna_interface_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/arducam.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/arducam.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/b3b_eh.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/b3b_eh.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/b3b_eh_1.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/b3b_eh_1.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/bearing_85x110x13.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/bearing_85x110x13.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/big_lens_d40.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/big_lens_d40.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/body_down_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/body_down_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/body_foot_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/body_foot_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/body_top_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/body_top_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/body_turning_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/body_turning_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/bts2_m2_6x8.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/bts2_m2_6x8.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/collision/README.m +1 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/collision/coarse/body_top_3dprint_collider_back_0.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/collision/coarse/body_top_3dprint_collider_back_1.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/collision/coarse/body_top_3dprint_collider_back_2.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/collision/coarse/body_top_3dprint_collider_back_3.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/collision/coarse/body_top_3dprint_collider_front_0.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/collision/coarse/body_top_3dprint_collider_front_1.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/collision/coarse/body_top_3dprint_collider_front_2.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/collision/coarse/head_one_3dprint_collider_0.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/collision/fine/body_top_3dprint_collider_back_0.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/collision/fine/body_top_3dprint_collider_back_1.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/collision/fine/body_top_3dprint_collider_back_2.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/collision/fine/body_top_3dprint_collider_back_3.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/collision/fine/body_top_3dprint_collider_front_0.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/collision/fine/body_top_3dprint_collider_front_1.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/collision/fine/body_top_3dprint_collider_front_2.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/collision/fine/head_one_3dprint_collider_0.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/croissant_1k.blend/croissant_1k.obj +5021 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/croissant_1k.blend/textures/croissant_diff_1k.png +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_case_b_dummy.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_case_b_dummy.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_case_f_dummy.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_case_f_dummy.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_case_m_dummy.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_case_m_dummy.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_horn_dummy.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_horn_dummy.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_led_cap2_dummy.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/dc15_a01_led_cap2_dummy.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/food_apple_01_1k.blend/food_apple_01_1k.obj +18045 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/food_apple_01_1k.blend/textures/food_apple_01_diff_1k.png +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/glasses_dolder_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/glasses_dolder_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/head_back_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/head_back_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/head_front_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/head_front_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/head_mic_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/head_mic_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/lens_cap_d30_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/lens_cap_d30_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/lens_cap_d40_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/lens_cap_d40_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/m12_fisheye_lens_1_8mm.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/m12_fisheye_lens_1_8mm.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/mp01062_stewart_arm_3.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/mp01062_stewart_arm_3.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/neck_reference_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/neck_reference_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/phs_1_7x20_5_dc10.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/phs_1_7x20_5_dc10.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/phs_1_7x20_5_dc10_1.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/phs_1_7x20_5_dc10_1.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/phs_1_7x20_5_dc10_2.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/phs_1_7x20_5_dc10_2.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/phs_1_7x20_5_dc10_3.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/phs_1_7x20_5_dc10_3.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/pp01102_arducam_carter.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/pp01102_arducam_carter.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/rubber_duck_toy_1k.blend/rubber_duck_toy_1k.obj +8940 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/rubber_duck_toy_1k.blend/textures/rubber_duck_toy_diff_1k.png +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/small_lens_d30.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/small_lens_d30.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_link_ball.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_link_ball.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_link_ball__2.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_link_ball__2.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_link_rod.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_link_rod.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_main_plate_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_main_plate_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_tricap_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/stewart_tricap_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/wooden_table_02_1k.blend/textures/wooden_table_02_diff_1k.png +0 -0
- reachy_mini/descriptions/reachy_mini/mjcf/assets/wooden_table_02_1k.blend/wooden_table_02_1k.obj +485 -0
- reachy_mini/descriptions/reachy_mini/mjcf/config.json +21 -0
- reachy_mini/descriptions/reachy_mini/mjcf/joints_properties.xml +29 -0
- reachy_mini/descriptions/reachy_mini/mjcf/reachy_mini.xml +642 -0
- reachy_mini/descriptions/reachy_mini/mjcf/reachy_mini.xml.bak +442 -0
- reachy_mini/descriptions/reachy_mini/mjcf/scene.xml +24 -0
- reachy_mini/descriptions/reachy_mini/mjcf/scenes/empty.xml +27 -0
- reachy_mini/descriptions/reachy_mini/mjcf/scenes/minimal.xml +132 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/5w_speaker.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/5w_speaker.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/antenna.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/antenna.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/antenna_body_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/antenna_body_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/antenna_holder_l_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/antenna_holder_l_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/antenna_holder_r_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/antenna_holder_r_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/antenna_interface_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/antenna_interface_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/arducam.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/arducam.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/arm.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/arm.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/b3b_eh.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/b3b_eh.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/b3b_eh_1.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/b3b_eh_1.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/ball.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/ball.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/bearing_85x110x13.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/bearing_85x110x13.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/big_lens.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/big_lens.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/big_lens_d40.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/big_lens_d40.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/body_down_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/body_down_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/body_foot_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/body_foot_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/body_top_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/body_top_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/body_turning_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/body_turning_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/bottom_body.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/bottom_body.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/bts2_m2_6x8.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/bts2_m2_6x8.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/collision/README.m +1 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/collision/coarse/body_top_3dprint_collider_back_0.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/collision/coarse/body_top_3dprint_collider_back_1.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/collision/coarse/body_top_3dprint_collider_back_2.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/collision/coarse/body_top_3dprint_collider_back_3.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/collision/coarse/body_top_3dprint_collider_front_0.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/collision/coarse/body_top_3dprint_collider_front_1.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/collision/coarse/body_top_3dprint_collider_front_2.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/collision/coarse/head_one_3dprint_collider_0.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/collision/fine/body_top_3dprint_collider_back_0.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/collision/fine/body_top_3dprint_collider_back_1.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/collision/fine/body_top_3dprint_collider_back_2.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/collision/fine/body_top_3dprint_collider_back_3.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/collision/fine/body_top_3dprint_collider_front_0.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/collision/fine/body_top_3dprint_collider_front_1.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/collision/fine/body_top_3dprint_collider_front_2.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/collision/fine/head_one_3dprint_collider_0.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_case_b_dummy.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_case_b_dummy.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_case_f_dummy.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_case_f_dummy.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_case_m_dummy.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_case_m_dummy.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_horn_dummy.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_horn_dummy.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_led_cap2_dummy.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/dc15_a01_led_cap2_dummy.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/drive_palonier__configuration_default.part +14 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/drive_palonier__configuration_default.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/drive_palonier__configuration_simple_axe.part +14 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/drive_palonier__configuration_simple_axe.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/eye_support.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/eye_support.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/foot.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/foot.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/glasses_dolder_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/glasses_dolder_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/head_back_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/head_back_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/head_front_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/head_front_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/head_head_back.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/head_head_back.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/head_interface.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/head_interface.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/head_mic_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/head_mic_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/head_shell_front.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/head_shell_front.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/lens_cap_d30_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/lens_cap_d30_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/lens_cap_d40_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/lens_cap_d40_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/m12_fisheye_lens_1_8mm.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/m12_fisheye_lens_1_8mm.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/m12_lens.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/m12_lens.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/main_plate.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/main_plate.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/mid_plate.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/mid_plate.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/mp01062_stewart_arm_3.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/mp01062_stewart_arm_3.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/neck_reference_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/neck_reference_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/phs_1_7x20_5_dc10.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/phs_1_7x20_5_dc10.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/phs_1_7x20_5_dc10_1.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/phs_1_7x20_5_dc10_1.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/phs_1_7x20_5_dc10_2.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/phs_1_7x20_5_dc10_2.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/phs_1_7x20_5_dc10_3.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/phs_1_7x20_5_dc10_3.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/plateform.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/plateform.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp00xxx_stewart_rod.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp00xxx_stewart_rod.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01062_stewart_arm.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01062_stewart_arm.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01063_stewart_plateform.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01063_stewart_plateform.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01064_stewart_main_plate.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01064_stewart_main_plate.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01065_stewart_side_plate.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01065_stewart_side_plate.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01066_stewart_mid_plate.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01066_stewart_mid_plate.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01067_bottom_body.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01067_bottom_body.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01068_top_body.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01068_top_body.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01069_head_shell_front.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01069_head_shell_front.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01070_head_head_back.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01070_head_head_back.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01071_turning_bowl.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01071_turning_bowl.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01072_turning_end.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01072_turning_end.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01078_glasses.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01078_glasses.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01079_back_big_eye.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01079_back_big_eye.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01080_back_small_eye.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01080_back_small_eye.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01102_arducam_carter.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/pp01102_arducam_carter.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/rod.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/rod.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/shape.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/shape.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/side_plate.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/side_plate.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/small_lens.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/small_lens.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/small_lens_d30.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/small_lens_d30.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_link_ball.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_link_ball.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_link_ball__2.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_link_ball__2.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_link_rod.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_link_rod.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_main_plate_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_main_plate_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_tricap_3dprint.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/stewart_tricap_3dprint.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/test_antenna.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/test_antenna.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/test_antenna_body.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/test_antenna_body.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/top_body.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/top_body.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/turning_bowl.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/turning_bowl.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/uc_a37_rev_a_step.part +13 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/uc_a37_rev_a_step.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0122topcabinetcase_95__configuration_default.part +14 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0122topcabinetcase_95__configuration_default.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0122topcabinetcase_95__configuration_simple_axe.part +14 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0122topcabinetcase_95__configuration_simple_axe.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0123middlecase_56__configuration_default.part +14 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0123middlecase_56__configuration_default.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0123middlecase_56__configuration_simple_axe.part +14 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0123middlecase_56__configuration_simple_axe.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0124bottomcase_45__configuration_default.part +14 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0124bottomcase_45__configuration_default.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0124bottomcase_45__configuration_simple_axe.part +14 -0
- reachy_mini/descriptions/reachy_mini/urdf/assets/wj_wk00_0124bottomcase_45__configuration_simple_axe.stl +0 -0
- reachy_mini/descriptions/reachy_mini/urdf/config.json +18 -0
- reachy_mini/descriptions/reachy_mini/urdf/robot.urdf +3281 -0
- reachy_mini/descriptions/reachy_mini/urdf/robot.urdf.bak +3282 -0
- reachy_mini/descriptions/reachy_mini/urdf/robot_no_collision.urdf +2316 -0
- reachy_mini/descriptions/reachy_mini/urdf/robot_simple_collision.urdf +2399 -0
- reachy_mini/io/__init__.py +15 -0
- reachy_mini/io/abstract.py +70 -0
- reachy_mini/io/audio_ws.py +242 -0
- reachy_mini/io/protocol.py +44 -0
- reachy_mini/io/video_ws.py +135 -0
- reachy_mini/io/ws_controller.py +120 -0
- reachy_mini/io/zenoh_client.py +273 -0
- reachy_mini/io/zenoh_server.py +230 -0
- reachy_mini/kinematics/__init__.py +68 -0
- reachy_mini/kinematics/analytical_kinematics.py +151 -0
- reachy_mini/kinematics/nn_kinematics.py +109 -0
- reachy_mini/kinematics/placo_kinematics.py +656 -0
- reachy_mini/media/__init__.py +1 -0
- reachy_mini/media/audio_base.py +111 -0
- reachy_mini/media/audio_control_utils.py +455 -0
- reachy_mini/media/audio_gstreamer.py +272 -0
- reachy_mini/media/audio_sounddevice.py +321 -0
- reachy_mini/media/audio_utils.py +114 -0
- reachy_mini/media/camera_base.py +100 -0
- reachy_mini/media/camera_constants.py +152 -0
- reachy_mini/media/camera_gstreamer.py +231 -0
- reachy_mini/media/camera_opencv.py +89 -0
- reachy_mini/media/camera_utils.py +111 -0
- reachy_mini/media/media_manager.py +281 -0
- reachy_mini/media/webrtc_client_gstreamer.py +288 -0
- reachy_mini/media/webrtc_daemon.py +334 -0
- reachy_mini/motion/__init__.py +4 -0
- reachy_mini/motion/goto.py +71 -0
- reachy_mini/motion/move.py +43 -0
- reachy_mini/motion/recorded_move.py +146 -0
- reachy_mini/reachy_mini.py +753 -0
- reachy_mini/tools/reflash_motors.py +116 -0
- reachy_mini/tools/setup_motor.py +422 -0
- reachy_mini/tools/setup_motor_rpi.py +108 -0
- reachy_mini/utils/__init__.py +46 -0
- reachy_mini/utils/constants.py +9 -0
- reachy_mini/utils/hardware_config/__init__.py +1 -0
- reachy_mini/utils/hardware_config/parser.py +65 -0
- reachy_mini/utils/interpolation.py +227 -0
- reachy_mini/utils/parse_urdf_for_kinematics.py +110 -0
- reachy_mini/utils/rerun.py +320 -0
- reachy_mini/utils/wireless_version/__init__.py +1 -0
- reachy_mini/utils/wireless_version/startup_check.py +144 -0
- reachy_mini/utils/wireless_version/update.py +20 -0
- reachy_mini/utils/wireless_version/update_available.py +61 -0
- reachy_mini/utils/wireless_version/utils.py +39 -0
- reachy_mini-1.2.5rc1.dist-info/METADATA +161 -0
- reachy_mini-1.2.5rc1.dist-info/RECORD +479 -0
- reachy_mini-1.2.5rc1.dist-info/WHEEL +5 -0
- reachy_mini-1.2.5rc1.dist-info/entry_points.txt +4 -0
- reachy_mini-1.2.5rc1.dist-info/licenses/LICENSE +201 -0
- reachy_mini-1.2.5rc1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"""Apps router for apps management."""
|
|
2
|
+
|
|
3
|
+
from fastapi import (
|
|
4
|
+
APIRouter,
|
|
5
|
+
Depends,
|
|
6
|
+
HTTPException,
|
|
7
|
+
WebSocket,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
from reachy_mini.apps import AppInfo, SourceKind
|
|
11
|
+
from reachy_mini.apps.manager import AppManager, AppStatus
|
|
12
|
+
from reachy_mini.daemon.app import bg_job_register
|
|
13
|
+
from reachy_mini.daemon.app.dependencies import get_app_manager
|
|
14
|
+
|
|
15
|
+
router = APIRouter(prefix="/apps")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@router.get("/list-available/{source_kind}")
|
|
19
|
+
async def list_available_apps(
|
|
20
|
+
source_kind: SourceKind,
|
|
21
|
+
app_manager: "AppManager" = Depends(get_app_manager),
|
|
22
|
+
) -> list[AppInfo]:
|
|
23
|
+
"""List available apps (including not installed)."""
|
|
24
|
+
return await app_manager.list_available_apps(source_kind)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@router.get("/list-available")
|
|
28
|
+
async def list_all_available_apps(
|
|
29
|
+
app_manager: "AppManager" = Depends(get_app_manager),
|
|
30
|
+
) -> list[AppInfo]:
|
|
31
|
+
"""List all available apps (including not installed)."""
|
|
32
|
+
return await app_manager.list_all_available_apps()
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@router.post("/install")
|
|
36
|
+
async def install_app(
|
|
37
|
+
app_info: AppInfo,
|
|
38
|
+
app_manager: "AppManager" = Depends(get_app_manager),
|
|
39
|
+
) -> dict[str, str]:
|
|
40
|
+
"""Install a new app by its info (background, returns job_id)."""
|
|
41
|
+
job_id = bg_job_register.run_command(
|
|
42
|
+
"install", app_manager.install_new_app, app_info
|
|
43
|
+
)
|
|
44
|
+
return {"job_id": job_id}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@router.post("/remove/{app_name}")
|
|
48
|
+
async def remove_app(
|
|
49
|
+
app_name: str,
|
|
50
|
+
app_manager: "AppManager" = Depends(get_app_manager),
|
|
51
|
+
) -> dict[str, str]:
|
|
52
|
+
"""Remove an installed app by its name (background, returns job_id)."""
|
|
53
|
+
job_id = bg_job_register.run_command("remove", app_manager.remove_app, app_name)
|
|
54
|
+
return {"job_id": job_id}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
@router.get("/job-status/{job_id}")
|
|
58
|
+
async def job_status(job_id: str) -> bg_job_register.JobInfo:
|
|
59
|
+
"""Get status/logs for a job."""
|
|
60
|
+
try:
|
|
61
|
+
return bg_job_register.get_info(job_id)
|
|
62
|
+
except Exception as e:
|
|
63
|
+
raise HTTPException(status_code=404, detail=str(e))
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
# WebSocket route for live job status/logs
|
|
67
|
+
@router.websocket("/ws/apps-manager/{job_id}")
|
|
68
|
+
async def ws_apps_manager(websocket: WebSocket, job_id: str) -> None:
|
|
69
|
+
"""WebSocket route to stream live job status/logs for a job, sending updates as soon as new logs are available."""
|
|
70
|
+
await websocket.accept()
|
|
71
|
+
await bg_job_register.ws_poll_info(websocket, job_id)
|
|
72
|
+
await websocket.close()
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@router.post("/start-app/{app_name}")
|
|
76
|
+
async def start_app(
|
|
77
|
+
app_name: str,
|
|
78
|
+
app_manager: "AppManager" = Depends(get_app_manager),
|
|
79
|
+
) -> AppStatus:
|
|
80
|
+
"""Start an app by its name."""
|
|
81
|
+
try:
|
|
82
|
+
return await app_manager.start_app(app_name)
|
|
83
|
+
except RuntimeError as e:
|
|
84
|
+
raise HTTPException(status_code=400, detail=str(e))
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
@router.post("/restart-current-app")
|
|
88
|
+
async def restart_app(
|
|
89
|
+
app_manager: "AppManager" = Depends(get_app_manager),
|
|
90
|
+
) -> AppStatus:
|
|
91
|
+
"""Restart the currently running app."""
|
|
92
|
+
try:
|
|
93
|
+
return await app_manager.restart_current_app()
|
|
94
|
+
except RuntimeError as e:
|
|
95
|
+
raise HTTPException(status_code=400, detail=str(e))
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
@router.post("/stop-current-app")
|
|
99
|
+
async def stop_app(
|
|
100
|
+
app_manager: "AppManager" = Depends(get_app_manager),
|
|
101
|
+
) -> None:
|
|
102
|
+
"""Stop the currently running app."""
|
|
103
|
+
try:
|
|
104
|
+
return await app_manager.stop_current_app()
|
|
105
|
+
except RuntimeError as e:
|
|
106
|
+
raise HTTPException(status_code=400, detail=str(e))
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
@router.get("/current-app-status")
|
|
110
|
+
async def current_app_status(
|
|
111
|
+
app_manager: "AppManager" = Depends(get_app_manager),
|
|
112
|
+
) -> AppStatus | None:
|
|
113
|
+
"""Get the status of the currently running app, if any."""
|
|
114
|
+
return await app_manager.current_app_status()
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"""Daemon-related API routes."""
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
import threading
|
|
5
|
+
|
|
6
|
+
from fastapi import APIRouter, Depends, HTTPException, Request
|
|
7
|
+
|
|
8
|
+
from reachy_mini.daemon.app import bg_job_register
|
|
9
|
+
|
|
10
|
+
from ...daemon import Daemon, DaemonStatus
|
|
11
|
+
from ..dependencies import get_daemon
|
|
12
|
+
|
|
13
|
+
router = APIRouter(
|
|
14
|
+
prefix="/daemon",
|
|
15
|
+
)
|
|
16
|
+
busy_lock = threading.Lock()
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@router.post("/start")
|
|
20
|
+
async def start_daemon(
|
|
21
|
+
request: Request,
|
|
22
|
+
wake_up: bool,
|
|
23
|
+
daemon: Daemon = Depends(get_daemon),
|
|
24
|
+
) -> dict[str, str]:
|
|
25
|
+
"""Start the daemon."""
|
|
26
|
+
if busy_lock.locked():
|
|
27
|
+
raise HTTPException(status_code=409, detail="Daemon is busy.")
|
|
28
|
+
|
|
29
|
+
async def start(logger: logging.Logger) -> None:
|
|
30
|
+
with busy_lock:
|
|
31
|
+
await daemon.start(
|
|
32
|
+
sim=request.app.state.args.sim,
|
|
33
|
+
serialport=request.app.state.args.serialport,
|
|
34
|
+
scene=request.app.state.args.scene,
|
|
35
|
+
localhost_only=request.app.state.args.localhost_only,
|
|
36
|
+
wake_up_on_start=wake_up,
|
|
37
|
+
check_collision=request.app.state.args.check_collision,
|
|
38
|
+
kinematics_engine=request.app.state.args.kinematics_engine,
|
|
39
|
+
headless=request.app.state.args.headless,
|
|
40
|
+
websocket_uri=request.app.state.args.websocket_uri,
|
|
41
|
+
stream_media=request.app.state.args.stream_media,
|
|
42
|
+
use_audio=request.app.state.args.use_audio,
|
|
43
|
+
hardware_config_filepath=request.app.state.args.hardware_config_filepath,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
job_id = bg_job_register.run_command("daemon-start", start)
|
|
47
|
+
return {"job_id": job_id}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@router.post("/stop")
|
|
51
|
+
async def stop_daemon(
|
|
52
|
+
goto_sleep: bool, daemon: Daemon = Depends(get_daemon)
|
|
53
|
+
) -> dict[str, str]:
|
|
54
|
+
"""Stop the daemon, optionally putting the robot to sleep."""
|
|
55
|
+
if busy_lock.locked():
|
|
56
|
+
raise HTTPException(status_code=409, detail="Daemon is busy.")
|
|
57
|
+
|
|
58
|
+
async def stop(logger: logging.Logger) -> None:
|
|
59
|
+
with busy_lock:
|
|
60
|
+
await daemon.stop(goto_sleep_on_stop=goto_sleep)
|
|
61
|
+
|
|
62
|
+
job_id = bg_job_register.run_command("daemon-stop", stop)
|
|
63
|
+
return {"job_id": job_id}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
@router.post("/restart")
|
|
67
|
+
async def restart_daemon(
|
|
68
|
+
request: Request, daemon: Daemon = Depends(get_daemon)
|
|
69
|
+
) -> dict[str, str]:
|
|
70
|
+
"""Restart the daemon."""
|
|
71
|
+
if busy_lock.locked():
|
|
72
|
+
raise HTTPException(status_code=409, detail="Daemon is busy.")
|
|
73
|
+
|
|
74
|
+
async def restart(logger: logging.Logger) -> None:
|
|
75
|
+
with busy_lock:
|
|
76
|
+
await daemon.restart()
|
|
77
|
+
|
|
78
|
+
job_id = bg_job_register.run_command("daemon-restart", restart)
|
|
79
|
+
return {"job_id": job_id}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
@router.get("/status")
|
|
83
|
+
async def get_daemon_status(daemon: Daemon = Depends(get_daemon)) -> DaemonStatus:
|
|
84
|
+
"""Get the current status of the daemon."""
|
|
85
|
+
return daemon.status()
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""Kinematics router for handling kinematics-related requests.
|
|
2
|
+
|
|
3
|
+
This module defines the API endpoints for interacting with the kinematics
|
|
4
|
+
subsystem of the robot. It provides endpoints for retrieving URDF representation,
|
|
5
|
+
and other kinematics-related information.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
from typing import Any
|
|
10
|
+
|
|
11
|
+
from fastapi import APIRouter, Depends, HTTPException, Response
|
|
12
|
+
|
|
13
|
+
from ....daemon.backend.abstract import Backend
|
|
14
|
+
from ..dependencies import get_backend
|
|
15
|
+
|
|
16
|
+
router = APIRouter(
|
|
17
|
+
prefix="/kinematics",
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
STL_ASSETS_DIR = (
|
|
21
|
+
Path(__file__).parent.parent.parent.parent
|
|
22
|
+
/ "descriptions"
|
|
23
|
+
/ "reachy_mini"
|
|
24
|
+
/ "urdf"
|
|
25
|
+
/ "assets"
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@router.get("/info")
|
|
30
|
+
async def get_kinematics_info(
|
|
31
|
+
backend: Backend = Depends(get_backend),
|
|
32
|
+
) -> dict[str, Any]:
|
|
33
|
+
"""Get the current information of the kinematics."""
|
|
34
|
+
return {
|
|
35
|
+
"info": {
|
|
36
|
+
"engine": backend.kinematics_engine,
|
|
37
|
+
"collision check": backend.check_collision,
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@router.get("/urdf")
|
|
43
|
+
async def get_urdf(backend: Backend = Depends(get_backend)) -> dict[str, str]:
|
|
44
|
+
"""Get the URDF representation of the robot."""
|
|
45
|
+
return {"urdf": backend.get_urdf()}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@router.get("/stl/{filename}")
|
|
49
|
+
async def get_stl_file(filename: Path) -> Response:
|
|
50
|
+
"""Get the path to an STL asset file."""
|
|
51
|
+
file_path = STL_ASSETS_DIR / filename
|
|
52
|
+
try:
|
|
53
|
+
with open(file_path, "rb") as file:
|
|
54
|
+
content = file.read()
|
|
55
|
+
return Response(content, media_type="model/stl")
|
|
56
|
+
except FileNotFoundError:
|
|
57
|
+
raise HTTPException(status_code=404, detail=f"STL file not found {file_path}")
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Motors router.
|
|
2
|
+
|
|
3
|
+
Provides endpoints to get and set the motor control mode.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from fastapi import APIRouter, Depends
|
|
7
|
+
from pydantic import BaseModel
|
|
8
|
+
|
|
9
|
+
from ....daemon.backend.abstract import Backend, MotorControlMode
|
|
10
|
+
from ..dependencies import get_backend
|
|
11
|
+
|
|
12
|
+
router = APIRouter(
|
|
13
|
+
prefix="/motors",
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class MotorStatus(BaseModel):
|
|
18
|
+
"""Represents the status of the motors.
|
|
19
|
+
|
|
20
|
+
Exposes
|
|
21
|
+
- mode: The current motor control mode (enabled, disabled, gravity_compensation).
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
mode: MotorControlMode
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@router.get("/status")
|
|
28
|
+
async def get_motor_status(backend: Backend = Depends(get_backend)) -> MotorStatus:
|
|
29
|
+
"""Get the current status of the motors."""
|
|
30
|
+
return MotorStatus(mode=backend.get_motor_control_mode())
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@router.post("/set_mode/{mode}")
|
|
34
|
+
async def set_motor_mode(
|
|
35
|
+
mode: MotorControlMode,
|
|
36
|
+
backend: Backend = Depends(get_backend),
|
|
37
|
+
) -> dict[str, str]:
|
|
38
|
+
"""Set the motor control mode."""
|
|
39
|
+
backend.set_motor_control_mode(mode)
|
|
40
|
+
|
|
41
|
+
return {"status": f"motors changed to {mode} mode"}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
"""Movement-related API routes.
|
|
2
|
+
|
|
3
|
+
This exposes:
|
|
4
|
+
- goto
|
|
5
|
+
- play (wake_up, goto_sleep)
|
|
6
|
+
- stop running moves
|
|
7
|
+
- set_target and streaming set_target
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import asyncio
|
|
11
|
+
import json
|
|
12
|
+
from enum import Enum
|
|
13
|
+
from typing import Any, Coroutine
|
|
14
|
+
from uuid import UUID, uuid4
|
|
15
|
+
|
|
16
|
+
import numpy as np
|
|
17
|
+
from fastapi import APIRouter, Depends, HTTPException, WebSocket, WebSocketDisconnect
|
|
18
|
+
from huggingface_hub.errors import RepositoryNotFoundError
|
|
19
|
+
from pydantic import BaseModel
|
|
20
|
+
|
|
21
|
+
from reachy_mini.motion.recorded_move import RecordedMoves
|
|
22
|
+
|
|
23
|
+
from ....daemon.backend.abstract import Backend
|
|
24
|
+
from ..dependencies import get_backend, ws_get_backend
|
|
25
|
+
from ..models import AnyPose, FullBodyTarget
|
|
26
|
+
|
|
27
|
+
move_tasks: dict[UUID, asyncio.Task[None]] = {}
|
|
28
|
+
move_listeners: list[WebSocket] = []
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
router = APIRouter(prefix="/move")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class InterpolationMode(str, Enum):
|
|
35
|
+
"""Interpolation modes for movement."""
|
|
36
|
+
|
|
37
|
+
# TODO: This should be the same as for the backend
|
|
38
|
+
|
|
39
|
+
LINEAR = "linear"
|
|
40
|
+
MINJERK = "minjerk"
|
|
41
|
+
EASE = "ease"
|
|
42
|
+
CARTOON = "cartoon"
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class GotoModelRequest(BaseModel):
|
|
46
|
+
"""Request model for the goto endpoint."""
|
|
47
|
+
|
|
48
|
+
head_pose: AnyPose | None = None
|
|
49
|
+
antennas: tuple[float, float] | None = None
|
|
50
|
+
body_yaw: float | None = None
|
|
51
|
+
duration: float
|
|
52
|
+
interpolation: InterpolationMode = InterpolationMode.MINJERK
|
|
53
|
+
|
|
54
|
+
model_config = {
|
|
55
|
+
"json_schema_extra": {
|
|
56
|
+
"examples": [
|
|
57
|
+
{
|
|
58
|
+
"head_pose": {
|
|
59
|
+
"x": 0.0,
|
|
60
|
+
"y": 0.0,
|
|
61
|
+
"z": 0.0,
|
|
62
|
+
"roll": 0.0,
|
|
63
|
+
"pitch": 0.0,
|
|
64
|
+
"yaw": 0.0,
|
|
65
|
+
},
|
|
66
|
+
"antennas": [0.0, 0.0],
|
|
67
|
+
"body_yaw": 0.0,
|
|
68
|
+
"duration": 2.0,
|
|
69
|
+
"interpolation": "minjerk",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"antennas": [0.0, 0.0],
|
|
73
|
+
"duration": 1.0,
|
|
74
|
+
"interpolation": "linear",
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class MoveUUID(BaseModel):
|
|
82
|
+
"""Model representing a unique identifier for a move task."""
|
|
83
|
+
|
|
84
|
+
uuid: UUID
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def create_move_task(coro: Coroutine[Any, Any, None]) -> MoveUUID:
|
|
88
|
+
"""Create a new move task using async task coroutine."""
|
|
89
|
+
uuid = uuid4()
|
|
90
|
+
|
|
91
|
+
async def notify_listeners(message: str, details: str = "") -> None:
|
|
92
|
+
for ws in move_listeners:
|
|
93
|
+
try:
|
|
94
|
+
await ws.send_json(
|
|
95
|
+
{
|
|
96
|
+
"type": message,
|
|
97
|
+
"uuid": str(uuid),
|
|
98
|
+
"details": details,
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
except (RuntimeError, WebSocketDisconnect):
|
|
102
|
+
move_listeners.remove(ws)
|
|
103
|
+
|
|
104
|
+
async def wrap_coro() -> None:
|
|
105
|
+
try:
|
|
106
|
+
await notify_listeners("move_started")
|
|
107
|
+
await coro
|
|
108
|
+
await notify_listeners("move_completed")
|
|
109
|
+
except Exception as e:
|
|
110
|
+
await notify_listeners("move_failed", details=str(e))
|
|
111
|
+
except asyncio.CancelledError:
|
|
112
|
+
await notify_listeners("move_cancelled")
|
|
113
|
+
finally:
|
|
114
|
+
move_tasks.pop(uuid, None)
|
|
115
|
+
|
|
116
|
+
task = asyncio.create_task(wrap_coro())
|
|
117
|
+
move_tasks[uuid] = task
|
|
118
|
+
|
|
119
|
+
return MoveUUID(uuid=uuid)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
async def stop_move_task(uuid: UUID) -> dict[str, str]:
|
|
123
|
+
"""Stop a running move task by cancelling it."""
|
|
124
|
+
if uuid not in move_tasks:
|
|
125
|
+
raise KeyError(f"Running move with UUID {uuid} not found")
|
|
126
|
+
|
|
127
|
+
task = move_tasks.pop(uuid, None)
|
|
128
|
+
assert task is not None
|
|
129
|
+
|
|
130
|
+
if task:
|
|
131
|
+
if task.cancel():
|
|
132
|
+
try:
|
|
133
|
+
await task
|
|
134
|
+
except asyncio.CancelledError:
|
|
135
|
+
pass
|
|
136
|
+
|
|
137
|
+
return {
|
|
138
|
+
"message": f"Stopped move with UUID: {uuid}",
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
@router.get("/running")
|
|
143
|
+
async def get_running_moves() -> list[MoveUUID]:
|
|
144
|
+
"""Get a list of currently running move tasks."""
|
|
145
|
+
return [MoveUUID(uuid=uuid) for uuid in move_tasks.keys()]
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
@router.post("/goto")
|
|
149
|
+
async def goto(
|
|
150
|
+
goto_req: GotoModelRequest, backend: Backend = Depends(get_backend)
|
|
151
|
+
) -> MoveUUID:
|
|
152
|
+
"""Request a movement to a specific target."""
|
|
153
|
+
return create_move_task(
|
|
154
|
+
backend.goto_target(
|
|
155
|
+
head=goto_req.head_pose.to_pose_array() if goto_req.head_pose else None,
|
|
156
|
+
antennas=np.array(goto_req.antennas) if goto_req.antennas else None,
|
|
157
|
+
body_yaw=goto_req.body_yaw,
|
|
158
|
+
duration=goto_req.duration,
|
|
159
|
+
)
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
@router.post("/play/wake_up")
|
|
164
|
+
async def play_wake_up(backend: Backend = Depends(get_backend)) -> MoveUUID:
|
|
165
|
+
"""Request the robot to wake up."""
|
|
166
|
+
return create_move_task(backend.wake_up())
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
@router.post("/play/goto_sleep")
|
|
170
|
+
async def play_goto_sleep(backend: Backend = Depends(get_backend)) -> MoveUUID:
|
|
171
|
+
"""Request the robot to go to sleep."""
|
|
172
|
+
return create_move_task(backend.goto_sleep())
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
@router.get("/recorded-move-datasets/list/{dataset_name:path}")
|
|
176
|
+
async def list_recorded_move_dataset(
|
|
177
|
+
dataset_name: str,
|
|
178
|
+
) -> list[str]:
|
|
179
|
+
"""List available recorded moves in a dataset."""
|
|
180
|
+
try:
|
|
181
|
+
moves = RecordedMoves(dataset_name)
|
|
182
|
+
except RepositoryNotFoundError as e:
|
|
183
|
+
raise HTTPException(status_code=404, detail=str(e))
|
|
184
|
+
|
|
185
|
+
return moves.list_moves()
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
@router.post("/play/recorded-move-dataset/{dataset_name:path}/{move_name}")
|
|
189
|
+
async def play_recorded_move_dataset(
|
|
190
|
+
dataset_name: str,
|
|
191
|
+
move_name: str,
|
|
192
|
+
backend: Backend = Depends(get_backend),
|
|
193
|
+
) -> MoveUUID:
|
|
194
|
+
"""Request the robot to play a predefined recorded move from a dataset."""
|
|
195
|
+
try:
|
|
196
|
+
recorded_moves = RecordedMoves(dataset_name)
|
|
197
|
+
except RepositoryNotFoundError as e:
|
|
198
|
+
raise HTTPException(status_code=404, detail=str(e))
|
|
199
|
+
try:
|
|
200
|
+
move = recorded_moves.get(move_name)
|
|
201
|
+
except ValueError as e:
|
|
202
|
+
raise HTTPException(status_code=404, detail=str(e))
|
|
203
|
+
return create_move_task(backend.play_move(move))
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
@router.post("/stop")
|
|
207
|
+
async def stop_move(uuid: MoveUUID) -> dict[str, str]:
|
|
208
|
+
"""Stop a running move task."""
|
|
209
|
+
return await stop_move_task(uuid.uuid)
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
@router.websocket("/ws/updates")
|
|
213
|
+
async def ws_move_updates(
|
|
214
|
+
websocket: WebSocket,
|
|
215
|
+
) -> None:
|
|
216
|
+
"""WebSocket route to stream move updates."""
|
|
217
|
+
await websocket.accept()
|
|
218
|
+
try:
|
|
219
|
+
move_listeners.append(websocket)
|
|
220
|
+
while True:
|
|
221
|
+
_ = await websocket.receive_text()
|
|
222
|
+
except WebSocketDisconnect:
|
|
223
|
+
move_listeners.remove(websocket)
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
# --- FullBodyTarget streaming and single set_target ---
|
|
227
|
+
@router.post("/set_target")
|
|
228
|
+
async def set_target(
|
|
229
|
+
target: FullBodyTarget,
|
|
230
|
+
backend: Backend = Depends(get_backend),
|
|
231
|
+
) -> dict[str, str]:
|
|
232
|
+
"""POST route to set a single FullBodyTarget."""
|
|
233
|
+
if backend.is_move_running:
|
|
234
|
+
# Avoid fighting with the daemon while a trajectory is running
|
|
235
|
+
backend.logger.warning("Ignoring set_target request: move already running.")
|
|
236
|
+
return {"status": "ignored", "reason": "move_running"}
|
|
237
|
+
backend.set_target(
|
|
238
|
+
head=target.target_head_pose.to_pose_array()
|
|
239
|
+
if target.target_head_pose
|
|
240
|
+
else None,
|
|
241
|
+
antennas=np.array(target.target_antennas) if target.target_antennas else None,
|
|
242
|
+
body_yaw=target.target_body_yaw,
|
|
243
|
+
)
|
|
244
|
+
return {"status": "ok"}
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
@router.websocket("/ws/set_target")
|
|
248
|
+
async def ws_set_target(
|
|
249
|
+
websocket: WebSocket, backend: Backend = Depends(ws_get_backend)
|
|
250
|
+
) -> None:
|
|
251
|
+
"""WebSocket route to stream FullBodyTarget set_target calls."""
|
|
252
|
+
await websocket.accept()
|
|
253
|
+
try:
|
|
254
|
+
while True:
|
|
255
|
+
data = await websocket.receive_text()
|
|
256
|
+
try:
|
|
257
|
+
target = FullBodyTarget.model_validate_json(data)
|
|
258
|
+
await set_target(target, backend)
|
|
259
|
+
|
|
260
|
+
except Exception as e:
|
|
261
|
+
await websocket.send_text(
|
|
262
|
+
json.dumps({"status": "error", "detail": str(e)})
|
|
263
|
+
)
|
|
264
|
+
except WebSocketDisconnect:
|
|
265
|
+
pass
|