OSC_ROS2/osc_recieve.py
2025-05-04 23:38:12 +02:00

15 lines
340 B
Python

from osc4py3.as_eventloop import *
from osc4py3 import oscmethod as osm
import time
def handler(address,*args):
print(args)
osc_startup()
osc_udp_server("0.0.0.0", 7000, "osc_server")
osc_method("/joint_states/counter", handler, argscheme=osm.OSCARG_ADDRESS+ osm.OSCARG_DATAUNPACK)
while True:
osc_process()
time.sleep(0.01)