Mavros topics not publishing?
Hi,
I've been trying to connect to a Pixhawk quadcopter using the mavros library ( http://wiki.ros.org/mavros ) and I had some issues. We are using a pixhawk and a 3DR Iris quadcopter, and we launch the mavros code with
roslaunch mavros apm2_radio.launch
The code launches with no errors are we see a long list of topics being displayed:
/diagnostics
/mavlink/from
/mavlink/to
/mavros/battery
/mavros/fix
/mavros/gps_vel
/mavros/imu/atm_pressure
/mavros/imu/data
/mavros/imu/data_raw
/mavros/imu/mag
/mavros/imu/temperature
/mavros/mission/waypoints
/mavros/radio_status
/mavros/rc/in
/mavros/rc/out
/mavros/rc/override
/mavros/state
/mavros/time_reference
/rosout
/rosout_agg
The good news is that the /mavros/state, /diagnostics, and /mavros/radio_status seem to be publishing correctly
$:rostopic echo /mavros/state
header:
seq: 100
stamp:
secs: 1411583514
nsecs: 793784329
frame_id: ''
armed: False
guided: False
mode: ALT_HOLD
The bad news is that every other topic is empty. No GPS data, no battery data, no RC data, etc. Has anyone else run this code and knows how to get this data to publish?
The closest thing online I found is this online book: http://erlerobotics.gitbooks.io/erler...
The problem is, they experienced the same problem but gave no reason/fix for it.
Thanks!
EDIT: Adding information On a fresh install of Ubuntu 14.04 and a newly installed mavros
sudo apt-get install mavros
I tried to get sensor data from a 3DR Iris Pixhawk. As per @vooon 's suggestion, I used rqt_logger_level to view the mavros.ros.mavconn debug messages.
# Changed the default fcu_url to ttyUSB0 instead of ttyACM0, because that's the port my 3DR modem was on.
<arg name="fcu_url" default="/dev/ttyUSB0:57600" />
Launched the file using px4.launch, enabled mavconn Debug messages, and watched the message ID's that showed up.
- First, during the section where you get the heartbeat, there were a mixture of 0, 166, and 109 messages.
Then message ID 253 was published three times in a row, in conjunction with FCU lines for ArduCopter V3.1.2, PX4 and PX4v2:
[DEBUG] [1411862177.961715937]: serial0:recv: Message-Id: 253 [51 bytes] Sys-Id: 1 Comp-Id: 1 [ INFO] [1411862177.961821314]: FCU: ArduCopter V3.1.2 (e2ed3dd1)
After that, during bootup, there is a fast stream of 22 IDs split up by 0, 166, and 109
At the end of a long stream of 22's it gets 43, 44, 40, 39, and 47 in quick succession:
[DEBUG] [1411862299.848786274]: serial0:send: Message-Id: 43 [2 bytes] [DEBUG] [1411862299.929775171]: serial0:recv: Message-Id: 44 [4 bytes] Sys-Id: 1 Comp-Id: 1 [DEBUG] [1411862299.929917816]: serial0:send: Message-Id: 40 [4 bytes] [DEBUG] [1411862300.143771523]: serial0:recv: Message-Id: 39 [37 bytes] Sys-Id: 1 Comp-Id: 1 [ INFO] [1411862300.143899206]: WP: item #0 GAA WAYPOINT CUR params: 0, 0, 0, 0 x: 42.2936 y: -71.2638 z: 0 [DEBUG] [1411862300.143942143]: serial0:send: Message-Id: 47 [3 bytes] [ INFO] [1411862300.143995581]: WP: mission received [ WARN] [1411862300.673739713]: PR: request param #133 timeout, retries left 2, and ...
Are you using APM firmware on the PX4? If not, try using the PX4 launch file. There is a quirk for PX4. Do you get a heartbeat?
I'll post the code I get upon launch in the answer below, it maxes out the comment length
Try enable
.mavconn
debug output using rqt_logger_level. Also use rqt to view diagnostics and topic updates. I tested with apm2_radio.launch with original APM 2.6, works. On pixhawk i only use PX4, but should no matter.@tony - I tried using the PX4 launch file and have the same problem, unfortunately. I do get the heartbeat message: CON: Got HEARTBEAT, connected.
@vooon - I enabled the ros.mavros.mavconn Debug level and got a lot of messages like this: "serial0:recv: Message-Id: 22 [25 bytes] Sys-Id: 1 Comp-Id: 1" with a couple different message IDs. There weren't any obvious flags showing up in the debug stream.
I could easily be doing something dumb where I have to arm the quadcopter or flip some switch before it starts publishing to the sensor data topics. Currently I just turn the copter on, hit the safety button, and check whether /mavors/imu/data, /mavros/battery, etc. are getting anything
Check that following message ids are send: 30 (ATTITUDE), 27 (RAW_IMU), 24 (GPS_RAW_INT).
20-23 is parameter protocol messages.
Also what version you use?