Skip to content

Commit eae297f

Browse files
committed
BALANC3R
1 parent 1c9265d commit eae297f

File tree

3 files changed

+430
-0
lines changed

3 files changed

+430
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ __pycache__
44
dist
55
*.egg-info
66
RELEASE-VERSION
7+
build

demo/BALANC3R

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env python
2+
3+
import logging
4+
from ev3dev.GyroBalancer import GyroBalancer
5+
6+
7+
class BALANC3R(GyroBalancer):
8+
"""
9+
Laurens Valk's BALANC3R
10+
http://robotsquare.com/2014/06/23/tutorial-building-balanc3r/
11+
"""
12+
def __init__(self):
13+
GyroBalancer.__init__(self,
14+
gainGyroAngle=1156,
15+
gainGyroRate=146,
16+
gainMotorAngle=7,
17+
gainMotorAngularSpeed=9,
18+
gainMotorAngleErrorAccumulated=3)
19+
20+
21+
if __name__ == '__main__':
22+
logging.basicConfig(level=logging.DEBUG,
23+
format='%(asctime)s %(levelname)5s: %(message)s')
24+
log = logging.getLogger(__name__)
25+
26+
log.info("Starting BALANC3R")
27+
robot = BALANC3R()
28+
robot.main()
29+
log.info("Exiting BALANC3R")

0 commit comments

Comments
 (0)