12 from sensor_msgs.msg
import Image
14 from image_view2.msg
import MouseEvent
18 pub_plus = rospy.Publisher(
'~plus_rect_event', MouseEvent, queue_size=1)
19 pub_minus = rospy.Publisher(
'~minus_rect_event', MouseEvent, queue_size=1)
21 width =
int(rospy.get_param(
'~image_width'))
22 height =
int(rospy.get_param(
'~image_height'))
24 MouseEvent(type=3, x=
int(width/4), y=
int(height/4), width=width, height=height),
25 MouseEvent(type=4, x=
int(width/2), y=
int(height/2), width=width, height=height),
26 MouseEvent(type=2, x=
int(3*width/4), y=
int(3*height/4), width=width, height=height),
29 MouseEvent(type=3, x=
int(3*width/4), y=
int(3*height/4), width=width, height=height),
30 MouseEvent(type=4, x=
int(width/2), y=
int(height/2), width=width, height=height),
31 MouseEvent(type=2, x=
int(width/4), y=
int(height/4), width=width, height=height),
34 while not rospy.is_shutdown():
36 e.header.stamp = rospy.get_rostime()
39 for e
in minus_events:
40 e.header.stamp = rospy.get_rostime()
45 if __name__ ==
'__main__':
46 rospy.init_node(
'publish_mouse_event')