Comments (3)
Sure! I can share code and LDraw file...
from pybricks.hubs import EssentialHub
from pybricks.pupdevices import Motor, ColorSensor, ColorLightMatrix
from pybricks.parameters import Button, Color, Direction, Port, Side, Stop, Axis
from pybricks.robotics import DriveBase
from pybricks.tools import wait, StopWatch
hub = EssentialHub()
# Motor order doesn't matter
hipsmotor1=Motor(Port.A)
hipsmotor2=Motor(Port.B,Direction.COUNTERCLOCKWISE)
# Set capabilities well above physical limits to maximize power/speed
maxspeed=1000
hipsmotor1.control.limits(maxspeed,8000)
hipsmotor2.control.limits(maxspeed,8000)
# This hips angle provides a good match with natural period of pendulum
hipsangle=55
wait(1000)
while True:
# Wait till we are on top of swing
while hub.imu.angular_velocity(Axis.X)>0:
continue
# Then rotate legs
hipsmotor1.run_target(maxspeed,hipsangle,wait=False)
hipsmotor2.run_target(maxspeed,hipsangle)
while hub.imu.angular_velocity(Axis.X)<0:
continue
hipsmotor1.run_target(maxspeed,-hipsangle,wait=False)
hipsmotor2.run_target(maxspeed,-hipsangle)
from pybricks-projects.
We could also ask @ZPhilo for permission to share his Pybricks Gymnast:
from pybricks-projects.
Thank you @ZPhilo !
from pybricks-projects.
Related Issues (13)
- Add READMEs to each folder with pictures HOT 1
- Allow downloading of individual folders
- Write contributing guide
- DINOR3X instructions vs color sensor requirement HOT 4
- Update Move Hub acceleration units for V3.2 HOT 1
- Sample category pictures make structure unclear HOT 1
- New project for Lego Technic Cat D11 bulldozer
- Project location for generic, non-project scripts
- New project for LEGO Transformation Vehicle 42140 with powered up remote HOT 7
- LEGO Technic 4X4 X-treme Off-Roader (42099) - Powered Up Remote Control - TypeError: extra keyword arguments given on line 9 HOT 2
- Error on original code HOT 1
- Example: train with multiple trains / motors
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pybricks-projects.