robodyno-debugger 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- robodyno_debugger-1.0.0/LICENSE +201 -0
- robodyno_debugger-1.0.0/PKG-INFO +332 -0
- robodyno_debugger-1.0.0/README.md +304 -0
- robodyno_debugger-1.0.0/pyproject.toml +55 -0
- robodyno_debugger-1.0.0/setup.cfg +4 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/__init__.py +3 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/__main__.py +4 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/cli.py +44 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/static/css/all.min.css +6 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/static/css/bootstrap.min.css +6 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/static/js/bootstrap.bundle.min.js +7 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/static/js/chart.min.js +14 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/static/webfonts/fa-brands-400.ttf +0 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/static/webfonts/fa-brands-400.woff2 +0 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/static/webfonts/fa-regular-400.ttf +0 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/static/webfonts/fa-regular-400.woff2 +0 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/static/webfonts/fa-solid-900.ttf +0 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/static/webfonts/fa-solid-900.woff2 +0 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/static/webfonts/fa-v4compatibility.ttf +0 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/static/webfonts/fa-v4compatibility.woff2 +0 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/templates/gripper.html +932 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/templates/imu.html +805 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/templates/index.html +1076 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/templates/led.html +826 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/templates/magnetic.html +540 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/templates/mi_motor.html +1227 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/templates/motor.html +1993 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/templates/old_gripper.html +624 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/templates/pwm.html +1027 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/templates/stepper.html +1250 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/templates/ultrasonic.html +703 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger/web.py +2479 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger.egg-info/PKG-INFO +332 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger.egg-info/SOURCES.txt +36 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger.egg-info/dependency_links.txt +1 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger.egg-info/entry_points.txt +2 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger.egg-info/requires.txt +7 -0
- robodyno_debugger-1.0.0/src/robodyno_debugger.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright (c) 2023 Robottime(Beijing) Technology Co., Ltd
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: robodyno-debugger
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Robodyno 设备调试器(Web UI)
|
|
5
|
+
Author-email: awei <awei@163.com>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/awei/robodyno-debugger
|
|
8
|
+
Project-URL: Repository, https://github.com/awei/robodyno-debugger
|
|
9
|
+
Keywords: robodyno,can,debugger,robotics
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Requires-Python: >=3.8
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: flask<4,>=2.3
|
|
22
|
+
Requires-Dist: waitress>=2.1
|
|
23
|
+
Requires-Dist: robodyno>=1.7.3
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: build; extra == "dev"
|
|
26
|
+
Requires-Dist: twine; extra == "dev"
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# Robodyno Debugger
|
|
30
|
+
|
|
31
|
+
Robodyno 设备的 Web 调试器 —— 一个基于 Flask 的轻量级设备管理平台,通过浏览器即可扫描、监控和控制 CAN 总线上的所有 Robodyno 设备。
|
|
32
|
+
|
|
33
|
+

|
|
34
|
+

|
|
35
|
+

|
|
36
|
+

|
|
37
|
+

