コード例 #1
0
ファイル: listener.py プロジェクト: ghorn/conftron
def my_handler(channel, data):
    msg = example_t.decode(data)
    print("Received message on channel \"%s\"" % channel)
    print("   timestamp   = %s" % str(msg.timestamp))
    print("   position    = %s" % str(msg.position))
    print("   orientation = %s" % str(msg.orientation))
    print("   ranges: %s" % str(msg.ranges))
    print("")
コード例 #2
0
ファイル: read-log.py プロジェクト: GArlington/lcm
import sys
import lcm

from exlcm import example_t

if len(sys.argv) < 2:
    sys.stderr.write("usage: read-log <logfile>\n")
    sys.exit(1)

log = lcm.EventLog(sys.argv[1], "r")

for event in log:
    if event.channel == "EXAMPLE":
        msg = example_t.decode(event.data)

        print("Message:")
        print("   timestamp   = %s" % str(msg.timestamp))
        print("   position    = %s" % str(msg.position))
        print("   orientation = %s" % str(msg.orientation))
        print("   ranges: %s" % str(msg.ranges))
        print("")
コード例 #3
0
def my_handler(channel, data):
    global msg
    msg = example_t.decode(data)
コード例 #4
0
 def my_handler(self,channel, data):
     msg = example_t.decode(data)
     # print("Received message on channel \"%s\"" % str(channel))
     print("arm mode =",msg.ARM_mode)
     self._signal.emit(bytes(data))