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 
jsk_teleop_joy.plugin.relay.Relay.pub
pub
Definition: relay.py:19
jsk_teleop_joy.plugin.relay.RelayAndConvertToPS3.joyCB
def joyCB(self, status, history)
Definition: relay.py:37
jsk_teleop_joy.joy_plugin.JSKJoyPlugin.getArg
def getArg(self, key, default=None)
Definition: joy_plugin.py:19
jsk_teleop_joy.joy_plugin
Definition: joy_plugin.py:1
jsk_teleop_joy.plugin.relay.RelayAndConvertToPS3.__init__
def __init__(self, name, args)
Definition: relay.py:35
jsk_teleop_joy.joy_plugin.JSKJoyPlugin
Definition: joy_plugin.py:5
jsk_teleop_joy.plugin.relay.Relay.joyCB
def joyCB(self, status, history)
Definition: relay.py:30
jsk_teleop_joy.plugin.relay.Relay.joy_mux_srv_name
joy_mux_srv_name
Definition: relay.py:16
jsk_teleop_joy.plugin.relay.Relay.disable
def disable(self)
Definition: relay.py:24
jsk_teleop_joy.plugin.relay.Relay.joy_mux_select_srv
joy_mux_select_srv
Definition: relay.py:17
jsk_teleop_joy.plugin.relay.RelayAndConvertToPS3
Definition: relay.py:34
jsk_teleop_joy.plugin.relay.Relay.output_topic
output_topic
Definition: relay.py:14
jsk_teleop_joy.plugin.relay.Relay.__init__
def __init__(self, name, args)
Definition: relay.py:12
jsk_teleop_joy.plugin.relay.Relay.org_topic
org_topic
Definition: relay.py:15
jsk_teleop_joy.plugin.relay.Relay.enable
def enable(self)
Definition: relay.py:18
jsk_teleop_joy.plugin.relay.Relay
Definition: relay.py:11
msg


jsk_teleop_joy
Author(s): Ryohei Ueda
autogenerated on Wed Jan 24 2024 04:05:49