Changeset 377 in flair-src for trunk/lib/FlairSimulator
- Timestamp:
- Dec 16, 2020, 9:40:44 AM (4 years ago)
- Location:
- trunk/lib/FlairSimulator/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSimulator/src/TwoWheelRobot.cpp
r376 r377 50 50 m = new DoubleSpinBox(setup_tab->NewRow(), "mass (kg):", 0, 20, 0.1,1,0.2); 51 51 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); 52 56 53 57 … … 56 60 bodyColorG = new SpinBox(visual_tab->LastRowLastCol(), "arm color (G):", 0, 255, 1,0); 57 61 bodyColorB = new SpinBox(visual_tab->LastRowLastCol(), "arm color (B):", 0, 255, 1,0); 62 63 58 64 59 65 controls = new SimuUgvControls(this, name, modelId,0); … … 155 161 156 162 controls->GetControls(&speed,&turn,&motorTime); 157 163 158 164 // compute quaternion from W 159 165 // Quaternion derivative: dQ = 0.5*( Q*Qw) 160 166 state[0].W.x=0; 161 167 state[0].W.y=0; 162 state[0].W.z=turn ;168 state[0].W.z=turn*r_speed->Value(); 163 169 Quaternion dQ = state[-1].Quat.GetDerivative(state[0].W); 164 170 … … 167 173 state[0].Quat.Normalize(); 168 174 169 Vector3D<double> dir = Vector3D<double>(speed ,0,0);175 Vector3D<double> dir = Vector3D<double>(speed*t_speed->Value(),0,0); 170 176 dir.Rotate(state[0].Quat); 171 177 state[0].Pos = state[-1].Pos + dT() * dir; -
trunk/lib/FlairSimulator/src/TwoWheelRobot.h
r375 r377 64 64 #endif 65 65 gui::SpinBox *bodyColorR,*bodyColorG,*bodyColorB; 66 gui::DoubleSpinBox *size,*m ;66 gui::DoubleSpinBox *size,*m,*t_speed,*r_speed; 67 67 actuator::SimuUgvControls *controls; 68 68
Note:
See TracChangeset
for help on using the changeset viewer.