Files
balance/__pycache__/gradio.cpython-310.pyc

37 lines
4.3 KiB
Plaintext
Raw Normal View History

new file: .vscode/settings.json new file: Legs_controller.py modified: README.md new file: __pycache__/Legs_controller.cpython-310.pyc new file: __pycache__/Legs_controller.cpython-313.pyc new file: __pycache__/balance.cpython-310.pyc new file: __pycache__/gradio.cpython-310.pyc new file: __pycache__/gradio.cpython-313.pyc new file: app_ui.py new file: balance.py new file: build/.cmake/api/v1/query/client-vscode/query.json new file: build/.cmake/api/v1/reply/cache-v2-ae4a9db768b4bbb36baa.json new file: build/.cmake/api/v1/reply/cmakeFiles-v1-389eb8769a8295e7571d.json new file: build/.cmake/api/v1/reply/codemodel-v2-5ea8cfc0b9263cbe5ae5.json new file: build/.cmake/api/v1/reply/directory-.-Debug-f5ebdc15457944623624.json new file: build/.cmake/api/v1/reply/index-2025-09-11T04-53-20-0515.json new file: build/.cmake/api/v1/reply/target-imu_py-Debug-3913d741f2156d7faae9.json new file: build/.cmake/api/v1/reply/toolchains-v1-3105704d088db7adbfb5.json new file: build/CMakeCache.txt new file: build/CMakeFiles/3.22.1/CMakeCXXCompiler.cmake new file: build/CMakeFiles/3.22.1/CMakeDetermineCompilerABI_CXX.bin new file: build/CMakeFiles/3.22.1/CMakeSystem.cmake new file: build/CMakeFiles/3.22.1/CompilerIdCXX/CMakeCXXCompilerId.cpp new file: build/CMakeFiles/3.22.1/CompilerIdCXX/a.out new file: build/CMakeFiles/CMakeDirectoryInformation.cmake new file: build/CMakeFiles/CMakeOutput.log new file: build/CMakeFiles/Makefile.cmake new file: build/CMakeFiles/Makefile2 new file: build/CMakeFiles/TargetDirectories.txt new file: build/CMakeFiles/cmake.check_cache new file: build/CMakeFiles/imu_py.dir/DependInfo.cmake new file: build/CMakeFiles/imu_py.dir/build.make new file: build/CMakeFiles/imu_py.dir/cmake_clean.cmake new file: build/CMakeFiles/imu_py.dir/compiler_depend.make new file: build/CMakeFiles/imu_py.dir/compiler_depend.ts new file: build/CMakeFiles/imu_py.dir/depend.make new file: build/CMakeFiles/imu_py.dir/flags.make new file: build/CMakeFiles/imu_py.dir/link.txt new file: build/CMakeFiles/imu_py.dir/progress.make new file: build/CMakeFiles/progress.marks new file: build/Makefile new file: build/cmake_install.cmake new file: build/compile_commands.json new file: dm_imu/bsp_crc.cpp new file: dm_imu/bsp_crc.h new file: dm_imu/imu_data.csv new file: dm_imu/imu_driver.cpp new file: dm_imu/imu_driver.h new file: dm_imu/imu_plot.png new file: dm_imu/plot_imu.py new file: dm_imu/test_imu.cpp new file: imu_data.csv new file: pybind_imu/CMakeLists.txt new file: pybind_imu/README.md new file: pybind_imu/build/CMakeCache.txt new file: pybind_imu/build/CMakeFiles/3.22.1/CMakeCXXCompiler.cmake new file: pybind_imu/build/CMakeFiles/3.22.1/CMakeDetermineCompilerABI_CXX.bin new file: pybind_imu/build/CMakeFiles/3.22.1/CMakeSystem.cmake new file: pybind_imu/build/CMakeFiles/3.22.1/CompilerIdCXX/CMakeCXXCompilerId.cpp new file: pybind_imu/build/CMakeFiles/3.22.1/CompilerIdCXX/a.out new file: pybind_imu/build/CMakeFiles/CMakeDirectoryInformation.cmake new file: pybind_imu/build/CMakeFiles/CMakeOutput.log new file: pybind_imu/build/CMakeFiles/Makefile.cmake new file: pybind_imu/build/CMakeFiles/Makefile2 new file: pybind_imu/build/CMakeFiles/TargetDirectories.txt new file: pybind_imu/build/CMakeFiles/cmake.check_cache new file: pybind_imu/build/CMakeFiles/imu_py.dir/DependInfo.cmake new file: pybind_imu/build/CMakeFiles/imu_py.dir/build.make new file: pybind_imu/build/CMakeFiles/imu_py.dir/cmake_clean.cmake new file: pybind_imu/build/CMakeFiles/imu_py.dir/compiler_depend.make new file: pybind_imu/build/CMakeFiles/imu_py.dir/compiler_depend.ts new file: pybind_imu/build/CMakeFiles/imu_py.dir/depend.make new file: pybind_imu/build/CMakeFiles/imu_py.dir/flags.make new file: pybind_imu/build/CMakeFiles/imu_py.dir/home/allenyuan/balance/dm_imu/bsp_crc.cpp.o new file: pybind_imu/build/CMakeFiles/imu_py.dir/home/allenyuan/balance/dm_imu/bsp_crc.cpp.o.d new file: pybind_imu/build/CMakeFiles/imu_py.dir/home/allenyuan/balance/dm_imu/imu_driver.cpp.o new file: pybind_imu/build/CMakeFiles/imu_py.dir/home/allenyuan/balance/dm_imu/imu_driver.cpp.o.d new file: pybind_imu/build/CMakeFiles/imu_py.dir/link.txt new file: pybind_imu/build/CMakeFiles/imu_py.dir/progress.make new file: pybind_imu/build/CMakeFiles/imu_py.dir/pybind_imu.cpp.o new file: pybind_imu/build/CMakeFiles/imu_py.dir/pybind_imu.cpp.o.d new file: pybind_imu/build/CMakeFiles/progress.marks new file: pybind_imu/build/Makefile new file: pybind_imu/build/cmake_install.cmake new file: pybind_imu/build/imu_py.cpython-310-aarch64-linux-gnu.so new file: pybind_imu/example.py new file: pybind_imu/pybind_imu.cpp new file: src/example.py new file: test_imu new file: u2can/DM_CAN.py new file: u2can/DM_Motor_Test.py new file: u2can/LICENSE new file: u2can/README.md new file: u2can/__pycache__/DM_CAN.cpython-310.pyc new file: u2can/__pycache__/DM_CAN.cpython-312.pyc new file: u2can/__pycache__/DM_CAN.cpython-313.pyc new file: u2can/__pycache__/gradio.cpython-313.pyc new file: u2can/__pycache__/motor_interface.cpython-313.pyc new file: u2can/motor_interface.py new file: u2can/requirements.txt new file: ui.log
2025-12-06 22:47:57 +08:00
o
<0B>i<><00>
@s<>ddlZddlmZdadd<04>Zdd<06>Zdadd<08>Zd d
<EFBFBD>Zd d <0C>Z d d<0E>Z
dd<10>Z dd<12>Z ej dd<14><01><01>Ze<01>d<15>e<01><10><00><01>e<01><11><00>He<01>d<16>e<01>d<17>Ze<01>d<18>Ze<01>d<19>Ze<01>d<1A>Zejddd<1D>Zejeded<1E>ejeded<1E>eje ded<1E>ejeded<1E>Wd<00>n1s<>wYe<01><11><00>Te<01>d<1F>ejd d!dd"d#<23>Zejd d!dd$d#<23>Zejd d!dd%d#<23>Zejd d!dd&d#<23>Zejd'd(d)d'd*d+<2B>Ze<01>d,<2C>Z ejd-dd<1D>Z!e je
eeeeege!d<1E>Wd<00>n1s<>wYe<01><11><00>:e<01>d.<2E>ejd/dd<1D>Z"ejd0dd<1D>Z#ejd1dd<1D>Z$ejd2dd<1D>Z%d3d4<64>Z&ej'e&de"e#e$e%gd5d6<64>Wd<00>n 1<00>s7wYWd<00>n 1<00>sGwYWd<00>n 1<00>sWwYej(d7d8d9d:<3A>dS);<3B>N)<01>LegsControllerc
CsHtdur"zt<01>aWdSty!}z d|<00><00>WYd}~Sd}~wwdS)u.创建 LegsController 实例并打开串口。N<E38082>串口已打开u打开串口失败: u串口已打开(已存在))<03>
controllerr<00> Exception)<01>e<>r<00>!/home/allenyuan/balance/gradio.py<70> open_ports<08><02>r cCst<00>S)u>供 Gradio 按钮调用的包装函数,返回状态信息。)r rrrr<00> ui_open_portsr
cC<00>tdurdSt<00><01>dS)u-使能四条腿电机并返回提示信息。N<E38082>请先打开串口u腿部已使能)r<00> enable_legsrrrrr <00>r cCr )u0使能四个轮子电机并返回提示信息。Nr u轮子已使能)r<00> enable_wheelsrrrrr#rrcCr )u3一次性失能所有电机并返回提示信息。Nr u所有电机已失能)r<00> disable_allrrrrr+rrc Cs6t<00>|||||<04>d|<00>d|<01>d|<02>d|<03>d|<04>d<04> S)u<>
使用位置‑速度模式控制四条腿。
参数:
pos1pos4: 目标位置(范围 -5000 ~ 5000单位依据电机规格
vel: 速度比例,范围 0.1 ~ 1.0,默认 0.5
u已设置位置: z, u(速度比例 u)r<00>control_legs_pos)<05>pos1<73>pos2<73>pos3<73>pos4<73>velrrr<00> set_position3s$rcCs(tdur dgdSt<00><01>}dd<05>|D<00>S)u@读取四条腿的扭矩,返回字符串列表供 UI 显示。Nu未打开串口<E4B8B2>cSs g|] }|dur |d<01>nd<02>qS)Nz.2fzN/Ar)<02>.0<EFBFBD>trrr<00>
<listcomp>Ds zget_torque.<locals>.<listcomp>)r<00>get_legs_torque)<01>torquesrrr<00>
get_torque>s
rcCstdur t<01>adSdS)u4手动打开串口并创建 LegsController 实例。Nru$串口已打开(已存在实例))rrrrrr<00>open_serial_portFsrz<>
.gradio-container {font-family: 'Arial', sans-serif; background: #f0f4f8;}
.gr-button {border-radius: 8px; margin: 5px;}
.gr-slider {border-radius: 8px;}
)<01>cssu+# 🤖 机器人腿部 & 轮子控制面板u## 电机控制u🦵 使能腿部u🚗 使能轮子u❌ 全部失能u🔌 打开串口u状态F)<02>label<65> interactive)<03>fn<66>inputs<74>outputsu## 位置控制ix<69><78><EFBFBD>i<EFBFBD>u 腿 1 位置)<02>valuer!u 腿 2 位置u 腿 3 位置u 腿 4 位置g<E7BDAE><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?g<00>?g<00>?u 速度比例)r&<00>stepr!u📍 设置位置u位置设置结果u## 扭矩实时显示u 腿 1 扭矩u 腿 2 扭矩u 腿 3 扭矩u 腿 4 扭矩cCs"t<00>}|d|d|d|dfS)Nr<00><00><00>)r)rrrr<00>update_torques<65>sr+r()r#r$r%<00>everyz0.0.0.0i<EFBFBD>T)<03> server_name<6D> server_port<72>debug))<29>gradio<69>gr<67>Legs_controllerrrr r
r rrrrr<00>Blocks<6B>demo<6D>Markdown<77>Row<6F>Column<6D>Button<6F>enable_legs_btn<74>enable_wheels_btn<74>disable_all_btn<74> open_port_btn<74>Textbox<6F>
status_box<EFBFBD>click<63>Sliderrrrrr<00> set_pos_btn<74>
pos_status<EFBFBD>torque1<65>torque2<65>torque3<65>torque4r+<00>load<61>launchrrrr<00><module>s|    <08>
 





<1C>


 <08><1C>


<08><1E><02><1E><02><1E>;