Ignore:
Timestamp:
Dec 16, 2020, 9:40:44 AM (9 months ago)
Author:
Sanahuja Guillaume
Message:

ugv update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairSimulator/src/TwoWheelRobot.cpp

    r376 r377  
    5050  m = new DoubleSpinBox(setup_tab->NewRow(), "mass (kg):", 0, 20, 0.1,1,0.2);
    5151  size = new DoubleSpinBox(setup_tab->NewRow(), "size (m):", 0, 20, 0.1,1,0.1);
     52  t_speed = new DoubleSpinBox(setup_tab->NewRow(), "translational speed (m/s):",
     53                              0, 5, 0.1);
     54  r_speed = new DoubleSpinBox(setup_tab->NewRow(), "rotational speed (deg/s):",
     55                              0, 180, 10);
    5256 
    5357 
     
    5660  bodyColorG = new SpinBox(visual_tab->LastRowLastCol(), "arm color (G):", 0, 255, 1,0);
    5761  bodyColorB = new SpinBox(visual_tab->LastRowLastCol(), "arm color (B):", 0, 255, 1,0);
     62 
     63 
    5864 
    5965  controls = new SimuUgvControls(this, name, modelId,0);
     
    155161
    156162  controls->GetControls(&speed,&turn,&motorTime);
    157           
     163         
    158164  // compute quaternion from W
    159165  // Quaternion derivative: dQ = 0.5*(  Q*Qw)
    160166  state[0].W.x=0;
    161167  state[0].W.y=0;
    162   state[0].W.z=turn;
     168  state[0].W.z=turn*r_speed->Value();
    163169  Quaternion dQ = state[-1].Quat.GetDerivative(state[0].W);
    164170
     
    167173  state[0].Quat.Normalize();
    168174
    169   Vector3D<double> dir = Vector3D<double>(speed,0,0);
     175  Vector3D<double> dir = Vector3D<double>(speed*t_speed->Value(),0,0);
    170176  dir.Rotate(state[0].Quat);
    171177  state[0].Pos = state[-1].Pos + dT() * dir;
Note: See TracChangeset for help on using the changeset viewer.