mirror of
https://github.com/CopterExpress/clover.git
synced 2026-05-26 21:19:35 +00:00
led: don’t crash on incorrect mode value
This commit is contained in:
@@ -263,7 +263,10 @@ void handleMavrosState(const mavros_msgs::State& msg)
|
||||
// remove the part before "."
|
||||
mode = mode.substr(mode.find(".") + 1);
|
||||
}
|
||||
notify(mode);
|
||||
std::string err;
|
||||
if (ros::names::validate(mode, err)) {
|
||||
notify(mode);
|
||||
}
|
||||
}
|
||||
mavros_state = msg;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user