-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mavlink output from Cleanflight FC not published #1868
Comments
Hi, Did you run checkid while mavros node running? Remote ids 0.200 and 51.x looks weird. Is it possible to configure system id on cleanflight? |
I tried to run checkid (confirmed mavros node was running), but it fails:
There doesn't appear to be a way to configure system id on cleanflight, and pyMavlink indicates a sysid=0 in this pic: Dug into the cleanflight code a bit more, and can confirm system id is hardcoded as 0: |
The problem that 0 means a broadcast. Mavlink router might treat it incorrectly. |
Setting target_system=0 works, and topics are broadcasting now. Thank you very much! output from ros2 topic echo diagnostics:
|
I'd like to use MAVROS to publish data coming from the Mavlink output on a Cleanflight fc. I understand that this isn't a supported controller/typical use case, but was curious if it's possible. I can see data flowing from the fc as expected using pyMavlink (example below). I can spin up a mavros_node connected to the serial port, and see that the fc appears to be receiving messages, but nothing is being published.
Thoughts on configuration changes required to make this work? Interestingly, the output of "ros2 run mavros mav checkid" exploded (see below)...
sample pyMavlink output
SYS_STATUS {onboard_control_sensors_present : 56359, onboard_control_sensors_enabled : 56359, onboard_control_sensors_health : 39, load : 0, voltage_battery : 20250, current_battery : 389, battery_remaining : 75, drop_rate_comm : 0, errors_comm : 0, errors_count1 : 0, errors_count2 : 0, errors_count3 : 0, errors_count4 : 0}
GPS_RAW_INT {time_usec : 3238052464, fix_type : 1, lat : 0, lon : 0, alt : -17000, eph : 65535, epv : 65535, vel : 0, cog : 0, satellites_visible : 0}
GLOBAL_POSITION_INT {time_boot_ms : 3238052481, lat : 0, lon : 0, alt : -17000, relative_alt : -17000, vx : 0, vy : 0, vz : 0, hdg : 34}
GPS_GLOBAL_ORIGIN {latitude : 0, longitude : 0, altitude : 0}
RC_CHANNELS_RAW {time_boot_ms : 3238132, port : 0, chan1_raw : 1500, chan2_raw : 1499, chan3_raw : 1505, chan4_raw : 999, chan5_raw : 1159, chan6_raw : 1500, chan7_raw : 1500, chan8_raw : 1500, rssi : 0}
ATTITUDE {time_boot_ms : 3238132, roll : 0.02094395086169243, pitch : 0.09948376566171646, yaw : 0.6021385788917542, rollspeed : 0.0, pitchspeed : 0.0, yawspeed : 0.0}
VFR_HUD {airspeed : 0.0, groundspeed : 0.0, heading : 34, throttle : 0, alt : -17.0, climb : 0.0}
HEARTBEAT {type : 2, autopilot : 0, base_mode : 64, custom_mode : 1, system_status : 3, mavlink_version : 3}
ATTITUDE {time_boot_ms : 3238252, roll : 0.02094395086169243, pitch : 0.09948376566171646, yaw : 0.6021385788917542, rollspeed : 0.0, pitchspeed : 0.0, yawspeed : 0.0}
VFR_HUD {airspeed : 0.0, groundspeed : 0.0, heading : 34, throttle : 0, alt : -17.0, climb : 0.0}
HEARTBEAT {type : 2, autopilot : 0, base_mode : 64, custom_mode : 1, system_status : 3, mavlink_version : 3}
RC_CHANNELS_RAW {time_boot_ms : 3238352, port : 0, chan1_raw : 1500, chan2_raw : 1499, chan3_raw : 1505, chan4_raw : 999, chan5_raw : 1159, chan6_raw : 1500, chan7_raw : 1500, chan8_raw : 1500, rssi : 0}
ATTITUDE {time_boot_ms : 3238372, roll : 0.02094395086169243, pitch : 0.09948376566171646, yaw : 0.6021385788917542, rollspeed : 0.0, pitchspeed : 0.0, yawspeed : 0.0}
VFR_HUD {airspeed : 0.0, groundspeed : 0.0, heading : 34, throttle : 0, alt : -17.0, climb : 0.0}
HEARTBEAT {type : 2, autopilot : 0, base_mode : 64, custom_mode : 1, system_status : 3, mavlink_version : 3}
ATTITUDE {time_boot_ms : 3238493, roll : 0.02094395086169243, pitch : 0.09948376566171646, yaw : 0.6021385788917542, rollspeed : 0.0, pitchspeed : 0.0, yawspeed : 0.0}
VFR_HUD {airspeed : 0.0, groundspeed : 0.0, heading : 34, throttle : 0, alt : -17.0, climb : 0.0}
HEARTBEAT {type : 2, autopilot : 0, base_mode : 64, custom_mode : 1, system_status : 3, mavlink_version : 3}
SYS_STATUS {onboard_control_sensors_present : 56359, onboard_control_sensors_enabled : 56359, onboard_control_sensors_health : 39, load : 0, voltage_battery : 20250, current_battery : 372, battery_remaining : 75, drop_rate_comm : 0, errors_comm : 0, errors_count1 : 0, errors_count2 : 0, errors_count3 : 0, errors_count4 : 0}
RC_CHANNELS_RAW {time_boot_ms : 3238573, port : 0, chan1_raw : 1500, chan2_raw : 1499, chan3_raw : 1505, chan4_raw : 999, chan5_raw : 1159, chan6_raw : 1500, chan7_raw : 1500, chan8_raw : 1500, rssi : 0}
GPS_RAW_INT {time_usec : 3238573179, fix_type : 1, lat : 0, lon : 0, alt : -17000, eph : 65535, epv : 65535, vel : 0, cog : 0, satellites_visible : 0}
GLOBAL_POSITION_INT {time_boot_ms : 3238573194, lat : 0, lon : 0, alt : -17000, relative_alt : -17000, vx : 0, vy : 0, vz : 0, hdg : 34}
GPS_GLOBAL_ORIGIN {latitude : 0, longitude : 0, altitude : 0}
ATTITUDE {time_boot_ms : 3238613, roll : 0.02094395086169243, pitch : 0.09948376566171646, yaw : 0.6021385788917542, rollspeed : 0.0, pitchspeed : 0.0, yawspeed : 0.0}
VFR_HUD {airspeed : 0.0, groundspeed : 0.0, heading : 34, throttle : 0, alt : -17.0, climb : 0.0}
HEARTBEAT {type : 2, autopilot : 0, base_mode : 64, custom_mode : 1, system_status : 3, mavlink_version : 3}
MAVROS version and platform
Mavros: 2.5.0
ROS: Iron
Ubuntu: 22.04
Autopilot type and version
[ ] ArduPilot
[ ] PX4
[x] Cleanflight
Node logs
csmotion@Ubuntu22:~/Projects/QuadROS$ ros2 launch mavros apm.launch fcu_url:=/dev/ttyS0:115200
[INFO] [launch]: All log files can be found below /home/csmotion/.ros/log/2023-06-27-11-40-00-808087-Ubuntu22-15710
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [mavros_node-1]: process started with pid [15713]
[mavros_node-1] [INFO] [1687887601.570050177] [mavros.mavros_node]: Starting mavros_node container
[mavros_node-1] [INFO] [1687887601.570236361] [mavros.mavros_node]: FCU URL: /dev/ttyS0:115200
[mavros_node-1] [INFO] [1687887601.570257512] [mavros.mavros_node]: GCS URL:
[mavros_node-1] [INFO] [1687887601.570273804] [mavros.mavros_node]: UAS Prefix: /uas1
[mavros_node-1] [INFO] [1687887601.570288885] [mavros.mavros_node]: Starting mavros router node
[mavros_node-1] [INFO] [1687887601.591960837] [mavros.mavros_router]: Built-in SIMD instructions: SSE, SSE2
[mavros_node-1] [INFO] [1687887601.592018308] [mavros.mavros_router]: Built-in MAVLink package version: 2023.6.6
[mavros_node-1] [INFO] [1687887601.592030711] [mavros.mavros_router]: Known MAVLink dialects: common ardupilotmega ASLUAV AVSSUAS all csAirLink cubepilot development icarous matrixpilot paparazzi standard storm32 uAvionix ualberta
[mavros_node-1] [INFO] [1687887601.592041406] [mavros.mavros_router]: MAVROS Router started
[mavros_node-1] [INFO] [1687887601.592081433] [mavros.mavros_router]: Requested to add endpoint: type: 0, url: /dev/ttyS0:115200
[mavros_node-1] [INFO] [1687887601.592110482] [mavros.mavros_router]: Endpoint link[1000] created
[mavros_node-1] [INFO] [1687887601.599914641] [mavros.mavros_router]: link[1000] opened successfully
[mavros_node-1] [INFO] [1687887601.600039110] [mavros.mavros_router]: Requested to add endpoint: type: 2, url: /uas1
[mavros_node-1] [INFO] [1687887601.600079221] [mavros.mavros_router]: Endpoint link[1001] created
[mavros_node-1] [INFO] [1687887601.603499606] [mavros.mavros_router]: link[1000] detected remote address 0.200
[mavros_node-1] [INFO] [1687887601.606460475] [mavros.mavros_router]: link[1001] opened successfully
[mavros_node-1] [INFO] [1687887601.606530799] [mavros.mavros_node]: Starting mavros uas node
[mavros_node-1] [INFO] [1687887601.662544807] [mavros.mavros]: Plugin actuator_control ignored
[mavros_node-1] [INFO] [1687887601.662587889] [mavros.mavros]: Plugin altitude ignored
[mavros_node-1] [INFO] [1687887601.664674435] [mavros.mavros]: UAS Executor started, threads: 4
[mavros_node-1] [INFO] [1687887601.750238999] [mavros.mavros]: Plugin command created
[mavros_node-1] [INFO] [1687887601.750332272] [mavros.mavros]: Plugin command initialized
[mavros_node-1] [INFO] [1687887601.750352236] [mavros.mavros]: Plugin ftp ignored
[mavros_node-1] [INFO] [1687887601.765067573] [mavros.mavros]: Plugin geofence created
[mavros_node-1] [INFO] [1687887601.765204519] [mavros.mavros]: Plugin geofence initialized
[mavros_node-1] [INFO] [1687887601.789957665] [mavros.mavros]: Plugin global_position created
[mavros_node-1] [INFO] [1687887601.790589651] [mavros.mavros]: Plugin global_position initialized
[mavros_node-1] [INFO] [1687887601.814573058] [mavros.mavros]: Plugin home_position created
[mavros_node-1] [INFO] [1687887601.814650930] [mavros.mavros]: Plugin home_position initialized
[mavros_node-1] [INFO] [1687887601.843186592] [mavros.mavros]: Plugin imu created
[mavros_node-1] [INFO] [1687887601.843808981] [mavros.mavros]: Plugin imu initialized
[mavros_node-1] [INFO] [1687887601.871339544] [mavros.mavros]: Plugin local_position created
[mavros_node-1] [INFO] [1687887601.871424686] [mavros.mavros]: Plugin local_position initialized
[mavros_node-1] [INFO] [1687887601.894611215] [mavros.mavros]: Plugin manual_control created
[mavros_node-1] [INFO] [1687887601.894675290] [mavros.mavros]: Plugin manual_control initialized
[mavros_node-1] [INFO] [1687887601.921876922] [mavros.mavros]: Plugin nav_controller_output created
[mavros_node-1] [INFO] [1687887601.921939688] [mavros.mavros]: Plugin nav_controller_output initialized
[mavros_node-1] [INFO] [1687887601.946146722] [mavros.mavros]: Plugin param created
[mavros_node-1] [INFO] [1687887601.946216338] [mavros.mavros]: Plugin param initialized
[mavros_node-1] [INFO] [1687887601.973761146] [mavros.mavros]: Plugin rallypoint created
[mavros_node-1] [INFO] [1687887601.974278973] [mavros.mavros]: Plugin rallypoint initialized
[mavros_node-1] [INFO] [1687887602.001381878] [mavros.mavros]: Plugin rc_io created
[mavros_node-1] [INFO] [1687887602.001591538] [mavros.mavros]: Plugin rc_io initialized
[mavros_node-1] [INFO] [1687887602.033290015] [mavros.mavros]: Plugin setpoint_accel created
[mavros_node-1] [INFO] [1687887602.033366838] [mavros.mavros]: Plugin setpoint_accel initialized
[mavros_node-1] [INFO] [1687887602.062685867] [mavros.mavros]: Plugin setpoint_attitude created
[mavros_node-1] [INFO] [1687887602.062741043] [mavros.mavros]: Plugin setpoint_attitude initialized
[mavros_node-1] [INFO] [1687887602.101373338] [mavros.mavros]: Plugin setpoint_position created
[mavros_node-1] [INFO] [1687887602.101431943] [mavros.mavros]: Plugin setpoint_position initialized
[mavros_node-1] [INFO] [1687887602.135423115] [mavros.mavros]: Plugin setpoint_raw created
[mavros_node-1] [INFO] [1687887602.135976344] [mavros.mavros]: Plugin setpoint_raw initialized
[mavros_node-1] [INFO] [1687887602.177376298] [mavros.mavros]: Plugin setpoint_trajectory created
[mavros_node-1] [INFO] [1687887602.178128450] [mavros.mavros]: Plugin setpoint_trajectory initialized
[mavros_node-1] [INFO] [1687887602.209825872] [mavros.mavros]: Plugin setpoint_velocity created
[mavros_node-1] [INFO] [1687887602.209884453] [mavros.mavros]: Plugin setpoint_velocity initialized
[mavros_node-1] [INFO] [1687887602.248423375] [mavros.mavros]: Plugin sys_status created
[mavros_node-1] [INFO] [1687887602.248552184] [mavros.mavros]: Plugin sys_status initialized
[mavros_node-1] [INFO] [1687887602.277850612] [mavros.time]: TM: Timesync mode: MAVLINK
[mavros_node-1] [INFO] [1687887602.285812727] [mavros.mavros]: Plugin sys_time created
[mavros_node-1] [INFO] [1687887602.285884422] [mavros.mavros]: Plugin sys_time initialized
[mavros_node-1] [INFO] [1687887602.324371018] [mavros.mavros]: Plugin waypoint created
[mavros_node-1] [INFO] [1687887602.324519100] [mavros.mavros]: Plugin waypoint initialized
[mavros_node-1] [INFO] [1687887602.353855161] [mavros.mavros]: Plugin wind_estimation created
[mavros_node-1] [INFO] [1687887602.353915642] [mavros.mavros]: Plugin wind_estimation initialized
[mavros_node-1] [INFO] [1687887602.356047556] [mavros.mavros]: Built-in SIMD instructions: SSE, SSE2
[mavros_node-1] [INFO] [1687887602.356092524] [mavros.mavros]: Built-in MAVLink package version: 2023.6.6
[mavros_node-1] [INFO] [1687887602.356103140] [mavros.mavros]: Known MAVLink dialects: common ardupilotmega ASLUAV AVSSUAS all csAirLink cubepilot development icarous matrixpilot paparazzi standard storm32 uAvionix ualberta
[mavros_node-1] [INFO] [1687887602.356113031] [mavros.mavros]: MAVROS UAS via /uas1 started. MY ID 1.191, TARGET ID 1.1
[mavros_node-1] [INFO] [1687887603.237328954] [mavros.mavros_router]: link[1001] detected remote address 1.191
[mavros_node-1] [INFO] [1687887603.280626980] [mavros.mavros_router]: link[1000] detected remote address 51.68
[mavros_node-1] [WARN] [1687887604.251298628] [mavros.sys]: VER: broadcast request timeout, retries left 4
[mavros_node-1] [WARN] [1687887605.267526415] [mavros.sys]: VER: broadcast request timeout, retries left 3
[mavros_node-1] [WARN] [1687887606.252799835] [mavros.sys]: VER: unicast request timeout, retries left 2
[mavros_node-1] [WARN] [1687887607.251481785] [mavros.sys]: VER: unicast request timeout, retries left 1
[mavros_node-1] [WARN] [1687887608.274209533] [mavros.sys]: VER: unicast request timeout, retries left 0
[mavros_node-1] [WARN] [1687887609.269707516] [mavros.sys]: VER: your FCU don't support AUTOPILOT_VERSION, switched to default capabilities
[mavros_node-1] [WARN] [1687887901.902659602] [mavros.mavros_router]: New subscription discovered on topic '/uas1/mavlink_source', requesting incompatible QoS. No messages will be sent to it. Last incompatible policy: RELIABILITY_QOS_POLICY
Diagnostics
header:
stamp:
sec: 1687887862
nanosec: 589443966
frame_id: ''
status:
name: 'mavros_router: MAVROS Router'
message: ok
hardware_id: none
values:
value: '2'
value: '12470'
value: '12470'
value: '0'
name: 'mavros_router: endpoint 1000: /dev/ttyS0:115200'
message: ok
hardware_id: none
values:
value: '12201'
value: '0'
value: '0'
value: '0'
value: '49'
value: '0'
value: '347708'
value: '5780'
value: '974.000000'
value: '21.000000'
value: '4'
value: '0.0'
value: '0.200'
value: '51.0'
value: '51.68'
name: 'mavros_router: endpoint 1001: /uas1'
message: ok
hardware_id: none
values:
value: '3'
value: '0.0'
value: '1.0'
value: '1.191'
header:
stamp:
sec: 1687887862
nanosec: 618829370
frame_id: ''
status:
name: 'mavros: MAVROS UAS'
message: disconnected
hardware_id: uas:///uas1
values: []
name: 'mavros: GPS'
message: No satellites
hardware_id: uas:///uas1
values:
value: '0'
value: '0'
value: Unknown
value: Unknown
name: 'mavros: System'
message: Normal
hardware_id: uas:///uas1
values:
value: '0x00000000'
value: '0x00000000'
value: '0x00000000'
value: '0.0'
value: '0.0'
value: '0'
value: '0'
value: '0'
value: '0'
value: '0'
name: 'mavros: Battery'
message: No data
hardware_id: uas:///uas1
values:
value: '-1.00'
value: '0.0'
value: '0.0'
name: 'mavros: Heartbeat'
message: No events recorded.
hardware_id: uas:///uas1
values:
value: '0'
value: '0.000000'
value: Generic micro air vehicle
value: Generic autopilot
value: ''
value: UNINIT
header:
stamp:
sec: 1687887863
nanosec: 589884065
frame_id: ''
status:
name: 'mavros_router: MAVROS Router'
message: ok
hardware_id: none
values:
value: '2'
value: '12512'
value: '12512'
value: '0'
name: 'mavros_router: endpoint 1000: /dev/ttyS0:115200'
message: ok
hardware_id: none
values:
value: '12242'
value: '0'
value: '0'
value: '0'
value: '89'
value: '0'
value: '348874'
value: '5801'
value: '1166.000000'
value: '21.000000'
value: '4'
value: '0.0'
value: '0.200'
value: '51.0'
value: '51.68'
name: 'mavros_router: endpoint 1001: /uas1'
message: ok
hardware_id: none
values:
value: '3'
value: '0.0'
value: '1.0'
value: '1.191'
header:
stamp:
sec: 1687887863
nanosec: 619260714
frame_id: ''
status:
name: 'mavros: MAVROS UAS'
message: disconnected
hardware_id: uas:///uas1
values: []
name: 'mavros: GPS'
message: No satellites
hardware_id: uas:///uas1
values:
value: '0'
value: '0'
value: Unknown
value: Unknown
name: 'mavros: System'
message: Normal
hardware_id: uas:///uas1
values:
value: '0x00000000'
value: '0x00000000'
value: '0x00000000'
value: '0.0'
value: '0.0'
value: '0'
value: '0'
value: '0'
value: '0'
value: '0'
name: 'mavros: Battery'
message: No data
hardware_id: uas:///uas1
values:
value: '-1.00'
value: '0.0'
value: '0.0'
name: 'mavros: Heartbeat'
message: No events recorded.
hardware_id: uas:///uas1
values:
value: '0'
value: '0.000000'
value: Generic micro air vehicle
value: Generic autopilot
value: ''
value: UNINIT
Check ID
csmotion@Ubuntu22:~/Projects/QuadROS$ ros2 run mavros mav checkid
[ERROR] [1687889272.864801709] [mavpy_szy8]: wait for service time out: {topic}
Traceback (most recent call last):
File "/opt/ros/iron/lib/python3.10/site-packages/mavros/cmd/init.py", line 34, in getattr
return object.getattribute(self, key)
AttributeError: 'CliClient' object has no attribute 'uas_settings'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/ros/iron/lib/mavros/mav", line 14, in
cli()
File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/opt/ros/iron/lib/python3.10/site-packages/mavros/cmd/checkid.py", line 129, in checkid
checker = Checker(client=client, follow=follow, watch_time=watch_time)
File "/opt/ros/iron/lib/python3.10/site-packages/mavros/cmd/checkid.py", line 44, in init
self.tgt_ids = client.uas_settings.target_ids
File "/opt/ros/iron/lib/python3.10/site-packages/mavros/cmd/init.py", line 36, in getattr
return getattr(self.cli, key)
File "/usr/lib/python3.10/functools.py", line 981, in get
val = self.func(instance)
File "/opt/ros/iron/lib/python3.10/site-packages/mavros/base.py", line 116, in uas_settings
pd = call_get_parameters(node=self, node_name=self.mavros_ns, names=names)
File "/opt/ros/iron/lib/python3.10/site-packages/mavros/utils.py", line 75, in call_get_parameters
wait_for_service(client, lg)
File "/opt/ros/iron/lib/python3.10/site-packages/mavros/base.py", line 55, in wait_for_service
raise ServiceWaitTimeout(topic)
mavros.base.ServiceWaitTimeout: mavros/get_parameters
[ros2run]: Process exited with failure 1
The text was updated successfully, but these errors were encountered: