Small improvements
This commit is contained in:
@@ -55,7 +55,7 @@ class PublishTarget(Node):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__('publisher')
|
super().__init__('publisher')
|
||||||
self.publisher_ = self.create_publisher(PoseStamped, '/target_pose', 10)
|
self.publisher_ = self.create_publisher(PoseStamped, '/target_pose', 10)
|
||||||
timer_period = 3.0 # seconds
|
timer_period = 7.0 # seconds
|
||||||
self.timer = self.create_timer(timer_period, self.timer_callback)
|
self.timer = self.create_timer(timer_period, self.timer_callback)
|
||||||
self.i = 0
|
self.i = 0
|
||||||
|
|
||||||
|
|||||||
@@ -45,9 +45,17 @@ class DrawingApp(tk.Tk):
|
|||||||
self.read_queue()
|
self.read_queue()
|
||||||
|
|
||||||
self.canvas = tk.Canvas(self,width=self.width,height=self.height)
|
self.canvas = tk.Canvas(self,width=self.width,height=self.height)
|
||||||
|
|
||||||
|
|
||||||
self.tk_image = ImageTk.PhotoImage(self.img)
|
self.tk_image = ImageTk.PhotoImage(self.img)
|
||||||
self.canvas.create_image(self.width/2,self.height/2,image=self.tk_image)
|
self.canvas.create_image(self.width/2,self.height/2,image=self.tk_image)
|
||||||
self.canvas.pack(side='top', expand=True, fill='both')
|
self.canvas.pack(side='top', expand=True, fill='both')
|
||||||
|
|
||||||
|
def reset():
|
||||||
|
self.img = PImage.new("RGB", (self.width, self.height), (255, 255, 255))
|
||||||
|
self.arr = np.array(self.img)
|
||||||
|
tk.Button(self.canvas, text= "reset", command=reset).pack()
|
||||||
|
|
||||||
self.draw_window()
|
self.draw_window()
|
||||||
|
|
||||||
def draw(self,x,y,z):
|
def draw(self,x,y,z):
|
||||||
|
|||||||
Reference in New Issue
Block a user