本文整理匯總了Python中sensor_msgs.msg.LaserScan.intensities[i]方法的典型用法代碼示例。如果您正苦於以下問題:Python LaserScan.intensities[i]方法的具體用法?Python LaserScan.intensities[i]怎麽用?Python LaserScan.intensities[i]使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sensor_msgs.msg.LaserScan
的用法示例。
在下文中一共展示了LaserScan.intensities[i]方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: handle_laser_scan
# 需要導入模塊: from sensor_msgs.msg import LaserScan [as 別名]
# 或者: from sensor_msgs.msg.LaserScan import intensities[i] [as 別名]
def handle_laser_scan(laserMsg,currTime):
scan = LaserScan()
scan.header.stamp = currTime
scan.header.frame_id = "base_link"
scan.angle_min = -1.57
scan.angle_max = 1.57
scan.angle_increment = 3.14/181
scan.time_increment = (1/0.5)/181
scan.range_min = 0.0
scan.range_max = 10.0
scan.ranges = [0.0 for i in xrange(len(laserMsg)-1)]
scan.intensities = [0.0 for i in xrange(len(laserMsg)-1)]
for i in xrange(len(laserMsg)-1):
scan.ranges[i] =laserMsg[i]
scan.intensities[i]= 100
laserPub = rospy.Publisher('scan',LaserScan,queue_size = 1)
laserPub.publish(scan)
rospy.sleep(4.0)