The Cyberwave Python SDK provides a powerful, easy-to-use interface for controlling robots, running simulations, and managing digital twins programmatically. Perfect for automation, testing, and advanced robotics applications.
import cyberwave as cw# Connect to your digital twinrobot = cw.twin("the-robot-studio/so101")# Move the robot to a positionrobot.move(x=1.0, y=0.0, z=0.5)robot.rotate(yaw=90)# Actuate the robot's joint to 30 degreesrobot.joints.set("1", 30)
Install the additional dependencies for camera streaming:
Copy
pip install cyberwave[camera]
Now you can stream real time video data from your robot or sensor:
Copy
from cyberwave import Cyberwaveimport asyncioimport ostoken = os.getenv("CYBERWAVE_TOKEN")client = Cyberwave( token=token,)# Get or create a twin to stream totwin_uuid = os.getenv("TWIN_UUID")# Create camera streamerstreamer = client.video_stream( twin_uuid=twin_uuid, camera_id=0, # Default camera (change if you have multiple cameras) fps=10, # Frames per second, optional)try: await streamer.start() print("Stream is active. Press Ctrl+C to stop...") # Keep streaming until interrupted while True: await asyncio.sleep(1)except KeyboardInterrupt: print("Stopping stream...")except Exception as e: print(f"Error during streaming: {e}")finally: await streamer.stop() client.disconnect() print("Stream stopped and resources cleaned up")