本文整理汇总了Python中display.Display.scatter方法的典型用法代码示例。如果您正苦于以下问题:Python Display.scatter方法的具体用法?Python Display.scatter怎么用?Python Display.scatter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类display.Display
的用法示例。
在下文中一共展示了Display.scatter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Display
# 需要导入模块: from display import Display [as 别名]
# 或者: from display.Display import scatter [as 别名]
#!/usr/bin/env python
"""
Plot points from a trackem_ros stream.
SCL; 19 August 2012.
"""
import roslib; roslib.load_manifest("slamsynth_ros")
import rospy
from trackem_ros.msg import *
import numpy as np
from display import Display
if __name__ == "__main__":
rospy.init_node("miniviz")
d = Display(mapsize=[0,3.048,0,3.048]) # in meters
d.marker = 'o' # Backwards compatibility until bentobox.cds is updated
rate = rospy.Rate(10)
while not rospy.is_shutdown():
data = rospy.wait_for_message("trackem/calpoints", MTCalPoints)
points = np.array([[p.x, p.y] for p in data.points])
d.clear()
d.scatter(points.T[0], points.T[1])
d.blit()
rate.sleep()
示例2: str
# 需要导入模块: from display import Display [as 别名]
# 或者: from display.Display import scatter [as 别名]
if verbose > 0:
print 'NO AUT, CONTINUING'
continue
(px,py),path = tutil.getNextGoal(aut, (wx,wy), qclose, n=5, verbose=1)
goal = t.quadToWorld((py,px),(0,3))
if verbose > 0:
print "Goal position is " + str(goal)
if verbose > 0:
print 'DRAWING PATH:', path
for addr in path:
matches = t.getMatches(addr,exact=True)
if matches: matches[0].setMark('path')
d.quad(t)
d.pose2d([x,y,h])
d.blit()
if not passive_mode:
bi.goToPoint(goal)
# calling quad more than necessary for sake of prettiness...
d.quad(t)
xl,yl = [],[]
xl,yl = occ.getScatterVectors()
if xl != []:
d.clear()
d.scatter(xl,yl)
d.pose2d([x,y,h])
d.blit()