1from reynard_the_robot import Reynard
2import time
3
4# Callback function for new_message signal
5
6
7def new_message(_, message):
8 print(message + " in callback")
9
10
11# Create a Reynard object
12reynard = Reynard()
13
14# Start the Reynard object
15reynard.start()
16
17# Connect the new_message signal to the new_message callback function
18reynard.new_message.connect(new_message)
19
20# Read the robot position and arm position
21print(f"Robot position: {reynard.robot_position}")
22print(f"Arm position: {reynard.arm_position}")
23
24# Teleport the robot
25reynard.teleport(100, -200)
26
27# Drive the robot
28reynard.drive_robot(500, -200)
29
30# Wait for 1 second
31time.sleep(1)
32
33# Stop the robot
34reynard.drive_robot(0, 0)
35
36# Set the arm position
37reynard.set_arm_position(100, -30, -70)
38
39# Drive the arm
40reynard.drive_arm(10, -30, -15)
41
42# Wait for 1 second
43time.sleep(1)
44
45# Stop the arm
46reynard.drive_arm(0, 0, 0)
47
48
49# Set the color to Red
50reynard.color = (1, 0, 0)
51
52# Read the color
53print(f"Color: {reynard.color}")
54
55time.sleep(1)
56
57# Set the color to Green
58reynard.color = (0, 1, 0)
59
60time.sleep(1)
61
62# Reset the color
63reynard.color = (0.929, 0.49, 0.192)
64
65# Say hello
66reynard.say("Hello, World From API!")