Project 2: Walker
Description: Our group created three different robotic walkers that unfortunately did not make any forward progress (you can see our iterations in the video). The final design is inspired by a praying mantis (http://robotsquare.com/2012/02/27/tutorial-manty/) and uses a variation on a two bar linkage with some points that allow freedom in some directions while restricting others. The motors are rotated 180 degrees from each other to allow the legs to push off one at a time. There is a touch sensor to allow the user to stop the Mantis from moving. The Ultrasonic sensor was used purely for aesthetic purposes to make the walker look more animal-like. The video shows the robot moving slow, fast, and backwards.
Code: #!/usr/bin/env python3 ev3 = Device("this") def manageRange(n): return max(min(n,1050),-1050) def main(): speed = None #keep going until the button is pressed while True: speed = -30 #variable for speed outA = ev3.LargeMotor('outA') outA.run_forever(speed_sp= manageRange(speed* 10.50)) outC = ev3.LargeMotor('outC') outC.run_forever(speed_sp= manageRange(speed* 10.50)) if ev3.TouchSensor('in3').is_pressed: outA = ev3.LargeMotor('outA') outA.stop(stop_action="hold") outC = ev3.LargeMotor('outC') outC.stop(stop_action="hold") break if __name__ == '__main__': main()