Giter Site home page Giter Site logo

robot's People

Contributors

byapparov avatar

Watchers

 avatar  avatar

robot's Issues

Get distance to the obstacle in meters

Here I would like to have a simple way to measure the forward distance:

 # this should return distance to an obstacle in meters
distance  = robot.distance()

Error reading mpu6050 data

Sometimes gyro data is not read correctly and an error is coming from mpu6050 library:

Traceback (most recent call last):
  File "robot.py", line 53, in <module>
    turn(360.0)
  File "robot.py", line 26, in turn
    angles = gyroscope.update(sample_time)
  File "/home/pi/robot/src/gyro.py", line 40, in update
    gyro_data = self.sensor.get_gyro_data()
  File "/home/pi/.local/lib/python2.7/site-packages/mpu6050/mpu6050.py", line 213, in get_gyro_data
    z = self.read_i2c_word(self.GYRO_ZOUT0)
  File "/home/pi/.local/lib/python2.7/site-packages/mpu6050/mpu6050.py", line 71, in read_i2c_word
    high = self.bus.read_byte_data(self.address, register)
IOError: [Errno 121] Remote I/O error

Make robot turn to a degree specified in turn() command

To track the angle MPU6050 with three axis gyroscope is used in this project.

Z axis provides Yaw velocity in degrees which will allow implementation of precise turning to a given number of degrees with velocity integrator and a PID controller.

Example of code that is required:

import robot # we also might rely on gpiozero, it is just an example. 
import yaw_control # this is the package that can contain PID for yaw

r  = robot()
# Turn robot left 60 degrees:
r.turn(60)

# Turn robot right 90 degrees
r.turn(90)
  • Update readme
  • Add gif or video demonstrating this works

Known challenges that need special attention:

  • MPU6050 is not calibrated which means that measurements must be adjusted
  • It is not clear how often signal should be read to get precise angle estimate
  • There is about 0.5 d/s noise in the readings which might require kalman filter to be added

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.