|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 功能特性
|
|
42
|
+
|
|
43
|
+
- 🔍 **自动设备扫描** —— SSE 流式推送,设备逐个实时显示
|
|
44
|
+
- 🔌 **CAN 总线管理** —— 支持 can0 ~ can3 通道,可切换波特率(1M / 500K / 250K)
|
|
45
|
+
- 🎛️ **多设备类型支持** —— 覆盖 Robodyno 全系列组件(电机 / 夹持器 / 传感器 / 控制器)
|
|
46
|
+
- 📊 **实时数据监控** —— 电压、温度、位置、速度、力矩、距离、姿态、错误状态
|
|
47
|
+
- 📈 **动态曲线绘制** —— Chart.js 实时图表(陀螺仪 / 加速度 / 欧拉角 / 距离 / 位置 / 速度 / 力矩)
|
|
48
|
+
- ⚙️ **参数在线配置** —— PID、限速、限流、控制模式在线切换
|
|
49
|
+
- 🖱️ **数值任意控制** —— 滑条实时拖动,数值徽章双击可精确输入
|
|
50
|
+
- 🔧 **设备管理** —— 在线修改设备 ID,一键校准、清错、回零
|
|
51
|
+
- 💾 **本地保存设置** —— 单位 / 步长等偏好保存在浏览器
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 支持的设备
|
|
56
|
+
|
|
57
|
+
| 设备类型 | 型号 | 状态 |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| 行星减速电机 | `ROBODYNO_PRO_*` | ✅ |
|
|
60
|
+
| 直线运动模组 | 复用行星电机驱动 | ✅ |
|
|
61
|
+
| 灵足减速电机 | `THIRD_PARTY_CYBERGEAR` | ✅ |
|
|
62
|
+
| 双指夹持器(新)| `MINI_REDUCER` | ✅ |
|
|
63
|
+
| 双指夹持器(旧)| `MINI_P100` | ✅ |
|
|
64
|
+
| 步进电机控制器 | `STEPPER_DRIVER` | ✅ |
|
|
65
|
+
| 传送带驱动器 | 复用步进驱动 | ✅ |
|
|
66
|
+
| IMU 传感器 | `IMU_SENSOR` | ✅ |
|
|
67
|
+
| 超声波传感器 | `ULTRASONIC_SENSOR` | ✅ |
|
|
68
|
+
| 磁导航传感器 | `MAGNETIC_SENSOR` | ✅ |
|
|
69
|
+
| PWM 气动控制器 | `D_VAC01` | ✅ |
|
|
70
|
+
| PWM 舵机控制器 | `D_VAC01` | ✅ |
|
|
71
|
+
| LED 控制器 | `LED_DRIVER` | ✅ |
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 安装
|
|
76
|
+
|
|
77
|
+
### 从 PyPI(推荐)
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pip install robodyno-debugger
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 系统要求
|
|
86
|
+
|
|
87
|
+
- **Python** ≥ 3.8
|
|
88
|
+
- **CAN 总线驱动**:
|
|
89
|
+
- Linux:`socketcan`(内核自带)
|
|
90
|
+
- Windows:`candle` 等
|
|
91
|
+
- **robodyno 库**:能正常识别 CAN 设备(它依赖 `python-can` 库来与 CAN 硬件通信)
|
|
92
|
+
|
|
93
|
+
### Linux 配置 CAN(示例)
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# 设置 can0 波特率为 1M
|
|
97
|
+
sudo ip link set can0 up type can bitrate 1000000
|
|
98
|
+
|
|
99
|
+
# 验证
|
|
100
|
+
ip -details link show can0
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Windows 配置 CAN
|
|
104
|
+
|
|
105
|
+
安装对应 USB-CAN 适配器的驱动,确保在设备管理器中能识别。
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 快速开始
|
|
110
|
+
|
|
111
|
+
### 1. 启动服务
|
|
112
|
+
|
|
113
|
+
- 在 `终端(PowerShell\CMD)` 中输入
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
robodyno-debugger
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
输出:
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
Robodyno Debugger 启动中...
|
|
123
|
+
访问地址: http://localhost:5000
|
|
124
|
+
监听: 0.0.0.0:5000
|
|
125
|
+
线程数: 8
|
|
126
|
+
按 Ctrl+C 停止
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### 2. 打开浏览器
|
|
130
|
+
|
|
131
|
+
访问 `http://localhost:5000`(或局域网 IP `http://192.168.x.x:5000`)。
|
|
132
|
+
|
|
133
|
+
### 3. 连接 CAN 总线
|
|
134
|
+
|
|
135
|
+
点击右下角 ⚙️ 齿轮按钮:
|
|
136
|
+
|
|
137
|
+
- 选择通道(`can0` / `can1` / `can2` / `can3`)
|
|
138
|
+
- 选择波特率(`1000000` / `500000` / `250000`)
|
|
139
|
+
- 点击「连接」
|
|
140
|
+
|
|
141
|
+
连接成功后设备会自动扫描并逐个显示。
|
|
142
|
+
|
|
143
|
+
### 4. 进入设备页面
|
|
144
|
+
|
|
145
|
+
点击 **任意设备** 卡片进入对应控制页面。
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## 命令行参数
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
robodyno-debugger [OPTIONS]
|
|
153
|
+
|
|
154
|
+
Options:
|
|
155
|
+
--host TEXT 监听地址(默认 0.0.0.0)
|
|
156
|
+
--port INTEGER 监听端口(默认 5000)
|
|
157
|
+
--threads INT 工作线程数(默认 8)
|
|
158
|
+
--help 显示帮助
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### 示例
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# 指定端口
|
|
165
|
+
robodyno-debugger --port 8080
|
|
166
|
+
|
|
167
|
+
# 只监听本地
|
|
168
|
+
robodyno-debugger --host 127.0.0.1
|
|
169
|
+
|
|
170
|
+
# 增加线程数(并发更多请求)
|
|
171
|
+
robodyno-debugger --threads 16
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## 界面说明
|
|
177
|
+
|
|
178
|
+
### 首页 —— 设备列表
|
|
179
|
+
|
|
180
|
+
- **顶部**:连接状态徽章(已连接 / 未连接)
|
|
181
|
+
- **卡片**:按 ID 排序,逐个流式加载,带淡入动画
|
|
182
|
+
- **右下角按钮**:
|
|
183
|
+
- ⓘ 系统信息(版本、IP、运行时长、CAN 状态)
|
|
184
|
+
- ⚙️ CAN 总线设置(连接 / 断开)
|
|
185
|
+
|
|
186
|
+
### 二级页面 —— 设备控制
|
|
187
|
+
|
|
188
|
+
- **左侧**:控制区(滑条、按钮、模式切换)
|
|
189
|
+
- **右侧**:实时数据(电压、温度、位置、速度、力矩、PID 等)
|
|
190
|
+
- **底部**:实时曲线(Chart.js)
|
|
191
|
+
- **右下角**:设备信息 / 设置
|
|
192
|
+
|
|
193
|
+
**双击蓝色数值徽章**可以精确输入目标值。
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## 常见问题
|
|
198
|
+
|
|
199
|
+
### Q1:无法连接 CAN
|
|
200
|
+
|
|
201
|
+
**Linux**:
|
|
202
|
+
```bash
|
|
203
|
+
sudo ip link set can0 up type can bitrate 1000000
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
**Windows**:检查 USB-CAN 适配器驱动是否安装。
|
|
207
|
+
- 驱动装好后,`robodyno` 库会自动通过 `python-can` 访问设备。
|
|
208
|
+
|
|
209
|
+
### Q2:扫描超时
|
|
210
|
+
|
|
211
|
+
- 检查 CAN 总线物理连接
|
|
212
|
+
- 逐个上电设备排查故障节点
|
|
213
|
+
|
|
214
|
+
### Q3:页面打开但无法识别设备
|
|
215
|
+
|
|
216
|
+
- 点击右下角 ⚙️ 检查 CAN 状态是否"已连接"
|
|
217
|
+
- 未连接时页面不会扫描
|
|
218
|
+
|
|
219
|
+
### Q4:`robodyno-debugger` 命令找不到
|
|
220
|
+
|
|
221
|
+
Windows 上 pip 的 Scripts 目录可能不在 PATH。备选运行方式:
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
python -m robodyno_debugger
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
或把提示的目录加到 PATH:
|
|
228
|
+
|
|
229
|
+
```powershell
|
|
230
|
+
# 比如提示的是 C:\Users\xxx\AppData\Local\Programs\Python\Python312\Scripts
|
|
231
|
+
setx PATH "%PATH%;C:\Users\xxx\AppData\Local\Programs\Python\Python312\Scripts"
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Q5:端口被占用
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
robodyno-debugger --port 8080
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
或查找占用进程:
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
# Linux / Mac
|
|
244
|
+
lsof -i :5000
|
|
245
|
+
|
|
246
|
+
# Windows
|
|
247
|
+
netstat -ano | findstr :5000
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### Q6:如何让局域网其他机器访问
|
|
251
|
+
|
|
252
|
+
默认 `--host 0.0.0.0`,直接访问本机 IP 即可:
|
|
253
|
+
|
|
254
|
+
```
|
|
255
|
+
http://192.168.1.100:5000
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
如果无法访问,检查防火墙:
|
|
259
|
+
- **Linux**:`sudo ufw allow 5000`
|
|
260
|
+
- **Windows**:控制面板 → Windows Defender 防火墙 → 允许应用通过防火墙 → 添加 Python
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## 技术栈
|
|
265
|
+
|
|
266
|
+
- **后端**:Flask、`python-can`(CAN 总线抽象库)、`robodyno`(设备控制库)
|
|
267
|
+
- **前端**:Bootstrap 5、Font Awesome 6、Chart.js
|
|
268
|
+
- **通信**:CAN 总线、Server-Sent Events(SSE)
|
|
269
|
+
- **并发**:Flask `threaded=True` + `threading.Lock` 串行化 CAN 访问
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## 相关资源
|
|
274
|
+
|
|
275
|
+
- [Robodyno 官方文档](http://101.42.250.169/1.7.3/)
|
|
276
|
+
- [robodyno Python 库](https://github.com/robodyno/robodyno)
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## License
|
|
281
|
+
|
|
282
|
+
Apache License 2.0
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## 更新日志
|
|
287
|
+
|
|
288
|
+
### v1.0.0
|
|
289
|
+
|
|
290
|
+
**设备支持**
|
|
291
|
+
|
|
292
|
+
- 行星减速电机(`ROBODYNO_PRO_*`)
|
|
293
|
+
- 直线运动模组(复用行星电机驱动)
|
|
294
|
+
- 灵足减速电机(`THIRD_PARTY_CYBERGEAR`)
|
|
295
|
+
- 双指夹持器(`MINI_REDUCER`)
|
|
296
|
+
- 旧版双指夹持器(`MINI_P100`,固件 <1.0,独立控制页面)
|
|
297
|
+
- 步进电机控制器(`STEPPER_DRIVER`)
|
|
298
|
+
- 传送带驱动器(复用步进驱动,支持 rad ↔ m 单位换算)
|
|
299
|
+
- IMU 传感器(`IMU_SENSOR`,四元数 / 欧拉角 / 陀螺仪 / 加速度)
|
|
300
|
+
- 超声波传感器(`ULTRASONIC_SENSOR`,支持 cm / m 切换)
|
|
301
|
+
- 磁导航传感器(`MAGNETIC_SENSOR`,16 位检测点阵显示)
|
|
302
|
+
- PWM 控制器(`D_VAC01`,气动执行器 / 舵机控制)
|
|
303
|
+
- LED 控制器(`LED_DRIVER`,常亮 / 闪烁 / 呼吸 / 跑马)
|
|
304
|
+
|
|
305
|
+
**CAN 总线管理**
|
|
306
|
+
|
|
307
|
+
- 支持 can0 ~ can3 通道
|
|
308
|
+
- 波特率在线切换(1M / 500K / 250K)
|
|
309
|
+
|
|
310
|
+
**设备扫描**
|
|
311
|
+
|
|
312
|
+
- SSE 流式推送,设备逐个实时显示
|
|
313
|
+
- 支持自动刷新(10 秒倒计时)与手动刷新
|
|
314
|
+
|
|
315
|
+
**实时监控与曲线**
|
|
316
|
+
|
|
317
|
+
- 位置、速度、力矩、电压、温度、错误状态
|
|
318
|
+
- 姿态(四元数 / 欧拉角 / 陀螺仪 / 加速度)、距离
|
|
319
|
+
- Chart.js 实时曲线,可切换显示数据集
|
|
320
|
+
|
|
321
|
+
**控制与配置**
|
|
322
|
+
|
|
323
|
+
- 滑条实时拖动,数值徽章双击精确输入
|
|
324
|
+
- 控制模式在线切换(位置 / 速度 / 力矩 / MIT 等)
|
|
325
|
+
- PID、速度上限、电流上限在线读写
|
|
326
|
+
- 零点设置、电机校准、错误清除、回零
|
|
327
|
+
- 设备 ID 在线修改并保存到闪存
|
|
328
|
+
|
|
329
|
+
**本地偏好**
|
|
330
|
+
|
|
331
|
+
- 单位 / 步长 / 最大行程等设置保存在浏览器
|
|
332
|
+
- 每个设备页面独立配置,互不干扰
|