Inti - Interface Puppe
NOTES
julians anfängliche recherche: https://github.com/clockdiv/marionette-interface
und ein paper dass er später noch getilt hat: https://www.researchgate.net/profile/Luis-Leite-3/publication/350236635_Virtual_Marionette_-_Interaction_Model_for_Digital_Puppetry/links/605727a192851cd8ce574112/Virtual-Marionette-Interaction-Model-for-Digital-Puppetry.pdf
und ich habe ein bisschen hoffnung dass diese projekt beispiel uns weiterhilft: https://www.patreon.com/posts/mocap-suit-suit-64346879?l=de
HARDWARE
esp32 dev kit 38 pin
Adafruit 9-DOF Absolute Orientation IMU Fusion Breakout - BNO055 https://www.adafruit.com/product/4646 https://www.adafruit.com/product/2472
PIN Connections: BNO055 — ESP32 38pin dev board +3.3V — +3.3V GND — GND SDA — SDA (G21) SCL — SCL (G22)
SparkFun Qwiic Mux Breakout - 8 Channel (TCA9548A) https://www.sparkfun.com/products/16784
ARDUINO LIBRARIES:
SparkFun_I2C_Mux_Arduino_Library https://github.com/sparkfun/SparkFun_I2C_Mux_Arduino_Library Example2_DualDistance: https://github.com/sparkfun/SparkFun_I2C_Mux_Arduino_Library/tree/master/examples/Example2_DualDistance
Adafruit_BNO055 To use this driver you will also need to download the Adafruit_Sensor https://www.arduino.cc/reference/en/libraries/adafruit-bno055/ https://github.com/adafruit/Adafruit_BNO055
Adafruit_Sensor
TUTORIALS
Mocap suit https://www.patreon.com/posts/mocap-suit-suit-64346879?l=de https://www.patreon.com/posts/motion-capture-63554845
Adafruit BNO055 Absolute Orientation Sensor https://learn.adafruit.com/adafruit-bno055-absolute-orientation-sensor/overview good code example: https://learn.adafruit.com/adafruit-bno055-absolute-orientation-sensor/arduino-code
PROCESSING
https://processing.org/download Example: rotateCubeDemo
HANNAH CODE
The following code example is a combination of the following two examples: Arduino: Example2_DualDistance_BNO055_3sensors Processing: rotateCubeDemo_3cubes
/*
//////////////////////////////////////////////////////////////////////// CODE FOR INTERFACE PUPPE based on "DualDistance" example from Sparkfun's I2C MUX library modified to read BNO055 sensors -hannah pw ////////////////////////////////////////////////////////////////////////
ORIGINAL EXAMPLE COMMENTS: Use the Qwiic Mux to access multiple I2C devices on seperate busses. By: Nathan Seidle @ SparkFun Electronics Date: May 17th, 2020 License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
Some I2C devices respond to only one I2C address. This can be a problem when you want to hook multiple of a device to the I2C bus. An I2C Mux solves this issue by allowing you to change the 'channel' or port that the master is talking to.
This example shows how to hook up two VL53L1X laser distance sensors with the same address. You can read the VL53L1X hookup guide and get the library from https://learn.sparkfun.com/tutorials/qwiic-distance-sensor-vl53l1x-hookup-guide
The TCA9548A is a mux. This means when you enableMuxPort(2) then the SDA and SCL lines of the master (Arduino) are connected to port 2. Whatever I2C traffic you do, such as distanceSensor.startRanging() will be communicated to whatever sensor you have on port 2. This example creates an array of objects. This increases RAM but allows for independent configuration of each sensor (one sensor may be configured for long range, the others for short, etc).
Outputs two sets of distances in mm and ft.
Hardware Connections: Attach the Qwiic Mux Shield to your RedBoard or Uno. Plug two Qwiic VL53L1X breakout boards into ports 0 and 1. Serial.print it out at 115200 baud to serial monitor.
SparkFun labored with love to create this code. Feel like supporting open source? Buy a board from SparkFun! https://www.sparkfun.com/products/14685
- /
- include <Wire.h>
- include <Adafruit_Sensor.h>
- include <Adafruit_BNO055.h>
- include <utility/imumaths.h>
Adafruit_BNO055 bno = Adafruit_BNO055(55);
- include <SparkFun_I2C_Mux_Arduino_Library.h> //Click here to get the library: http://librarymanager/All#SparkFun_I2C_Mux
QWIICMUX myMux;
- define NUMBER_OF_SENSORS 3
void setup()
{
Serial.begin(115200); Serial.println("Qwiic Mux Shield Read Example");
Wire.begin();
if (myMux.begin() == false) { Serial.println("Mux not detected. Freezing..."); while (1) ; } Serial.println("Mux detected");
byte currentPortNumber = myMux.getPort(); Serial.print("CurrentPort: "); Serial.println(currentPortNumber);
//Initialize all the sensors bool initSuccess = true;
for (byte x = 0; x < NUMBER_OF_SENSORS; x++) { myMux.setPort(x);
/* Initialise the sensors(s) */
//unsure if i should create array of "bno" objects??? //for (int x = 0; x < NUMBER_OF_SENSORS; x++) {}
if (!bno.begin()) { /* There was a problem detecting the BNO055 ... check your connections */ Serial.print("Sensor "); Serial.print(x); Serial.print("Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!"); while (1); initSuccess = false; } else { delay(1000); bno.setExtCrystalUse(true); Serial.print("Sensor "); Serial.print(x); Serial.println(" configured"); } }
if (initSuccess == false) { Serial.print("Freezing..."); while (1) ; }
Serial.println("Mux Shield online");
}
void loop() {
for (byte x = 0; x < NUMBER_OF_SENSORS; x++) { myMux.setPort(x); //Tell mux to connect to this port, and this port only
/* Get a new sensor event */ sensors_event_t event; bno.getEvent(&event);
/* Serial.print("MUX: "); Serial.print(x); //Display the floating point data Serial.print("\tX: "); Serial.print(event.orientation.x, 4); Serial.print("\tY: "); Serial.print(event.orientation.y, 4); Serial.print("\tZ: "); Serial.print(event.orientation.z, 4); Serial.println(""); */
//PRINT FOR PROCESSING Serial.print(event.orientation.x, 4); Serial.print(","); Serial.print(event.orientation.y, 4); Serial.print(","); Serial.print(event.orientation.z, 4); Serial.print(",");
if (x == 2) Serial.println();
//delay(100); }
//Serial.println();
//delay(180); //Wait for next reading
}