def main(): rospy.init_node('axclient', anonymous=True) parser = OptionParser(__doc__.strip()) # parser.add_option("-t","--test",action="store_true", dest="test",default=False, # help="A testing flag") # parser.add_option("-v","--var",action="store",type="string", dest="var",default="blah") (options, args) = parser.parse_args(rospy.myargv()) if (len(args) == 2): # get action type via rostopic topic_type = rostopic._get_topic_type("%s/goal" % args[1])[0] # remove "Goal" string from action type assert ("Goal" in topic_type) topic_type = topic_type[0:len(topic_type) - 4] elif (len(args) == 3): topic_type = args[2] print(topic_type) assert ("Action" in topic_type) else: parser.error( "You must specify the action topic name (and optionally type) Eg: ./axclient.py action_topic actionlib/TwoIntsAction " ) action = DynamicAction(topic_type) app = AXClientApp(action, args[1]) app.MainLoop() app.OnQuit() rospy.signal_shutdown('GUI shutdown')
self.sz.Add(self.status_bg, 0, wx.EXPAND) self.frame.SetSizer(self.sz) self.set_goal(None) self.sz.Layout() self.frame.Show() return True if __name__ == '__main__': rospy.init_node('axserver', anonymous=True) parser = OptionParser(__doc__.strip()) # parser.add_option("-t","--test",action="store_true", dest="test",default=False, # help="A testing flag") # parser.add_option("-v","--var",action="store",type="string", dest="var",default="blah") (options, args) = parser.parse_args(rospy.myargv()) if (len(args) != 3): parser.error("You must specify the action name and type. Eg: ./axserver.py my_action actionlib/Test") action = DynamicAction(args[2]) app = AXServerApp(action, args[1]) app.MainLoop() rospy.signal_shutdown('GUI shutdown')