2 from jsk_rviz_plugins.msg
import OverlayMenu
3 from std_srvs.srv
import Empty
9 JSKJoyPlugin.__init__(self, name, args)
10 self.
menu_pub = rospy.Publisher(
"/overlay_menu", OverlayMenu)
17 self.
getArg(
"clear_maps",
"/env_server/clear_maps"), Empty)
19 self.
getArg(
"register_current_map",
"/env_server/register_to_hisotry"), Empty)
21 self.
getArg(
"register_completed_map",
"/env_server/register_completion_to_hisotry"), Empty)
23 def joyCB(self, status, history):
25 if history.new(status,
'up'):
27 elif history.new(status,
'down'):
30 if history.new(status,
'cross'):
33 self.
manager.forceToPluginMenu(publish_menu=
False)
34 elif history.new(status,
'circle'):
53 self.
manager.forceToPluginMenu(publish_menu=
False)
57 except rospy.ServiceException
as e:
58 rospy.logfatal(
"failed to register current map: %s" % (e))
62 except rospy.ServiceException
as e:
63 rospy.logfatal(
"failed to register completed current map: %s" % (e))
67 except rospy.ServiceException
as e:
68 rospy.logfatal(
"failed to clear_map: %s" % (e))
71 menu.menus = [m[0]
for m
in self.
menus]
73 menu.title = self.
name 75 menu.action = OverlayMenu.ACTION_CLOSE
def appendPreDefinedPolygon(self)
def publishMenu(self, close=False)
def __init__(self, name, args)
register_completed_map_srv
def getArg(self, key, default=None)
def clearEnvironment(self)
def registerCurrentGridMap(self)
def joyCB(self, status, history)