rc: use /mavros/statustext/recv topic for STATUSTEXT messages

This commit is contained in:
Oleg Kalachev
2018-07-25 23:01:52 +03:00
parent 3b0dd46ca6
commit 601ef0848d
3 changed files with 9 additions and 9 deletions

View File

@@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>3</string>
<string>5</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>

View File

@@ -63,12 +63,12 @@ class ViewController: UIViewController, WKScriptMessageHandler {
// Got notification message
print(message)
let m = message.body as! NSDictionary;
let level = m["level"] as! Int
let level = m["severity"] as! Int
if level == 4 {
let banner = NotificationBanner(title: m["msg"] as! String, style: .warning)
let banner = NotificationBanner(title: m["text"] as! String, style: .warning)
banner.show()
} else {
let banner = NotificationBanner(title: m["msg"] as! String, style: .danger)
let banner = NotificationBanner(title: m["text"] as! String, style: .danger)
banner.show()
}
}

View File

@@ -62,15 +62,15 @@ new ROSLIB.Topic({
new ROSLIB.Topic({
ros: ros,
name: '/rosout_agg',
messageType: 'rosgraph_msgs/Log'
name: '/mavros/statustext/recv',
messageType: 'mavros_msgs/StatusText'
}).subscribe(function(message) {
var BLACKLIST = ['CMD: ', 'PR: ', 'DROPPED', 'Clock skew detected', 'MANUAL CONTROL LOST'];
if (message.level >= 4) {
if (message.severity <= 4) {
if (BLACKLIST.some(function(e) {
return message.msg.indexOf(e) != -1;
return message.text.indexOf(e) != -1;
})) {
console.log('Filtered out message ' + message.msg);
console.log('Filtered out message ' + message.text);
return;
}
callNativeApp('notification', message);