diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2012-08-16 13:09:35 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2012-08-16 13:09:35 +0200 |
commit | b30e443f282981cbbf836cb087e0d1e0aeb72496 (patch) | |
tree | 4369de57a672b815038c4607f169eb6e3ebce2d9 /apps/mavlink/mavlink.c | |
parent | e84d0f41fa17e3e83ff3d58861ee572570604c19 (diff) | |
download | px4-firmware-b30e443f282981cbbf836cb087e0d1e0aeb72496.tar.gz px4-firmware-b30e443f282981cbbf836cb087e0d1e0aeb72496.tar.bz2 px4-firmware-b30e443f282981cbbf836cb087e0d1e0aeb72496.zip |
Updated start script, checking commander mishaps
Diffstat (limited to 'apps/mavlink/mavlink.c')
-rw-r--r-- | apps/mavlink/mavlink.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/mavlink/mavlink.c b/apps/mavlink/mavlink.c index 66b3865cc..dc8b2a2c8 100644 --- a/apps/mavlink/mavlink.c +++ b/apps/mavlink/mavlink.c @@ -925,6 +925,10 @@ void handleMessage(mavlink_message_t *msg) vcmd.source_component = msg->compid; vcmd.confirmation = 1; + /* check if topic is advertised */ + if (cmd_pub <= 0) { + cmd_pub = orb_advertise(ORB_ID(vehicle_command), &vcmd); + } /* create command */ orb_publish(ORB_ID(vehicle_command), cmd_pub, &vcmd); } |