Seminar
Software Architektur (CPSA-F)
UML-Tag
Termine
Anmeldung
BITPlan
Γber BITPlan
Services
Produkte
Open Source
Impressum
Kontakt
Kontakt
Not logged in
Talk
Contributions
Create account
Log in
Page
Discussion
Edit with form
Edit
Edit source
View history
Refresh
Editing
Raspberry PI Spiderbot
(section)
From BITPlan Wiki
Jump to:
navigation
,
search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Relevant source code === <source lang='python'> class Spider: """ I am a quadruped spider with four legs consisting of coxa, femur and tibia each""" def __init__(self): self.fl = Leg(0, 0, 1, 2) self.fr = Leg(1, 3, 4, 5) self.rl = Leg(2, 6, 7, 8) self.rr = Leg(3, 9, 10, 11) ... class Leg: """ I am a single leg of the spider consisting of coxa, femur and tibia""" def __init__(self, legId,coxaId, femurId, tibiaId): self.legId=legId self.coxa = Extremity('coxa', coxaId) self.femur = Extremity('femur', femurId,legId<2) self.tibia = Extremity('tibia', tibiaId,legId<2) ... class Servo: """ I am a single Servo motor """ def __init__(self, id,inverted=False): self.id = id self.inverted=inverted def setAngle(self, angle): self.angle = angle trueAngle=180-angle if self.inverted else angle if kit is not None: kit.servo[self.id].angle = trueAngle return trueAngle </source>
Summary:
Please note that all contributions to BITPlan Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BITPlan Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)