• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ diagnostic_updater::DiagnosticStatusWrapper类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中diagnostic_updater::DiagnosticStatusWrapper的典型用法代码示例。如果您正苦于以下问题:C++ DiagnosticStatusWrapper类的具体用法?C++ DiagnosticStatusWrapper怎么用?C++ DiagnosticStatusWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了DiagnosticStatusWrapper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: updateDiagnostic

 void TiltLaserListener::updateDiagnostic(
   diagnostic_updater::DiagnosticStatusWrapper &stat)
 {
   boost::mutex::scoped_lock lock(cloud_mutex_);
   if (vital_checker_->isAlive()) {
     if (not_use_laser_assembler_service_ && 
         use_laser_assembler_) {
       if (cloud_vital_checker_->isAlive()) {
         stat.summary(diagnostic_msgs::DiagnosticStatus::OK,
                      getName() + " running");
       }
       else {
         stat.summary(diagnostic_msgs::DiagnosticStatus::ERROR,
                      "~input/cloud is not activate");
       }
       stat.add("scan queue", cloud_buffer_.size());
     }
     else {
       stat.summary(diagnostic_msgs::DiagnosticStatus::OK,
                    getName() + " running");
     }
     
   }
   else {
     jsk_topic_tools::addDiagnosticErrorSummary(
       name_, vital_checker_, stat);
   }
 }
开发者ID:Horisu,项目名称:jsk_recognition,代码行数:28,代码来源:tilt_laser_listener_nodelet.cpp


示例2: run

void WatchdogTask::run(diagnostic_updater::DiagnosticStatusWrapper &stat) {
  if ( alive ) {
    stat.summary(diagnostic_msgs::DiagnosticStatus::OK, "Alive");
  } else {
    stat.summary(diagnostic_msgs::DiagnosticStatus::ERROR, "No Signal");
  }
}
开发者ID:wmeeusse,项目名称:kobuki,代码行数:7,代码来源:diagnostics.cpp


示例3: gps_diag_run

	/* -*- diagnostics -*- */
	void gps_diag_run(diagnostic_updater::DiagnosticStatusWrapper &stat) {
		int fix_type, satellites_visible;
		float eph, epv;

		uas->get_gps_epts(eph, epv, fix_type, satellites_visible);

		if (satellites_visible <= 0)
			stat.summary(2, "No satellites");
		else if (fix_type < 2)
			stat.summary(1, "No fix");
		else if (fix_type == 2)
			stat.summary(0, "2D fix");
		else if (fix_type >= 3)
			stat.summary(0, "3D fix");

		stat.addf("Satellites visible", "%zd", satellites_visible);
		stat.addf("Fix type", "%d", fix_type);

		if (!isnan(eph))
			stat.addf("EPH (m)", "%.2f", eph);
		else
			stat.add("EPH (m)", "Unknown");

		if (!isnan(epv))
			stat.addf("EPV (m)", "%.2f", epv);
		else
			stat.add("EPV (m)", "Unknown");
	}
开发者ID:paul2883,项目名称:mavros,代码行数:29,代码来源:global_position.cpp


示例4: run

	void run(diagnostic_updater::DiagnosticStatusWrapper &stat) {
		lock_guard lock(mutex);
		ros::Time curtime = ros::Time::now();
		int curseq = count_;
		int events = curseq - seq_nums_[hist_indx_];
		double window = (curtime - times_[hist_indx_]).toSec();
		double freq = events / window;
		seq_nums_[hist_indx_] = curseq;
		times_[hist_indx_] = curtime;
		hist_indx_ = (hist_indx_ + 1) % window_size_;

		if (events == 0) {
			stat.summary(2, "No events recorded.");
		}
		else if (freq < min_freq_ * (1 - tolerance_)) {
			stat.summary(1, "Frequency too low.");
		}
		else if (freq > max_freq_ * (1 + tolerance_)) {
			stat.summary(1, "Frequency too high.");
		}
		else {
			stat.summary(0, "Normal");
		}

		stat.addf("Timesyncs since startup", "%d", count_);
		stat.addf("Frequency (Hz)", "%f", freq);
		stat.addf("Last dt (ms)", "%0.6f", last_dt / 1e6);
		stat.addf("Mean dt (ms)", "%0.6f", (count_) ? dt_sum / count_ / 1e6 : 0.0);
		stat.addf("Last system time (s)", "%0.9f", last_ts / 1e9);
		stat.addf("Time offset (s)", "%0.9f", offset / 1e9);
	}
开发者ID:jonbinney,项目名称:mavros,代码行数:31,代码来源:sys_time.cpp


