1. Eric Cousineau
  2. rbdl-backup

Commits

Martin Felis  committed 9670351

replaced exit() with aborts

  • Participants
  • Parent commits 2dd2922
  • Branches dev

Comments (0)

Files changed (6)

File src/Body.h

View file
 		if (new_mass == 0.) {
 			std::cerr << "Error: cannot join bodies as both have zero mass!" << std::endl;
 			assert (false);
-			exit(1);
+			abort();
 		}
 
 		Math::Vector3d other_com = transform.E.transpose() * other_body.mCenterOfMass + transform.r;

File src/Contacts.cc

View file
 
 	if (bound) {
 		std::cerr << "Error: binding an already bound constraint set!" << std::endl;
-		exit (-1);
+		abort();
 	}
 	unsigned int n_constr = size();
 

File src/Joint.h

View file
 			if (type != JointTypeFixed) {
 				std::cerr << "Error: Invalid use of Joint constructor Joint(JointType type). Only allowed when type == JointTypeFixed." << std::endl;
 				assert (0);
-				exit(1);
+				abort();
 			}
 		}
 	Joint (const Joint &joint) :

File src/Model.cc

View file
 	if (mBodies.size() == fixed_body_discriminator) {
 		std::cerr << "Error: cannot add more than " << fixed_body_discriminator << " movable bodies. You need to modify Model::fixed_body_discriminator for this." << std::endl;
 		assert (0);
-		exit(1);
+		abort();
 	}
 
 	return mBodies.size() - 1;

File src/SpatialAlgebraOperators.h

View file
 #include <iostream>
 #include <cmath>
 
-
 namespace RigidBodyDynamics {
 
 namespace Math {
 	return res;
 }
 
-inline SpatialVector SpatialLinSolve (const SpatialMatrix &A, const SpatialVector &b) {
-#ifdef RBDL_USE_SIMPLE_MATH
-	std::cerr << "Cannot solve linear systems with slow math library! Use eigen instead" << std::endl;
-	return b;
-	//		exit (-1);
-#else
-	return A.partialPivLu().solve(b);
-#endif
-}
-
 inline Matrix3d get_rotation (const SpatialMatrix &m) {
 	return m.block<3,3>(0,0);
 }
+
 inline Vector3d get_translation (const SpatialMatrix &m) {
 	return Vector3d (-m(4,2), m(3,2), -m(3,1));
 }

File tests/ModelTests.cc

View file
 			);
 	model.AddBody (0, Xtrans(Vector3d(0., 0., 0.)), joint_rot_z, body);
 	unsigned int fixed_body_id = model.AppendBody (Xtrans(Vector3d(0., 1., 0.)), Joint(JointTypeFixed), fixed_body, "fixed_body");
-	model.AppendBody (Xtrans(Vector3d(0., 1., 0.)), Joint(JointTypeFixed), fixed_body, "fixed_body");
 
 	CHECK_EQUAL (fixed_body_id, model.GetBodyId("fixed_body"));
 }