Commits

Martin Felis  committed 9aa88bf

set width of SimpleMath output to 12

  • Participants
  • Parent commits c6c1ee1
  • Branches dev

Comments (0)

Files changed (4)

File src/Dynamics.cc

 	assert (solve_successful);
 #endif
 
+	LOG << "x = " << std::endl << x << std::endl;
+
 	// Copy back QDDot
 	for (i = 0; i < model.dof_count; i++)
 		QDDot[i] = x[i];

File src/SimpleMath.h

 
 	unsigned int i,j;
 	for (i = 0; i < blockrows; i++) {
-		output << "[ ";
 		for (j = 0; j < blockcols; j++) {
+			output.width(12);
 			output << block(i,j) << " ";
 		}
-		output << "]" << std::endl;
 	}
 
 	return output;
 inline std::ostream& operator<<(std::ostream& output, const Matrix<val_type> &matrix) {
 	output << std::endl;
 	for (unsigned int i = 0; i < matrix.rows(); i++) {
-		output << "[ ";
 		for (unsigned int j = 0; j < matrix.cols(); j++) {
+			output.width(12);
 			output << matrix(i,j) << " ";
 		}
-		output << "]" << std::endl;
+		output << std::endl;
 	}
 	return output;
 }

File src/main.cc

-#include <iostream>
-
-#include "featherstone.h"
-
-using namespace std;
-
-int main (int argc, char* argv[]) {
-	vec3d translation;
-	
-	translation.x = 0;
-	translation.y = -1;
-	translation.z = 0;
-
-	vec3d axis;
-	axis.x = 1.;
-	axis.y = 0.;
-	axis.z = 0.;
-	
-	Body* thigh = RootBody.CreateChild (RevoluteJoint, axis);
-	thigh->mOriginTranslation[0] = 0.;
-	thigh->mOriginTranslation[1] = 0.;
-	thigh->mOriginTranslation[2] = 0.;
-
-	Body* shank = thigh->CreateChild (RevoluteJoint, axis);
-	shank->mOriginTranslation[0] = 0.;
-	shank->mOriginTranslation[1] = 1.;
-	shank->mOriginTranslation[2] = 0.;
-
-	RootBody.Print ("Root");
-	thigh->Print ("Thigh");
-	shank->Print ("Shank");
-
-	return 0;
-}

File tests/CMakeLists.txt

 	CompositeRigidBodyTests.cc
 	ContactsTests.cc
 	ImpulsesTests.cc
+	footmodelTests.cc
 	)
 
 FIND_PACKAGE (UnitTest++ REQUIRED)