示例5: updateDiagnostic

 void OrganizedPassThrough::updateDiagnostic(
   diagnostic_updater::DiagnosticStatusWrapper &stat)
 {
   if (vital_checker_->isAlive()) {
     stat.summary(diagnostic_msgs::DiagnosticStatus::OK,
                  name_ + " running");
     stat.add("Filtered points (Avg.)", filtered_points_counter_.mean());
     if (filter_field_ == FIELD_X) {
       stat.add("filter field", "x");
     }
     else if (filter_field_ == FIELD_Y) {
       stat.add("filter field", "y");
     }
     stat.add("min index", min_index_);
     stat.add("max index", max_index_);
     jsk_topic_tools::addDiagnosticBooleanStat("keep organized",
                                               keep_organized_,
                                               stat);
     jsk_topic_tools::addDiagnosticBooleanStat("filter_limit_negative",
                                               filter_limit_negative_,
                                               stat);
   }
   else {
     jsk_recognition_utils::addDiagnosticErrorSummary(
       "ClusterPointIndicesDecomposer", vital_checker_, stat);
   }
 }
开发者ID:Horisu,项目名称:jsk_recognition,代码行数:27,代码来源:organized_pass_through_nodelet.cpp


示例6: run

    void run(diagnostic_updater::DiagnosticStatusWrapper &stat) {
        lock_guard lock(mutex);
        ros::Time curtime = ros::Time::now();
        int curseq = count_;
        int events = curseq - seq_nums_[hist_indx_];
        double window = (curtime - times_[hist_indx_]).toSec();
        double freq = events / window;
        seq_nums_[hist_indx_] = curseq;
        times_[hist_indx_] = curtime;
        hist_indx_ = (hist_indx_ + 1) % window_size_;

        if (events == 0) {
            stat.summary(2, "No events recorded.");
        }
        else if (freq < min_freq_ * (1 - tolerance_)) {
            stat.summary(1, "Frequency too low.");
        }
        else if (freq > max_freq_ * (1 + tolerance_)) {
            stat.summary(1, "Frequency too high.");
        }
        else {
            stat.summary(0, "Normal");
        }

        stat.addf("Heartbeats since startup", "%d", count_);
        stat.addf("Frequency (Hz)", "%f", freq);
        stat.add("Vehicle type", mavros::UAS::str_type(type));
        stat.add("Autopilot type", mavros::UAS::str_autopilot(autopilot));
        stat.add("Mode", mode);
        stat.add("System status", mavros::UAS::str_system_status(system_status));
    }
开发者ID:tuloski,项目名称:SherpaHighLevel,代码行数:31,代码来源:sys_status.cpp


示例7: updateDiagnostic

 void DiagnosticNodelet::updateDiagnostic(
   diagnostic_updater::DiagnosticStatusWrapper &stat)
 {
   if (connection_status_ == SUBSCRIBED) {
     if (vital_checker_->isAlive()) {
       stat.summary(diagnostic_msgs::DiagnosticStatus::OK,
                    getName() + " running");
     }
     else {
       jsk_topic_tools::addDiagnosticErrorSummary(
         name_, vital_checker_, stat, diagnostic_error_level_);
     }
   }
   else {
     stat.summary(diagnostic_msgs::DiagnosticStatus::OK,
                  getName() + " is not subscribed");
   }
   std::stringstream topic_names;
   for (size_t i = 0; i < publishers_.size(); i++) {
     if (i == publishers_.size() - 1) {
       topic_names << publishers_[i].getTopic();
     }
     else {
       topic_names << publishers_[i].getTopic() << ", ";
     }
   }
   stat.add("watched topics", topic_names.str());
   for (size_t i = 0; i < publishers_.size(); i++) {
     stat.add(publishers_[i].getTopic(),
              (boost::format("%d subscribers") %
               publishers_[i].getNumSubscribers()).str());
   }
 }
开发者ID:kakehashi,项目名称:jsk_common,代码行数:33,代码来源:diagnostic_nodelet.cpp


示例8: roboteq_diagnostic_callback

    void WalrusPodHW::roboteq_diagnostic_callback(diagnostic_updater::DiagnosticStatusWrapper &stat, int controller)
    {
        if (controllers[controller]->is_connected())
            stat.summary(diagnostic_msgs::DiagnosticStatus::OK, "OK");
        else
            stat.summary(diagnostic_msgs::DiagnosticStatus::ERROR, "Not Connected");
	stat.add("Error Count", error_cnt);
    }
开发者ID:khancyr,项目名称:walrus,代码行数:8,代码来源:walrus_pod_hw.cpp


示例9: diagnoseConnections

