diff --git a/clover/src/optical_flow.cpp b/clover/src/optical_flow.cpp index 05e31109..4c66f0de 100644 --- a/clover/src/optical_flow.cpp +++ b/clover/src/optical_flow.cpp @@ -53,6 +53,7 @@ private: std::unique_ptr tf_buffer_; std::unique_ptr tf_listener_; bool calc_flow_gyro_; + float flow_gyro_default_; void onInit() { @@ -69,6 +70,7 @@ private: roi_px_ = nh_priv.param("roi", 128); roi_rad_ = nh_priv.param("roi_rad", 0.0); calc_flow_gyro_ = nh_priv.param("calc_flow_gyro", false); + flow_gyro_default_ = nh_priv.param("flow_gyro_default", NAN); img_pub_ = it_priv.advertise("debug", 1); flow_pub_ = nh.advertise("mavros/px4flow/raw/send", 1); @@ -194,9 +196,9 @@ private: uint32_t integration_time_us = integration_time.toSec() * 1.0e6; // Calculate flow gyro - flow_.integrated_xgyro = NAN; - flow_.integrated_ygyro = NAN; - flow_.integrated_zgyro = NAN; + flow_.integrated_xgyro = flow_gyro_default_; + flow_.integrated_ygyro = flow_gyro_default_; + flow_.integrated_zgyro = flow_gyro_default_; if (calc_flow_gyro_) { try { diff --git a/clover/www/js/topics.js b/clover/www/js/topics.js index 8053502a..c8710277 100644 --- a/clover/www/js/topics.js +++ b/clover/www/js/topics.js @@ -3,11 +3,13 @@ const ros = new ROSLIB.Ros({ url: url }); ros.on('connection', function () { document.body.classList.add('connected'); + document.body.classList.remove('closed'); init(); }); ros.on('close', function () { document.body.classList.remove('connected'); + document.body.classList.add('closed'); setTimeout(function() { // reconnect ros.connect(url); diff --git a/clover/www/topics.html b/clover/www/topics.html index b42ac1c2..309c3969 100644 --- a/clover/www/topics.html +++ b/clover/www/topics.html @@ -17,6 +17,7 @@ } #topic-type { font-family: monospace; font-size: 0.5em; vertical-align: super; font-weight: normal; } .topic { font-family: monospace; } + body.closed { background-color: rgb(207, 207, 207); }