Main Page
Related Pages
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
p
r
s
t
u
v
w
x
y
z
+
Functions
_
b
c
d
e
f
h
i
k
l
m
n
r
s
+
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
p
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
Enumerator
+
Classes
Class List
Class Hierarchy
+
Class Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
v
w
x
y
z
Typedefs
Enumerations
+
Enumerator
i
j
k
p
s
t
z
Related Functions
+
Files
File List
+
File Members
+
All
c
f
h
l
m
s
t
Functions
Variables
Macros
scripts
subscriber.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
3
""" For backwards compatibility with the old driver files
4
Will be DELETED in the future """
5
6
__author__ =
'flier'
7
8
import
rospy
9
from
leap_motion.msg
import
leap
10
from
leap_motion.msg
import
leapros
11
12
# Native datatypes, I've heard this is bad practice, use the geometry messages instead.
13
# def callback(data):
14
# rospy.loginfo(rospy.get_name() + ": Leap Raw Data %s" % data)
15
16
17
# Callback of the ROS subscriber, just print the received data.
18
def
callback_ros
(data):
19
rospy.loginfo(rospy.get_name() +
": Leap ROS Data %s"
% data)
20
21
22
# Yes, a listener aka subscriber ;) obviously. Listens to: leapmotion/data
23
def
listener
():
24
rospy.init_node(
'leap_sub'
, anonymous=
True
)
25
# rospy.Subscriber("leapmotion/raw", leap, callback)
26
rospy.Subscriber(
"leapmotion/data"
, leapros, callback_ros)
27
rospy.spin()
28
29
30
if
__name__ ==
'__main__'
:
31
listener
()
subscriber.listener
def listener()
Definition:
subscriber.py:23
subscriber.callback_ros
def callback_ros(data)
Definition:
subscriber.py:18
leap_motion
Author(s): Florian Lier
, Mirza Shah
, Isaac IY Saito
autogenerated on Mon Feb 28 2022 22:41:07