mXlab / morphoses

Art project involving robotic ball
5 stars 2 forks source link

Morphosis Project

This repository features scripts and resources for the ongoing Morphosis project by Sofian Audry and Rosalie D. Gagné.

Local Network Configuration

Default IP addresses (need to be setup on the router):

Device IP
Main PC 192.168.0.100
RTLS/MQTT Gateway 192.168.0.200
Robot 1 Esp32 192.168.0.110
Robot 2 Esp32 192.168.0.120
Robot 3 Esp32 192.168.0.130
Visualizer PC 192.168.0.150
Title display RPi 192.168.0.161

MQTT Port: 1883

Robot Calibration and TARE

Calibration

When entering a new location it is best to calibrate the robot IMUs. In order to do so:

  1. Begin calibration by sending MQTT command /calib begin
  2. Calibrate accelerometer by putting the robot in 6 different positions (as in the 6 faces of a "cube") and hold each position for ~2 seconds.
  3. Calibrate gyroscope by putting the robot on the ground and let it stabilize, then wait ~2-3 seconds.
  4. Calibrate magnetometer by rotating the device ~180° and back to the beginning position in each axis (pitch, roll, yaw) at a speed of about ~2 seconds for each axis.
  5. Save calibration settings: /calib save
  6. Stop calibration settings: /calib stop

TARE

(Currently not working)

TARE needs to be performed on an already calibrated unit.

  1. Put robot facing along the x axis of the room (according to the virtual coordinate system of the UWB positional system). Make sure the robot is stable and does not move.
  2. Trigger tare by sending OSC command /tare-now. You should see the Z euler angle become close to zero (0).
  3. Save tare by sending OSC command /tare-save.
  4. (optional) Reboot the robot and move it a little bit so that it refreshes itself: it should then find back more-or-less its heading.

Launching an Experiment

Launching an experiment requires to run the Python 3 script morphoses.py <behavior_file.yml>

Subfolders

Python

Contains python scripts for interacting with a Unity simulation and for conducting machine learning experiments.

Machine Learning Scripts

All the ML scripts are in the Python/ml subfolder.

Unity

Contains the Unity project for generating simulated data.

Arduino specific instructions

Install tools

Connect to network

Update Wifi configuration on main ESP32 board

Setup wifi AP here:

#define WIFI_SSID "Morphoses"
#define WIFI_PASSWORD "<password>"