Go to the documentation of this file.00001 import rospy
00002 import actionlib
00003 from joy_pose_6d import JoyPose6D
00004
00005 try:
00006 imp.find_module("std_msgs")
00007 except:
00008 import roslib; roslib.load_manifest('jsk_teleop_joy')
00009
00010
00011 from std_msgs.msg import String, Empty
00012 from geometry_msgs.msg import PoseStamped
00013 import xml.etree.ElementTree as ET
00014
00015 class JoyGoPos(JoyPose6D):
00016 def __init__(self, name, args):
00017 JoyPose6D.__init__(self, name, args)
00018 self.supportFollowView(True)
00019 self.frame_id = self.getArg('frame_id', '/map')
00020
00021 self.goal_pub = rospy.Publisher("goal", PoseStamped)
00022 def joyCB(self, status, history):
00023 JoyPose6D.joyCB(self, status, history)
00024 latest = history.latest()
00025 if not latest:
00026 return
00027 if status.circle and not latest.circle:
00028 self.goal_pub.publish(self.pre_pose)
00029 if status.cross and not latest.cross:
00030 self.pre_pose = PoseStamped()
00031 self.pre_pose.pose.orientation.w = 1
00032