Main Page
Namespaces
Classes
Files
File List
scripts
rviz_joint_fixer.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
# coding: utf-8
3
4
import
rospy
5
from
sensor_msgs.msg
import
JointState
6
7
class
Dummy
:
8
def
__init__
(self):
9
self.
sub
= rospy.Subscriber(rospy.get_namespace()+
"joint_states"
, JointState, self.
joint_callback
, queue_size=10)
10
self.
pub
= rospy.Publisher(rospy.get_namespace()+
"joint_states_source"
, JointState, queue_size=10)
11
self.
r
= rospy.Rate(50)
12
13
def
joint_callback
(self, msg):
14
js = JointState();
15
if
len(msg.position) > 0:
16
js.name.append(
"joint6"
)
17
js.position.append(-msg.position[4])
18
self.pub.publish(js)
19
self.r.sleep()
20
21
if
__name__ ==
"__main__"
:
22
try
:
23
while
not
rospy.is_shutdown():
24
rospy.init_node(
"rviz_slave_joint_state"
)
25
dummy =
Dummy
()
26
rospy.spin()
27
except
rospy.ROSIntteruptException:
28
pass
29
rviz_joint_fixer.Dummy.joint_callback
def joint_callback(self, msg)
Definition:
rviz_joint_fixer.py:13
rviz_joint_fixer.Dummy.__init__
def __init__(self)
Definition:
rviz_joint_fixer.py:8
rviz_joint_fixer.Dummy.pub
pub
Definition:
rviz_joint_fixer.py:10
rviz_joint_fixer.Dummy.sub
sub
Definition:
rviz_joint_fixer.py:9
rviz_joint_fixer.Dummy.r
r
Definition:
rviz_joint_fixer.py:11
rviz_joint_fixer.Dummy
Definition:
rviz_joint_fixer.py:7
raspigibbon_description
Author(s): Daisuke Sato
, Shota Hirama
autogenerated on Mon Jun 10 2019 14:27:13