From f7b47afae738cf0d29f7c00838b8d8f02811d79d Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Wed, 21 Feb 2018 21:40:40 +0300 Subject: [PATCH] mobile rc: publish initial /state_latched --- clever/src/rc.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clever/src/rc.cpp b/clever/src/rc.cpp index 27d39591..d96629ba 100644 --- a/clever/src/rc.cpp +++ b/clever/src/rc.cpp @@ -55,8 +55,6 @@ private: { ROS_INFO("State timeout"); mavros_msgs::State unknown_state; - unknown_state.connected = true; - unknown_state.mode = "UNKNOWN"; state_pub.publish(unknown_state); state_msg = nullptr; } @@ -66,6 +64,10 @@ private: state_sub = nh.subscribe("mavros/state", 1, &RC::handleState, this); state_pub = nh.advertise("state_latched", 1, true); state_timeout_timer = nh.createTimer(ros::Duration(0), &RC::stateTimedOut, this, true, false); + + // Publish initial state + mavros_msgs::State unknown_state; + state_pub.publish(unknown_state); } int createSocket(int port)