void diagnoseConnections(diagnostic_updater::DiagnosticStatusWrapper &status) {
  if (!fadeToColorClient)
    status.summaryf(diagnostic_msgs::DiagnosticStatus::ERROR,
      "Not all required services are connected.");
  else
    status.summaryf(diagnostic_msgs::DiagnosticStatus::OK,
      "All required services are connected.");
}
开发者ID:Yvaine,项目名称:naro,代码行数:8,代码来源:led_controller.cpp


示例10: diag_init

 void diag_init(diagnostic_updater::DiagnosticStatusWrapper &stat)
 {
   if(isInitialized_)
     stat.summary(diagnostic_msgs::DiagnosticStatus::OK, "");
   else
     stat.summary(diagnostic_msgs::DiagnosticStatus::WARN, "");
   stat.add("Initialized", isInitialized_);
 }
开发者ID:brudder,项目名称:cob_driver,代码行数:8,代码来源:cob_powercube_chain.cpp


示例11: diagnostics

///\brief Publishes diagnostics and status
void ControlMode::diagnostics(diagnostic_updater::DiagnosticStatusWrapper& stat)
{
  int status;
  status = ((state != ControlModeTypes::ERROR) ? diagnostic_msgs::DiagnosticStatus::OK
      : diagnostic_msgs::DiagnosticStatus::ERROR);
  stat.summary(status, stateToString(state));
  stat.add("ready", ready);
  stat.add("info", info);
}
开发者ID:robotambassador,项目名称:robot-ambassadors,代码行数:10,代码来源:control_mode.cpp


示例12: diagnoseCANConnection

 void CANPriusNode::diagnoseCANConnection(
     diagnostic_updater::DiagnosticStatusWrapper& status) {
   if (_canConnection && _canConnection->isOpen())
     status.summaryf(diagnostic_msgs::DiagnosticStatus::OK,
       "CAN connection opened on %s.",
       _canConnection->getDevicePathStr().c_str());
   else
    status.summaryf(diagnostic_msgs::DiagnosticStatus::ERROR,
     "CAN connection closed on %s.", _canDeviceStr.c_str());
 }
开发者ID:jmaye,项目名称:can_prius_ros,代码行数:10,代码来源:CANPriusNode.cpp


示例13: run

	void run(diagnostic_updater::DiagnosticStatusWrapper &stat)
	{
		if (boost::shared_ptr<MAVConnInterface> link = weak_link.lock()) {
			mavlink_status_t mav_status = link->get_status();

			stat.addf("Received packets:", "%u", mav_status.packet_rx_success_count);
			stat.addf("Dropped packets:", "%u", mav_status.packet_rx_drop_count);
			stat.addf("Buffer overruns:", "%u", mav_status.buffer_overrun);
			stat.addf("Parse errors:", "%u", mav_status.parse_error);
			stat.addf("Rx sequence number:", "%u", mav_status.current_rx_seq);
			stat.addf("Tx sequence number:", "%u", mav_status.current_tx_seq);

			if (mav_status.packet_rx_drop_count > last_drop_count)
				stat.summaryf(1, "%d packeges dropped since last report",
						mav_status.packet_rx_drop_count - last_drop_count);
			else if (is_connected)
				stat.summary(0, "connected");
			else
				// link operational, but not connected
				stat.summary(1, "not connected");

			last_drop_count = mav_status.packet_rx_drop_count;
		} else {
			stat.summary(2, "not connected");
		}
	}
开发者ID:BeaglePilot,项目名称:mavros,代码行数:26,代码来源:mavros_node.cpp


示例14: addDiagnosticBooleanStat

 void addDiagnosticBooleanStat(
   const std::string& string_prefix,
   const bool value,
   diagnostic_updater::DiagnosticStatusWrapper& stat)
 {
   if (value) {
     stat.add(string_prefix, "True");
   }
   else {
     stat.add(string_prefix, "False");
   }
 }
开发者ID:CPFL,项目名称:jsk_visualization_packages,代码行数:12,代码来源:pcl_util.cpp


示例15: packetErrorStatus

  void packetErrorStatus(diagnostic_updater::DiagnosticStatusWrapper& status)
  {
    unsigned long erroneous;
    cam_->getAttribute("StatPacketsErroneous", erroneous);

    if (erroneous == 0) {
      status.summary(0, "No erroneous packets");
    } else {
      status.summary(2, "Possible camera hardware failure");
    }

    status.add("Erroneous Packets", erroneous);
  }
开发者ID:Anuragch,项目名称:stingray-3-0,代码行数:13,代码来源:prosilica_node.cpp


示例16: phidget_ik_diagnostic

