# -*- coding: utf-8 -*- import dash import numpy as np from dash.dependencies import Output, Input import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go from wiimote_py.setup_wiimote import setup_wiimote from PnP_py.parametros_base_wii import parametros_base_wii from PNP_wii_func import pts_wii from PNP_wii_func import set_wii f, d_ij, P_ref, cop = parametros_base_wii() wm = setup_wiimote() wii_set = set_wii(wm, f, d_ij, P_ref, cop) Pts = pts_wii(wm, f, d_ij, P_ref, cop, wii_set["fator_escala"], wii_set["origem"], wii_set["ang_origem"]) t = np.arange(0.0, 2 * np.pi, 0.1) x = 60 * np.cos(t) y = 10 * np.sin(t) x_max = 60 x_min = -60 y_max = 25 y_min = -25 px = np.array(Pts["x"]) py = np.array(Pts["y"])
from PnP_py.posicao_absoluta_umeyama import posicao_absoluta_umeyama from PnP_py.Ang_Euler import Ang_Euler from ang_vetor import ang_vetor ############################################################################### # Paramentros base para o wiimote ############################################################################### f, d_ij, P_ref, cop = parametros_base_wii() a = np.array([[1], [0], [0]]) ############################################################################### # Inicio da comunicação com os periféricos ############################################################################### wm = setup_wiimote() # conexão bluetooth com o wiimote ############################################################################### # Aquisição de dados dos dados do wiimote : fixação da orientação do sistema # de coordenadas global ############################################################################### pontos = 0 while type(pontos) is int: pontos = pontos_wiimote( wm, cop) # adquire a leitura dos dados da camera ir do wiimote p_inter = inter_ret( pontos[0], pontos[1], pontos[2], pontos[3] ) # determina o ponto de intersecção dos segmentos de reta formados pelos pontos do marcador