-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
27 lines (20 loc) · 738 Bytes
/
test.py
File metadata and controls
27 lines (20 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import model
m = model.Model()
m.m1.speed = 10
m.m2.speed = 10
print("Default model: {}".format(m))
print("### Setting a speed to motor 1 only")
m.m1.speed = 0.1
linear_speed, rotational_speed = m.dk()
print("linear_speed = {}\notational_speed = {}".format(linear_speed, rotational_speed))
print("### Setting a speed to motor 2 only")
m.m2.speed = 0.1
linear_speed, rotational_speed = m.dk()
print("linear_speed = {}\notational_speed = {}".format(linear_speed, rotational_speed))
print("### Setting a speed to both motors")
m.m1.speed = 0.1
m.m2.speed = 0.1
linear_speed, rotational_speed = m.dk()
print("linear_speed = {}\notational_speed = {}".format(linear_speed, rotational_speed))