void phidget_ik_diagnostic(diagnostic_updater::DiagnosticStatusWrapper &stat)
/**
 * Function that will report the status of the hardware to the diagnostic topic
 */
{
	if (!interfaceKitError)  
		stat.summaryf(diagnostic_msgs::DiagnosticStatus::OK, "initialized");
	else
	{
		stat.summaryf(diagnostic_msgs::DiagnosticStatus::ERROR, "cannot be attached");
		stat.addf("Recommendation", "Please unplug and replug the Phidget Interface Kit Board USB cable from the Motherboard.");
	}
}
开发者ID:Aharobot,项目名称:roscorobot,代码行数:13,代码来源:corobot_phidget.cpp


示例17: phidget_spatial_diagnostic

void phidget_spatial_diagnostic(diagnostic_updater::DiagnosticStatusWrapper &stat)
/**
 * Function that will report the status of the hardware to the diagnostic topic
 */
{
	if (!spatialError)  
		stat.summaryf(diagnostic_msgs::DiagnosticStatus::OK, "initialized");
	else
	{
		stat.summaryf(diagnostic_msgs::DiagnosticStatus::ERROR, "cannot be attached");
		stat.addf("Recommendation", "Please verify that the robot has a Phidget Spatial board. If present, please unplug and replug the Phidget Spatial Board USB cable from the Motherboard.");
	}
}
开发者ID:Aharobot,项目名称:roscorobot,代码行数:13,代码来源:corobot_phidget.cpp


示例18: addDiagnosticInformation

 void addDiagnosticInformation(
   const std::string& string_prefix,
   jsk_topic_tools::TimeAccumulator& accumulator,
   diagnostic_updater::DiagnosticStatusWrapper& stat)
 {
   stat.add(string_prefix + " (Avg.)", accumulator.mean());
   if (accumulator.mean() != 0.0) {
     stat.add(string_prefix + " (Avg., fps)", 1.0 / accumulator.mean());
   }
   stat.add(string_prefix + " (Max)", accumulator.max());
   stat.add(string_prefix + " (Min)", accumulator.min());
   stat.add(string_prefix + " (Var.)", accumulator.variance());
 }
开发者ID:CPFL,项目名称:jsk_visualization_packages,代码行数:13,代码来源:pcl_util.cpp


示例19: phidget_spatial_diagnostic

void phidget_spatial_diagnostic(diagnostic_updater::DiagnosticStatusWrapper &stat)
/**
 * Function that will report the status of the hardware to the diagnostic topic
 */
{
	if (!spatialError)  
		stat.summaryf(diagnostic_msgs::DiagnosticStatus::OK, "initialized");
	else
	{
		stat.summaryf(diagnostic_msgs::DiagnosticStatus::ERROR, "IMU cannot be initialized");
		stat.addf("Recommendation", PhidgetIMU_INIT_ERROR);
	}
}
开发者ID:mBusaleh,项目名称:corobot,代码行数:13,代码来源:corobot_phidget.cpp


示例20: if

  void HerculesHardwareDiagnosticTask<clearpath::DataSafetySystemStatus>::update(
      diagnostic_updater::DiagnosticStatusWrapper &stat, horizon_legacy::Channel<clearpath::DataSafetySystemStatus>::Ptr &safety_status)
  {
    uint16_t flags = safety_status->getFlags();
    msg_.timeout = (flags & SAFETY_TIMEOUT) > 0;
    msg_.lockout = (flags & SAFETY_LOCKOUT) > 0;
    msg_.e_stop = (flags & SAFETY_ESTOP) > 0;
    msg_.ros_pause = (flags & SAFETY_CCI) > 0;
    msg_.no_battery = (flags & SAFETY_PSU) > 0;
    msg_.current_limit = (flags & SAFETY_CURRENT) > 0;

    stat.add("Timeout", static_cast<bool>(msg_.timeout));
    stat.add("Lockout", static_cast<bool>(msg_.lockout));
    stat.add("Emergency Stop", static_cast<bool>(msg_.e_stop));
    stat.add("ROS Pause", static_cast<bool>(msg_.ros_pause));
    stat.add("No battery", static_cast<bool>(msg_.no_battery));
    stat.add("Current limit", static_cast<bool>(msg_.current_limit));

    stat.summary(diagnostic_msgs::DiagnosticStatus::OK, "Safety System OK");
    if ((flags & SAFETY_ERROR) > 0)
    {
      stat.mergeSummary(diagnostic_msgs::DiagnosticStatus::ERROR, "Safety System Error");
    }
    else if ((flags & SAFETY_WARN) > 0)
    {
      stat.mergeSummary(diagnostic_msgs::DiagnosticStatus::WARN, "Safety System Warning");
    }
  }
开发者ID:hscale,项目名称:compv,代码行数:28,代码来源:hercules_diagnostics.cpp



注:本文中的diagnostic_updater::DiagnosticStatusWrapper类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ diagnostic_updater::Updater类代码示例发布时间:2022-05-31
下一篇:
C++ dfhack::Maps类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap