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,469 @@
|
|
|
1
|
+
"""Daemon entry point for the Reachy Mini robot.
|
|
2
|
+
|
|
3
|
+
This script serves as the command-line interface (CLI) entry point for the Reachy Mini daemon.
|
|
4
|
+
It initializes the daemon with specified parameters such as simulation mode, serial port,
|
|
5
|
+
scene to load, and logging level. The daemon runs indefinitely, handling requests and
|
|
6
|
+
managing the robot's state.
|
|
7
|
+
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import argparse
|
|
11
|
+
import asyncio
|
|
12
|
+
import logging
|
|
13
|
+
from contextlib import asynccontextmanager
|
|
14
|
+
from dataclasses import dataclass
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
from typing import AsyncGenerator
|
|
17
|
+
|
|
18
|
+
import uvicorn
|
|
19
|
+
from fastapi import APIRouter, FastAPI, Request
|
|
20
|
+
from fastapi.middleware.cors import CORSMiddleware
|
|
21
|
+
from fastapi.responses import HTMLResponse
|
|
22
|
+
from fastapi.staticfiles import StaticFiles
|
|
23
|
+
from fastapi.templating import Jinja2Templates
|
|
24
|
+
|
|
25
|
+
from reachy_mini.apps.manager import AppManager
|
|
26
|
+
from reachy_mini.daemon.app.routers import (
|
|
27
|
+
apps,
|
|
28
|
+
daemon,
|
|
29
|
+
kinematics,
|
|
30
|
+
motors,
|
|
31
|
+
move,
|
|
32
|
+
state,
|
|
33
|
+
volume,
|
|
34
|
+
)
|
|
35
|
+
from reachy_mini.daemon.daemon import Daemon
|
|
36
|
+
from reachy_mini.media.audio_utils import (
|
|
37
|
+
check_reachymini_asoundrc,
|
|
38
|
+
write_asoundrc_to_home,
|
|
39
|
+
)
|
|
40
|
+
from reachy_mini.utils.wireless_version.startup_check import (
|
|
41
|
+
check_and_fix_venvs_ownership,
|
|
42
|
+
check_and_update_bluetooth_service,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@dataclass
|
|
47
|
+
class Args:
|
|
48
|
+
"""Arguments for configuring the Reachy Mini daemon."""
|
|
49
|
+
|
|
50
|
+
log_level: str = "INFO"
|
|
51
|
+
log_file: str | None = None
|
|
52
|
+
|
|
53
|
+
wireless_version: bool = False
|
|
54
|
+
desktop_app_daemon: bool = False
|
|
55
|
+
|
|
56
|
+
serialport: str = "auto"
|
|
57
|
+
hardware_config_filepath: str | None = None
|
|
58
|
+
|
|
59
|
+
sim: bool = False
|
|
60
|
+
scene: str = "empty"
|
|
61
|
+
headless: bool = False
|
|
62
|
+
websocket_uri: str | None = None
|
|
63
|
+
stream_media: bool = False
|
|
64
|
+
use_audio: bool = True
|
|
65
|
+
|
|
66
|
+
kinematics_engine: str = "AnalyticalKinematics"
|
|
67
|
+
check_collision: bool = False
|
|
68
|
+
|
|
69
|
+
autostart: bool = True
|
|
70
|
+
timeout_health_check: float | None = None
|
|
71
|
+
|
|
72
|
+
wake_up_on_start: bool = True
|
|
73
|
+
goto_sleep_on_stop: bool = True
|
|
74
|
+
|
|
75
|
+
robot_name: str = "reachy_mini"
|
|
76
|
+
|
|
77
|
+
fastapi_host: str = "0.0.0.0"
|
|
78
|
+
fastapi_port: int = 8000
|
|
79
|
+
|
|
80
|
+
localhost_only: bool | None = None
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def create_app(args: Args, health_check_event: asyncio.Event | None = None) -> FastAPI:
|
|
84
|
+
"""Create and configure the FastAPI application."""
|
|
85
|
+
localhost_only = (
|
|
86
|
+
args.localhost_only
|
|
87
|
+
if args.localhost_only is not None
|
|
88
|
+
else (False if args.wireless_version else True)
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
@asynccontextmanager
|
|
92
|
+
async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
|
|
93
|
+
"""Lifespan context manager for the FastAPI application."""
|
|
94
|
+
args = app.state.args # type: Args
|
|
95
|
+
|
|
96
|
+
try:
|
|
97
|
+
if args.autostart:
|
|
98
|
+
await app.state.daemon.start(
|
|
99
|
+
serialport=args.serialport,
|
|
100
|
+
sim=args.sim,
|
|
101
|
+
scene=args.scene,
|
|
102
|
+
headless=args.headless,
|
|
103
|
+
websocket_uri=args.websocket_uri,
|
|
104
|
+
stream_media=args.stream_media,
|
|
105
|
+
use_audio=args.use_audio,
|
|
106
|
+
kinematics_engine=args.kinematics_engine,
|
|
107
|
+
check_collision=args.check_collision,
|
|
108
|
+
wake_up_on_start=args.wake_up_on_start,
|
|
109
|
+
localhost_only=localhost_only,
|
|
110
|
+
hardware_config_filepath=args.hardware_config_filepath,
|
|
111
|
+
)
|
|
112
|
+
yield
|
|
113
|
+
finally:
|
|
114
|
+
# Ensure cleanup happens even if there's an exception
|
|
115
|
+
try:
|
|
116
|
+
logging.info("Shutting down app manager...")
|
|
117
|
+
await app.state.app_manager.close()
|
|
118
|
+
except Exception as e:
|
|
119
|
+
logging.error(f"Error closing app manager: {e}")
|
|
120
|
+
|
|
121
|
+
try:
|
|
122
|
+
logging.info("Shutting down daemon...")
|
|
123
|
+
await app.state.daemon.stop(
|
|
124
|
+
goto_sleep_on_stop=args.goto_sleep_on_stop,
|
|
125
|
+
)
|
|
126
|
+
except Exception as e:
|
|
127
|
+
logging.error(f"Error stopping daemon: {e}")
|
|
128
|
+
|
|
129
|
+
app = FastAPI(
|
|
130
|
+
lifespan=lifespan,
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
app.state.args = args
|
|
134
|
+
app.state.daemon = Daemon(
|
|
135
|
+
robot_name=args.robot_name,
|
|
136
|
+
wireless_version=args.wireless_version,
|
|
137
|
+
desktop_app_daemon=args.desktop_app_daemon,
|
|
138
|
+
)
|
|
139
|
+
app.state.app_manager = AppManager(
|
|
140
|
+
wireless_version=args.wireless_version,
|
|
141
|
+
desktop_app_daemon=args.desktop_app_daemon,
|
|
142
|
+
daemon=app.state.daemon,
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
router = APIRouter(prefix="/api")
|
|
146
|
+
router.include_router(apps.router)
|
|
147
|
+
router.include_router(daemon.router)
|
|
148
|
+
router.include_router(kinematics.router)
|
|
149
|
+
router.include_router(motors.router)
|
|
150
|
+
router.include_router(move.router)
|
|
151
|
+
router.include_router(state.router)
|
|
152
|
+
router.include_router(volume.router)
|
|
153
|
+
|
|
154
|
+
if args.wireless_version:
|
|
155
|
+
from .routers import update, wifi_config
|
|
156
|
+
|
|
157
|
+
app.include_router(update.router)
|
|
158
|
+
app.include_router(wifi_config.router)
|
|
159
|
+
|
|
160
|
+
app.include_router(router)
|
|
161
|
+
|
|
162
|
+
if health_check_event is not None:
|
|
163
|
+
|
|
164
|
+
@app.post("/health-check")
|
|
165
|
+
async def health_check() -> dict[str, str]:
|
|
166
|
+
"""Health check endpoint to reset the health check timer."""
|
|
167
|
+
health_check_event.set()
|
|
168
|
+
return {"status": "ok"}
|
|
169
|
+
|
|
170
|
+
app.add_middleware(
|
|
171
|
+
CORSMiddleware,
|
|
172
|
+
allow_origins=["*"], # or restrict to your HF domain
|
|
173
|
+
allow_methods=["*"],
|
|
174
|
+
allow_headers=["*"],
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
STATIC_DIR = Path(__file__).parent / "dashboard" / "static"
|
|
178
|
+
TEMPLATES_DIR = Path(__file__).parent / "dashboard" / "templates"
|
|
179
|
+
|
|
180
|
+
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
|
|
181
|
+
templates = Jinja2Templates(directory=str(TEMPLATES_DIR))
|
|
182
|
+
|
|
183
|
+
@app.get("/")
|
|
184
|
+
async def dashboard(request: Request) -> HTMLResponse:
|
|
185
|
+
"""Render the dashboard."""
|
|
186
|
+
return templates.TemplateResponse(
|
|
187
|
+
"index.html", {"request": request, "args": args}
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
if args.wireless_version:
|
|
191
|
+
|
|
192
|
+
@app.get("/settings")
|
|
193
|
+
async def settings(request: Request) -> HTMLResponse:
|
|
194
|
+
"""Render the settings page."""
|
|
195
|
+
return templates.TemplateResponse("settings.html", {"request": request})
|
|
196
|
+
|
|
197
|
+
return app
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def run_app(args: Args) -> None:
|
|
201
|
+
"""Run the FastAPI app with Uvicorn."""
|
|
202
|
+
logging.basicConfig(level=logging.INFO)
|
|
203
|
+
|
|
204
|
+
async def run_server() -> None:
|
|
205
|
+
health_check_event = asyncio.Event()
|
|
206
|
+
app = create_app(args, health_check_event)
|
|
207
|
+
|
|
208
|
+
config = uvicorn.Config(app, host=args.fastapi_host, port=args.fastapi_port)
|
|
209
|
+
server = uvicorn.Server(config)
|
|
210
|
+
|
|
211
|
+
health_check_task = None
|
|
212
|
+
|
|
213
|
+
async def health_check_timeout(timeout_seconds: float) -> None:
|
|
214
|
+
while True:
|
|
215
|
+
try:
|
|
216
|
+
await asyncio.wait_for(
|
|
217
|
+
health_check_event.wait(),
|
|
218
|
+
timeout=timeout_seconds,
|
|
219
|
+
)
|
|
220
|
+
health_check_event.clear()
|
|
221
|
+
except asyncio.TimeoutError:
|
|
222
|
+
logging.warning("Health check timeout reached, stopping app.")
|
|
223
|
+
server.should_exit = True
|
|
224
|
+
break
|
|
225
|
+
except asyncio.CancelledError:
|
|
226
|
+
logging.info("Health check task cancelled.")
|
|
227
|
+
break
|
|
228
|
+
|
|
229
|
+
try:
|
|
230
|
+
if args.timeout_health_check is not None:
|
|
231
|
+
health_check_task = asyncio.create_task(
|
|
232
|
+
health_check_timeout(args.timeout_health_check)
|
|
233
|
+
)
|
|
234
|
+
await server.serve()
|
|
235
|
+
except KeyboardInterrupt:
|
|
236
|
+
logging.info("Received Ctrl-C, shutting down gracefully.")
|
|
237
|
+
finally:
|
|
238
|
+
# Cancel health check task if it exists
|
|
239
|
+
if health_check_task and not health_check_task.done():
|
|
240
|
+
health_check_task.cancel()
|
|
241
|
+
try:
|
|
242
|
+
await health_check_task
|
|
243
|
+
except asyncio.CancelledError:
|
|
244
|
+
pass
|
|
245
|
+
|
|
246
|
+
try:
|
|
247
|
+
asyncio.run(run_server())
|
|
248
|
+
except KeyboardInterrupt:
|
|
249
|
+
logging.info("Shutdown complete.")
|
|
250
|
+
except Exception as e:
|
|
251
|
+
logging.error(f"Error during shutdown: {e}")
|
|
252
|
+
raise
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
def main() -> None:
|
|
256
|
+
"""Run the FastAPI app with Uvicorn."""
|
|
257
|
+
default_args = Args()
|
|
258
|
+
|
|
259
|
+
parser = argparse.ArgumentParser(description="Run the Reachy Mini daemon.")
|
|
260
|
+
parser.add_argument(
|
|
261
|
+
"--wireless-version",
|
|
262
|
+
action="store_true",
|
|
263
|
+
default=default_args.wireless_version,
|
|
264
|
+
help="Use the wireless version of Reachy Mini (default: False).",
|
|
265
|
+
)
|
|
266
|
+
parser.add_argument(
|
|
267
|
+
"--desktop-app-daemon",
|
|
268
|
+
action="store_true",
|
|
269
|
+
default=default_args.desktop_app_daemon,
|
|
270
|
+
help="Use the desktop version of Reachy Mini (default: False).",
|
|
271
|
+
)
|
|
272
|
+
|
|
273
|
+
parser.add_argument(
|
|
274
|
+
"--robot-name",
|
|
275
|
+
type=str,
|
|
276
|
+
default=default_args.robot_name,
|
|
277
|
+
help="Name of the robot (default: reachy_mini).",
|
|
278
|
+
)
|
|
279
|
+
|
|
280
|
+
# Real robot mode
|
|
281
|
+
parser.add_argument(
|
|
282
|
+
"-p",
|
|
283
|
+
"--serialport",
|
|
284
|
+
type=str,
|
|
285
|
+
default=default_args.serialport,
|
|
286
|
+
help="Serial port for real motors (default: will try to automatically find the port).",
|
|
287
|
+
)
|
|
288
|
+
default_hw_config_path = str(
|
|
289
|
+
(
|
|
290
|
+
Path(__file__).parent.parent.parent
|
|
291
|
+
/ "assets"
|
|
292
|
+
/ "config"
|
|
293
|
+
/ "hardware_config.yaml"
|
|
294
|
+
).resolve()
|
|
295
|
+
)
|
|
296
|
+
parser.add_argument(
|
|
297
|
+
"--hardware-config-filepath",
|
|
298
|
+
type=str,
|
|
299
|
+
default=default_hw_config_path,
|
|
300
|
+
help=f"Path to the hardware configuration YAML file (default: {default_hw_config_path}).",
|
|
301
|
+
)
|
|
302
|
+
# Simulation mode
|
|
303
|
+
parser.add_argument(
|
|
304
|
+
"--sim",
|
|
305
|
+
action="store_true",
|
|
306
|
+
default=default_args.sim,
|
|
307
|
+
help="Run in simulation mode using Mujoco.",
|
|
308
|
+
)
|
|
309
|
+
parser.add_argument(
|
|
310
|
+
"--scene",
|
|
311
|
+
type=str,
|
|
312
|
+
default=default_args.scene,
|
|
313
|
+
help="Name of the scene to load (default: empty)",
|
|
314
|
+
)
|
|
315
|
+
parser.add_argument(
|
|
316
|
+
"--headless",
|
|
317
|
+
action="store_true",
|
|
318
|
+
default=default_args.headless,
|
|
319
|
+
help="Run the daemon in headless mode (default: False).",
|
|
320
|
+
)
|
|
321
|
+
parser.add_argument(
|
|
322
|
+
"--websocket-uri",
|
|
323
|
+
type=str,
|
|
324
|
+
default=default_args.websocket_uri,
|
|
325
|
+
help="WebSocket URI for remote control and streaming of the robot (default: None). Example: ws://localhost:8000",
|
|
326
|
+
)
|
|
327
|
+
parser.add_argument(
|
|
328
|
+
"--stream-media",
|
|
329
|
+
action="store_true",
|
|
330
|
+
default=default_args.stream_media,
|
|
331
|
+
help="Stream media to the WebSocket. Requires a WebSocket URI to be set. (default: False).",
|
|
332
|
+
)
|
|
333
|
+
parser.add_argument(
|
|
334
|
+
"--deactivate-audio",
|
|
335
|
+
action="store_false",
|
|
336
|
+
dest="use_audio",
|
|
337
|
+
default=default_args.use_audio,
|
|
338
|
+
help="Deactivate audio (default: True).",
|
|
339
|
+
)
|
|
340
|
+
# Daemon options
|
|
341
|
+
parser.add_argument(
|
|
342
|
+
"--autostart",
|
|
343
|
+
action="store_true",
|
|
344
|
+
default=default_args.autostart,
|
|
345
|
+
help="Automatically start the daemon on launch (default: True).",
|
|
346
|
+
)
|
|
347
|
+
parser.add_argument(
|
|
348
|
+
"--no-autostart",
|
|
349
|
+
action="store_false",
|
|
350
|
+
dest="autostart",
|
|
351
|
+
help="Do not automatically start the daemon on launch (default: False).",
|
|
352
|
+
)
|
|
353
|
+
parser.add_argument(
|
|
354
|
+
"--timeout-health-check",
|
|
355
|
+
type=float,
|
|
356
|
+
default=None,
|
|
357
|
+
help="Set the health check timeout in seconds (default: None).",
|
|
358
|
+
)
|
|
359
|
+
parser.add_argument(
|
|
360
|
+
"--wake-up-on-start",
|
|
361
|
+
action="store_true",
|
|
362
|
+
default=default_args.wake_up_on_start,
|
|
363
|
+
help="Wake up the robot on daemon start (default: True).",
|
|
364
|
+
)
|
|
365
|
+
parser.add_argument(
|
|
366
|
+
"--no-wake-up-on-start",
|
|
367
|
+
action="store_false",
|
|
368
|
+
dest="wake_up_on_start",
|
|
369
|
+
help="Do not wake up the robot on daemon start (default: False).",
|
|
370
|
+
)
|
|
371
|
+
parser.add_argument(
|
|
372
|
+
"--goto-sleep-on-stop",
|
|
373
|
+
action="store_true",
|
|
374
|
+
default=default_args.goto_sleep_on_stop,
|
|
375
|
+
help="Put the robot to sleep on daemon stop (default: True).",
|
|
376
|
+
)
|
|
377
|
+
parser.add_argument(
|
|
378
|
+
"--no-goto-sleep-on-stop",
|
|
379
|
+
action="store_false",
|
|
380
|
+
dest="goto_sleep_on_stop",
|
|
381
|
+
help="Do not put the robot to sleep on daemon stop (default: False).",
|
|
382
|
+
)
|
|
383
|
+
# Zenoh server options
|
|
384
|
+
parser.add_argument(
|
|
385
|
+
"--localhost-only",
|
|
386
|
+
action="store_true",
|
|
387
|
+
default=default_args.localhost_only,
|
|
388
|
+
help="Restrict the server to localhost only (default: True).",
|
|
389
|
+
)
|
|
390
|
+
parser.add_argument(
|
|
391
|
+
"--no-localhost-only",
|
|
392
|
+
action="store_false",
|
|
393
|
+
dest="localhost_only",
|
|
394
|
+
help="Allow the server to listen on all interfaces (default: False).",
|
|
395
|
+
)
|
|
396
|
+
# Kinematics options
|
|
397
|
+
parser.add_argument(
|
|
398
|
+
"--check-collision",
|
|
399
|
+
action="store_true",
|
|
400
|
+
default=default_args.check_collision,
|
|
401
|
+
help="Enable collision checking (default: False).",
|
|
402
|
+
)
|
|
403
|
+
|
|
404
|
+
parser.add_argument(
|
|
405
|
+
"--kinematics-engine",
|
|
406
|
+
type=str,
|
|
407
|
+
default=default_args.kinematics_engine,
|
|
408
|
+
choices=["Placo", "NN", "AnalyticalKinematics"],
|
|
409
|
+
help="Set the kinematics engine (default: AnalyticalKinematics).",
|
|
410
|
+
)
|
|
411
|
+
# FastAPI server options
|
|
412
|
+
parser.add_argument(
|
|
413
|
+
"--fastapi-host",
|
|
414
|
+
type=str,
|
|
415
|
+
default=default_args.fastapi_host,
|
|
416
|
+
)
|
|
417
|
+
parser.add_argument(
|
|
418
|
+
"--fastapi-port",
|
|
419
|
+
type=int,
|
|
420
|
+
default=default_args.fastapi_port,
|
|
421
|
+
)
|
|
422
|
+
# Logging options
|
|
423
|
+
parser.add_argument(
|
|
424
|
+
"--log-level",
|
|
425
|
+
type=str,
|
|
426
|
+
default=default_args.log_level,
|
|
427
|
+
choices=["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
|
|
428
|
+
help="Set the logging level (default: INFO).",
|
|
429
|
+
)
|
|
430
|
+
parser.add_argument(
|
|
431
|
+
"--log-file",
|
|
432
|
+
type=str,
|
|
433
|
+
default=default_args.log_file,
|
|
434
|
+
help="Path to a file to write logs to.",
|
|
435
|
+
)
|
|
436
|
+
|
|
437
|
+
args = parser.parse_args()
|
|
438
|
+
|
|
439
|
+
if args.log_file:
|
|
440
|
+
file_handler = logging.FileHandler(args.log_file, mode="a")
|
|
441
|
+
file_handler.setFormatter(
|
|
442
|
+
logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
|
443
|
+
)
|
|
444
|
+
logging.getLogger().addHandler(file_handler)
|
|
445
|
+
logging.getLogger().setLevel(args.log_level)
|
|
446
|
+
|
|
447
|
+
if args.wireless_version:
|
|
448
|
+
# Check and fix ownership of /venvs directory
|
|
449
|
+
check_and_fix_venvs_ownership(custom_logger=logging.getLogger())
|
|
450
|
+
|
|
451
|
+
# Check and update bluetooth service if needed
|
|
452
|
+
check_and_update_bluetooth_service()
|
|
453
|
+
|
|
454
|
+
if check_reachymini_asoundrc():
|
|
455
|
+
logging.getLogger().info(
|
|
456
|
+
"~/.asoundrc correctly configured for Reachy Mini Audio."
|
|
457
|
+
)
|
|
458
|
+
else:
|
|
459
|
+
logging.getLogger().warning(
|
|
460
|
+
"~/.asoundrc not found or not correctly configured for Reachy Mini Audio. "
|
|
461
|
+
"Creating a new one."
|
|
462
|
+
)
|
|
463
|
+
write_asoundrc_to_home()
|
|
464
|
+
|
|
465
|
+
run_app(Args(**vars(args)))
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
if __name__ == "__main__":
|
|
469
|
+
main()
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"""Common pydantic models definitions."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
|
|
5
|
+
import numpy as np
|
|
6
|
+
from numpy.typing import NDArray
|
|
7
|
+
from pydantic import BaseModel
|
|
8
|
+
from scipy.spatial.transform import Rotation as R
|
|
9
|
+
|
|
10
|
+
from reachy_mini.daemon.backend.abstract import MotorControlMode
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Matrix4x4Pose(BaseModel):
|
|
14
|
+
"""Represent a 3D pose by its 4x4 transformation matrix (translation is expressed in meters)."""
|
|
15
|
+
|
|
16
|
+
m: tuple[
|
|
17
|
+
float,
|
|
18
|
+
float,
|
|
19
|
+
float,
|
|
20
|
+
float,
|
|
21
|
+
float,
|
|
22
|
+
float,
|
|
23
|
+
float,
|
|
24
|
+
float,
|
|
25
|
+
float,
|
|
26
|
+
float,
|
|
27
|
+
float,
|
|
28
|
+
float,
|
|
29
|
+
float,
|
|
30
|
+
float,
|
|
31
|
+
float,
|
|
32
|
+
float,
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
@classmethod
|
|
36
|
+
def from_pose_array(cls, arr: NDArray[np.float64]) -> "Matrix4x4Pose":
|
|
37
|
+
"""Create a Matrix4x4 pose representation from a 4x4 pose array."""
|
|
38
|
+
assert arr.shape == (4, 4), "Array must be of shape (4, 4)"
|
|
39
|
+
m: tuple[
|
|
40
|
+
float,
|
|
41
|
+
float,
|
|
42
|
+
float,
|
|
43
|
+
float,
|
|
44
|
+
float,
|
|
45
|
+
float,
|
|
46
|
+
float,
|
|
47
|
+
float,
|
|
48
|
+
float,
|
|
49
|
+
float,
|
|
50
|
+
float,
|
|
51
|
+
float,
|
|
52
|
+
float,
|
|
53
|
+
float,
|
|
54
|
+
float,
|
|
55
|
+
float,
|
|
56
|
+
] = tuple(arr.flatten().tolist()) # type: ignore [assignment]
|
|
57
|
+
return cls(m=m)
|
|
58
|
+
|
|
59
|
+
def to_pose_array(self) -> NDArray[np.float64]:
|
|
60
|
+
"""Convert the Matrix4x4Pose to a 4x4 numpy array."""
|
|
61
|
+
return np.array(self.m).reshape((4, 4))
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class XYZRPYPose(BaseModel):
|
|
65
|
+
"""Represent a 3D pose using position (x, y, z) in meters and orientation (roll, pitch, yaw) angles in radians."""
|
|
66
|
+
|
|
67
|
+
x: float = 0.0
|
|
68
|
+
y: float = 0.0
|
|
69
|
+
z: float = 0.0
|
|
70
|
+
roll: float = 0.0
|
|
71
|
+
pitch: float = 0.0
|
|
72
|
+
yaw: float = 0.0
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_pose_array(cls, arr: NDArray[np.float64]) -> "XYZRPYPose":
|
|
76
|
+
"""Create an XYZRPYPose representation from a 4x4 pose array."""
|
|
77
|
+
assert arr.shape == (4, 4), "Array must be of shape (4, 4)"
|
|
78
|
+
|
|
79
|
+
x, y, z = arr[0, 3], arr[1, 3], arr[2, 3]
|
|
80
|
+
roll, pitch, yaw = R.from_matrix(arr[:3, :3]).as_euler("xyz")
|
|
81
|
+
|
|
82
|
+
return cls(
|
|
83
|
+
x=x,
|
|
84
|
+
y=y,
|
|
85
|
+
z=z,
|
|
86
|
+
roll=roll,
|
|
87
|
+
pitch=pitch,
|
|
88
|
+
yaw=yaw,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
def to_pose_array(self) -> NDArray[np.float64]:
|
|
92
|
+
"""Convert the XYZRPYPose to a 4x4 numpy array."""
|
|
93
|
+
rotation = R.from_euler("xyz", [self.roll, self.pitch, self.yaw])
|
|
94
|
+
pose_matrix = np.eye(4)
|
|
95
|
+
pose_matrix[:3, 3] = [self.x, self.y, self.z]
|
|
96
|
+
pose_matrix[:3, :3] = rotation.as_matrix()
|
|
97
|
+
return pose_matrix
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
AnyPose = XYZRPYPose | Matrix4x4Pose
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def as_any_pose(pose: NDArray[np.float64], use_matrix: bool) -> AnyPose:
|
|
104
|
+
"""Convert a numpy array to an AnyPose representation."""
|
|
105
|
+
return (
|
|
106
|
+
Matrix4x4Pose.from_pose_array(pose)
|
|
107
|
+
if use_matrix
|
|
108
|
+
else XYZRPYPose.from_pose_array(pose)
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
class FullBodyTarget(BaseModel):
|
|
113
|
+
"""Represent the full body including the head pose and the joints for antennas."""
|
|
114
|
+
|
|
115
|
+
target_head_pose: AnyPose | None = None
|
|
116
|
+
target_antennas: tuple[float, float] | None = None
|
|
117
|
+
target_body_yaw: float | None = None
|
|
118
|
+
timestamp: datetime | None = None
|
|
119
|
+
|
|
120
|
+
model_config = {
|
|
121
|
+
"json_schema_extra": {
|
|
122
|
+
"examples": [
|
|
123
|
+
{
|
|
124
|
+
"target_head_pose": {
|
|
125
|
+
"x": 0.0,
|
|
126
|
+
"y": 0.0,
|
|
127
|
+
"z": 0.0,
|
|
128
|
+
"roll": 0.0,
|
|
129
|
+
"pitch": 0.0,
|
|
130
|
+
"yaw": 0.0,
|
|
131
|
+
},
|
|
132
|
+
"target_antennas": [0.0, 0.0],
|
|
133
|
+
"target_body_yaw": 0.0,
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
class FullState(BaseModel):
|
|
141
|
+
"""Represent the full state of the robot including all joint positions and poses."""
|
|
142
|
+
|
|
143
|
+
control_mode: MotorControlMode | None = None
|
|
144
|
+
head_pose: AnyPose | None = None
|
|
145
|
+
head_joints: list[float] | None = None
|
|
146
|
+
body_yaw: float | None = None
|
|
147
|
+
antennas_position: list[float] | None = None
|
|
148
|
+
timestamp: datetime | None = None
|
|
149
|
+
passive_joints: list[float] | None = None
|