relay.py
Go to the documentation of this file.
1 from jsk_teleop_joy.joy_plugin import JSKJoyPlugin
2 try:
3  from sensor_msgs.msg import Joy
4 except:
5  import roslib; roslib.load_manifest("jsk_teleop_joy")
6  from sensor_msgs.msg import Joy
7 
8 import rospy
9 from topic_tools.srv import MuxSelect
10 
12  def __init__(self, name, args):
13  JSKJoyPlugin.__init__(self, name, args)
14  self.output_topic = self.getArg("output_topic", "output")
15  self.org_topic = self.getArg("joy_original_topic", "/joy_org")
16  self.joy_mux_srv_name = self.getArg("joy_mux", "mux")
17  self.joy_mux_select_srv = rospy.ServiceProxy(self.joy_mux_srv_name + "/select" , MuxSelect)
18  def enable(self):
19  self.pub = rospy.Publisher(self.output_topic, Joy)
20  try:
22  except:
23  rospy.logerr("Missing joy mux: %s", self.joy_mux_srv_name)
24  def disable(self):
25  self.pub.unregister()
26  try:
27  self.joy_mux_select_srv(self.org_topic)
28  except:
29  rospy.logerr("Missing joy mux: %s", self.joy_mux_srv_name)
30  def joyCB(self, status, history):
31  self.pub.publish(status.orig_msg)
32 
33 
35  def __init__(self, name, args):
36  Relay.__init__(self, name, args)
37  def joyCB(self, status, history):
38  self.pub.publish(status.toPS3Msg())
39 
40 
def joyCB(self, status, history)
Definition: relay.py:30
def __init__(self, name, args)
Definition: relay.py:12
def joyCB(self, status, history)
Definition: relay.py:37
def getArg(self, key, default=None)
Definition: joy_plugin.py:19


jsk_teleop_joy
Author(s): Ryohei Ueda
autogenerated on Sun May 28 2023 03:03:37