Book Image

Learning Robotics using Python

Book Image

Learning Robotics using Python

Overview of this book

If you are an engineer, a researcher, or a hobbyist, and you are interested in robotics and want to build your own robot, this book is for you. Readers are assumed to be new to robotics but should have experience with Python.
Table of Contents (14 chapters)
13
Index

Calibrating the MPU 6050

MPU 6050 calibration can be done using the Energia code, which is used to display the raw values of the sensor mentioned in Chapter 6, Working with Robotic Sensors. This example is already available in Energia examples. You will get this code by navigating to File/Examples/MPU 6050/Examples/MPU 6050_raw. Load this sketch into Energia and follow the procedure given here:

  1. Place the MPU 6050 breakout board on a flat surface. We can use an inclinometer to check the inclination of the surface.
  2. Modify the current program by setting the offset to zero. We can set the offset of three axes values of gyroscope to 0 using the following function:
    ("setXGyroOffset , setYGyroOffset , setZGyroOffset"  =0)
  3. Upload the raw code to Launchpad and take the Energia serial monitor to confirm whether the serial data is coming from the Launchpad. Leave the breakout for 5 to 10 minutes to allow the temperature to stabilize and read the gyro values and note down the values.
  4. Set the offset...