samples
overlay_menu_sample.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
3
import
rospy
4
from
jsk_rviz_plugins.msg
import
OverlayMenu
5
6
rospy.init_node(
"test_menu"
)
7
p = rospy.Publisher(
"test_menu"
, OverlayMenu, queue_size=1)
8
r = rospy.Rate(5)
9
counter = 0
10
while
not
rospy.is_shutdown():
11
menu = OverlayMenu()
12
menu.title =
"The Beatles"
13
menu.menus = [
"John Lennon"
,
"Paul McCartney"
,
"George Harrison"
,
14
"Ringo Starr"
]
15
menu.current_index = counter % len(menu.menus)
16
if
counter % 100 == 0:
17
menu.action = OverlayMenu.ACTION_CLOSE
18
menu.fg_color.r = 1.0
19
menu.fg_color.g = 1.0
20
menu.fg_color.b = 1.0
21
menu.fg_color.a = 1.0
22
menu.bg_color.r = 0.0
23
menu.bg_color.g = 0.0
24
menu.bg_color.b = 0.0
25
menu.bg_color.a = 1.0
26
p.publish(menu)
27
counter = counter + 1
28
r.sleep()
msg
jsk_rviz_plugins
Author(s): Kei Okada
, Yohei Kakiuchi
, Shohei Fujii
, Ryohei Ueda
autogenerated on Fri Aug 2 2024 08:50:14