我正在尝试使用 mavros 连接到 pixracer 单元。 以前,我使用了一台通过物理串行电缆连接到 pixhawk 的配套计算机。 现在我希望使用 wifi 连接通过 ESP8266 板直接与 pixracer 通信。 我已经配置了在站模式下运行的 wifi 并愉快地与 qGroundcontrol 和我的路由器连接(所以我认为 pixracer/ESP8266 运行和设置正确)但我正在努力通过 mavros 连接到 fcu。
我使用的 udp 地址是: udp://:[email protected]:14540
- 其中 192.168.1.9 是 pixracer 的 IP 地址
这种格式看起来好吗? 也许我也需要设置一些参数? 我已将SYS_COMPANION
为ESP8266 (921600 baud, 8N1)
。
马夫罗斯:0.22.0
ROS:动力学
Ubuntu:16.04
[ ] ArduPilot
[x] PX4
版本:1.6.5
copy output of mavros_node. Usually console where you run roslaunch
header:
seq: 15
stamp:
secs: 1523479866
nsecs: 896584974
frame_id: ''
status:
-
level: 1
name: "UAV_1/mavros: FCU connection"
message: "not connected"
hardware_id: "udp://:[email protected]:14540"
values:
-
key: "Received packets:"
value: "0"
-
key: "Dropped packets:"
value: "0"
-
key: "Buffer overruns:"
value: "0"
-
key: "Parse errors:"
value: "0"
-
key: "Rx sequence number:"
value: "0"
-
key: "Tx sequence number:"
value: "141"
-
key: "Rx total bytes:"
value: "0"
-
key: "Tx total bytes:"
value: "36947"
-
key: "Rx speed:"
value: "0.000000"
-
key: "Tx speed:"
value: "9547.000000"
-
level: 2
name: "UAV_1/mavros: GPS"
message: "No satellites"
hardware_id: "udp://:[email protected]:14540"
values:
-
key: "Satellites visible"
value: "0"
-
key: "Fix type"
value: "0"
-
key: "EPH (m)"
value: "Unknown"
-
key: "EPV (m)"
value: "Unknown"
-
level: 2
name: "UAV_1/mavros: Heartbeat"
message: "No events recorded."
hardware_id: "udp://:[email protected]:14540"
values:
-
key: "Heartbeats since startup"
value: "0"
-
key: "Frequency (Hz)"
value: "0.000000"
-
key: "Vehicle type"
value: "Generic micro air vehicle"
-
key: "Autopilot type"
value: "Generic autopilot"
-
key: "Mode"
value: ''
-
key: "System status"
value: "Uninit"
-
level: 0
name: "UAV_1/mavros: System"
message: "Normal"
hardware_id: "udp://:[email protected]:14540"
values:
-
key: "Sensor present"
value: "0x00000000"
-
key: "Sensor enabled"
value: "0x00000000"
-
key: "Sensor helth"
value: "0x00000000"
-
key: "CPU Load (%)"
value: "0.0"
-
key: "Drop rate (%)"
value: "0.0"
-
key: "Errors comm"
value: "0"
-
key: "Errors count #1"
value: "0"
-
key: "Errors count #2"
value: "0"
-
key: "Errors count #3"
value: "0"
-
key: "Errors count #4"
value: "0"
-
level: 2
name: "UAV_1/mavros: Battery"
message: "No data"
hardware_id: "udp://:[email protected]:14540"
values:
-
key: "Voltage"
value: "-1.00"
-
key: "Current"
value: "0.0"
-
key: "Remaining"
value: "0.0"
-
level: 2
name: "UAV_1/mavros: Time Sync"
message: "No events recorded."
hardware_id: "udp://:[email protected]:14540"
values:
-
key: "Timesyncs since startup"
value: "0"
-
key: "Frequency (Hz)"
value: "0.000000"
-
key: "Last dt (ms)"
value: "0.000000"
-
key: "Mean dt (ms)"
value: "0.000000"
-
key: "Last system time (s)"
value: "0.000000000"
-
key: "Time offset (s)"
value: "0.000000000"
---
ERROR. I got 0 addresses, but not your target 1:1
QGC 使用什么地址?
我正在使用udp://:[email protected]:14550
(其中 192.168.1.5 是我的地面控制站的 ip - 遵循 https://dev.px4.io/en/simulation/ros_interface.html 中记录的约定,即使这与sitl有关)。
值得注意的是,pixracer 在启动时自动连接到 QGroundControl(在 mavros 外部)——也许这里可能有冲突?
很有可能是。 我不确定 ESP 固件是否遵循该规范。 尝试(没有 QGC)默认端口,例如udp://@192.168.1.5
,甚至简单的udp://@
。
我仍然无法连接到地面控制站的这些地址。 我认为这可能需要对 ESP 固件进行一些更新,但我还没有弄清楚代码库。 如果有任何成功,我会在这里更新。
@jannsta1更新了吗?
我刚刚再次尝试并通过将 udp 端口值设置为匹配默认的 WIFI_UDP_CPORT (14555) 和 WIFI_UDP_HPORT (14550) 参数值(对于 ESP 模块)来设法连接。 因此我的 fcu_url 是; udp://:14550@<ip address of esp device>:14555
。
我还没有做过飞行测试,缺点是这不适用于 QGC,但我很乐意解决这个问题。 感谢您提供有关 UDP 地址的建议,这对了解要查看的区域有很大帮助。
我能够使用 fcu_url 语法连接默认的 udp 端口值。 谢谢! 我想我会跟进这个以防万一其他人仍然有让 QGC 与 mavros 一起工作的问题。
我能够通过改变CPORT和hport值,如图所示得到QGC和MAVROS工作在这里(我选择14556和14551,分别),这将使fcu_url: udp://:14551:@<ip address of esp device>:14556
同时保持gcs_url: udp-b://127.0.0.1:14555@14550
。
最有用的评论
我能够使用 fcu_url 语法连接默认的 udp 端口值。 谢谢! 我想我会跟进这个以防万一其他人仍然有让 QGC 与 mavros 一起工作的问题。
我能够通过改变CPORT和hport值,如图所示得到QGC和MAVROS工作在这里(我选择14556和14551,分别),这将使fcu_url:
udp://:14551:@<ip address of esp device>:14556
同时保持gcs_url:udp-b://127.0.0.1:14555@14550
。