from osc4py3.as_eventloop import *
from osc4py3 import oscbuildparse
import numpy as np

def main():
    # Start the OSC system
    osc_startup()

    # Make client channels to send packets
    osc_udp_client("127.0.0.1", 8000, "osc_client")

    # Example joint positions to send
    joint_positions = [1.0,2.0, 3.0,4.0, 5.0, 6.0]


    msg = oscbuildparse.OSCMessage("/joint_angles", None, joint_positions)
            
            # Send the OSC message
    osc_send(msg, "osc_client")
    osc_process()
            
    print(f"Sent joint positions: {joint_positions}")
    osc_terminate()

if __name__ == "__main__":
    main()