Coder Social home page Coder Social logo

dual-mpu6050-motion-sync's Introduction

Motion Sync

Prerequisite

Requires I2CDev Library for reading MPU6050 on Arduino.

Usage

  1. Connect hardware. The wiring diagram is documented inside Arduino script. Should be straghtforward, just an Arduino controller + two MPU6050s connected with I2C wires. The wires cannot be too long (I'm using a total length of ~600mm).

  2. Upload Arduino code to MCU.

  3. Open Blender and change the MCU_COM_PORT value to what Arduino is currently using (can be checked in Device Manager, or just Arduino IDE).

  4. Run the script. The MPU6050 needs ~8 seconds to initialize before start transmitting data, so initially the armature won't move, and the script will prompt something like 2023-01-25 18:01:28 WARNING [BPY]: Invalid joint data

  5. Press ESC at the main Blender window to stop the script.

Packet Format

Data is streamed from the sensor to the host computer in JSON key-value pair encoding format.

Joint Data Message

{"key": "/joint/joint_name", "value": [0, 0, 0, 0]}\n

where pos is in format [x, y, z], and rot is in format [w, x, y, z].

System Log Message

{"key": "/log", "value": "INFO: log message"}\n

Note: all the newline character in the data should be escaped with NLSM encoding.

Video

Bilibili

Youtube

License

Code in this repository is under MIT License and GPLv3 License.

Model in Blender file is under Attribution-NonCommercial 3.0 Unported (CC BY-NC 3.0) License.

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.