// ----------------------------------------------------------------------------- // Log the spring length, deformation, and force. // Log the shock length, velocity, and force. // Log constraint violations of suspension joints. // // Lengths are reported in inches, velocities in inches/s, and forces in lbf // ----------------------------------------------------------------------------- void Generic_Vehicle::DebugLog(int what) { GetLog().SetNumFormat("%10.2f"); if (what & OUT_SPRINGS) { GetLog() << "\n---- Spring (front-left, front-right, rear-left, rear-right)\n"; GetLog() << "Length [inch] " << GetSpringLength(FRONT_LEFT) << " " << GetSpringLength(FRONT_RIGHT) << " " << GetSpringLength(REAR_LEFT) << " " << GetSpringLength(REAR_RIGHT) << "\n"; GetLog() << "Deformation [inch] " << GetSpringDeformation(FRONT_LEFT) << " " << GetSpringDeformation(FRONT_RIGHT) << " " << GetSpringDeformation(REAR_LEFT) << " " << GetSpringDeformation(REAR_RIGHT) << "\n"; GetLog() << "Force [lbf] " << GetSpringForce(FRONT_LEFT) << " " << GetSpringForce(FRONT_RIGHT) << " " << GetSpringForce(REAR_LEFT) << " " << GetSpringForce(REAR_RIGHT) << "\n"; } if (what & OUT_SHOCKS) { GetLog() << "\n---- Shock (front-left, front-right, rear-left, rear-right)\n"; GetLog() << "Length [inch] " << GetShockLength(FRONT_LEFT) << " " << GetShockLength(FRONT_RIGHT) << " " << GetShockLength(REAR_LEFT) << " " << GetShockLength(REAR_RIGHT) << "\n"; GetLog() << "Velocity [inch/s] " << GetShockVelocity(FRONT_LEFT) << " " << GetShockVelocity(FRONT_RIGHT) << " " << GetShockVelocity(REAR_LEFT) << " " << GetShockVelocity(REAR_RIGHT) << "\n"; GetLog() << "Force [lbf] " << GetShockForce(FRONT_LEFT) << " " << GetShockForce(FRONT_RIGHT) << " " << GetShockForce(REAR_LEFT) << " " << GetShockForce(REAR_RIGHT) << "\n"; } if (what & OUT_CONSTRAINTS) { // Report constraint violations for all joints LogConstraintViolations(); } GetLog().SetNumFormat("%g"); }
void TrackSoilBin::Log_to_console(int console_what) { GetLog().SetNumFormat("%10.2f"); if (console_what & DBG_FIRSTSHOE) { GetLog() << "\n-- shoe 0 : " << m_chain->GetShoeBody(0)->GetName() << "\n"; // COG state data GetLog() << "COG Pos [m] : " << m_chain->GetShoeBody(0)->GetPos() << "\n"; GetLog() << "COG Vel [m/s] : " << m_chain->GetShoeBody(0)->GetPos_dt() << "\n"; GetLog() << "COG Acc [m/s2] : " << m_chain->GetShoeBody(0)->GetPos_dtdt() << "\n"; GetLog() << "COG omega [rad/s] : " << m_chain->GetShoeBody(0)->GetRot_dt() << "\n"; // shoe pin tension GetLog() << "pin 0 reaction force [N] : " << m_chain->GetPinReactForce(0) << "\n"; // GetLog() << "pin 0 reaction torque [N-m] : " << m_chain->GetPinReactTorque(0) << "\n"; } if (console_what & DBG_GEAR) { GetLog() << "\n---- Gear " << m_gear->GetBody()->GetName() << "\n"; // COG state data GetLog() << "COG Pos [m] : " << m_gear->GetBody()->GetPos() << "\n"; GetLog() << "COG Vel [m/s] : " << m_gear->GetBody()->GetPos_dt() << "\n"; GetLog() << "COG omega [rad/s] : " << m_gear->GetBody()->GetRot_dt() << "\n"; /* // # of shoe pins in contact? GetLog() << "# of shoes in contact ? : " << m_gear->GetBody()->GetCollisionModel()->Get << "\n"; // # of non-intermittant contact steps GetLog() << "cumulative contact steps : " << << "\n"; */ } if (console_what & DBG_CONSTRAINTS) { // Report constraint violations for all joints LogConstraintViolations(false); } if (console_what & DBG_PTRAIN) { GetLog() << "\n---- powertrain \n"; } GetLog().SetNumFormat("%g"); }