#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-

import rospy
import time
from common_msgs.msg import alarminfo

def talker():
    rospy.init_node('NetWorking', anonymous=True)
    networking_monitor = rospy.Publisher('bp_alarm',alarminfo, queue_size=10)
    rospy.Rate(10) # 10hz

    info = alarminfo()
    info.code = '20004'
    info.level = 1
    info.msg = "The robot attitude abnormal"

    time.sleep(3.5)
    networking_monitor.publish(info)
    time.sleep(3.5)
    rospy.signal_shutdown("closed!")

if __name__ == '__main__':
    try:
        talker()
    except rospy.ROSInterruptException:
        pass

 

相关文章:

  • 2022-12-23
  • 2021-06-28
  • 2021-06-26
  • 2021-05-30
  • 2021-05-25
  • 2022-02-17
  • 2022-12-23
  • 2021-12-26
猜你喜欢
  • 2021-09-24
  • 2022-01-12
  • 2021-12-29
  • 2021-12-21
  • 2021-10-28
  • 2022-12-23
相关资源
相似解决方案