Changeset 135 in flair-src for trunk/lib/FlairMeta/src


Ignore:
Timestamp:
Feb 13, 2017, 11:38:33 AM (8 years ago)
Author:
Sanahuja Guillaume
Message:

VrpnObject no longer outputs Euler (ony Quaternion): warning, output matrix has changed!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairMeta/src/MetaVrpnObject.cpp

    r122 r135  
    5151
    5252void MetaVrpnObject::ConstructorCommon(string name) {
    53   cvmatrix_descriptor *desc = new cvmatrix_descriptor(6, 1);
    54   for (int i = 0; i < 6; i++) {
     53  cvmatrix_descriptor *desc = new cvmatrix_descriptor(7, 1);
     54  for (int i = 0; i < desc->Rows(); i++) {
    5555    desc->SetElementName(i, 0, Output()->Name(i, 0));
    5656  }
    5757  cvmatrix *prev_value = new cvmatrix(this, desc, elementDataType, name);
    58   for (int i = 0; i < 6; i++) {
     58  for (int i = 0; i < prev_value->Rows(); i++) {
    5959    prev_value->SetValue(i, 0, 0);
    6060  }
     
    6363                           name + " Passe bas", prev_value);
    6464
    65   desc = new cvmatrix_descriptor(6, 1);
    66   for (int i = 0; i < 6; i++) {
     65  desc = new cvmatrix_descriptor(7, 1);
     66  for (int i = 0; i < desc->Rows(); i++) {
    6767    desc->SetElementName(i, 0, "d" + Output()->Name(i, 0));
    6868  }
    6969  prev_value = new cvmatrix(this, desc, elementDataType, name);
    70   for (int i = 0; i < 6; i++) {
     70  for (int i = 0; i < prev_value->Rows(); i++) {
    7171    prev_value->SetValue(i, 0, 0);
    7272  }
     
    7676
    7777  vx_opti_plot = new DataPlot1D(GetPlotTab()->NewRow(), "vx", -3, 3);
    78   vx_opti_plot->AddCurve(euler->Matrix()->Element(3));
     78  vx_opti_plot->AddCurve(euler->Matrix()->Element(4));
    7979  vy_opti_plot = new DataPlot1D(GetPlotTab()->LastRowLastCol(), "vy", -3, 3);
    80   vy_opti_plot->AddCurve(euler->Matrix()->Element(4));
     80  vy_opti_plot->AddCurve(euler->Matrix()->Element(5));
    8181  vz_opti_plot = new DataPlot1D(GetPlotTab()->LastRowLastCol(), "vz", -2, 2);
    82   vz_opti_plot->AddCurve(euler->Matrix()->Element(5));
     82  vz_opti_plot->AddCurve(euler->Matrix()->Element(6));
    8383
    8484  plot_tab = new Tab(GetVrpnClient()->GetTabWidget(), "Mesures (xy) " + name);
    8585  xy_plot = new DataPlot2D(plot_tab->NewRow(), "xy", "y", -5, 5, "x", -5, 5);
    86   xy_plot->AddCurve(Output()->Element(4, 0), Output()->Element(3, 0));
     86  xy_plot->AddCurve(Output()->Element(5, 0), Output()->Element(4, 0));
    8787}
    8888
     
    9898
    9999void MetaVrpnObject::GetSpeed(Vector3D &speed) const {
    100   speed.x = euler->Output(3, 0);
    101   speed.y = euler->Output(4, 0);
    102   speed.z = euler->Output(5, 0);
     100  speed.x = euler->Output(4, 0);
     101  speed.y = euler->Output(5, 0);
     102  speed.z = euler->Output(6, 0);
    103103}
    104104
Note: See TracChangeset for help on using the changeset viewer.