Anonymous avatar Anonymous committed 0d2fb73 Draft

Updated tests to work with include structure

Comments (0)

Files changed (17)

tests/BodyTests.cc

 
 #include <iostream>
 
-#include "rbdl_mathutils.h"
-#include "Body.h"
+#include "rbdl/rbdl_mathutils.h"
+#include "rbdl/Body.h"
 
 using namespace std;
 using namespace RigidBodyDynamics;

tests/CalcAccelerationsTests.cc

 
 #include <iostream>
 
-#include "Logging.h"
+#include "rbdl/Logging.h"
 
-#include "Model.h"
-#include "Kinematics.h"
+#include "rbdl/Model.h"
+#include "rbdl/Kinematics.h"
+
 #include "Fixtures.h"
 
 using namespace std;

tests/CalcVelocitiesTests.cc

 
 #include <iostream>
 
-#include "Logging.h"
+#include "rbdl/Logging.h"
 
-#include "Model.h"
-#include "Kinematics.h"
+#include "rbdl/Model.h"
+#include "rbdl/Kinematics.h"
 
 using namespace std;
 using namespace RigidBodyDynamics;

tests/CompositeRigidBodyTests.cc

 
 #include <iostream>
 
-#include "Logging.h"
+#include "rbdl/Logging.h"
+#include "rbdl/Model.h"
+#include "rbdl/Dynamics.h"
+
 #include "Fixtures.h"
 
-#include "Model.h"
-#include "Dynamics.h"
-
 using namespace std;
 using namespace RigidBodyDynamics;
 using namespace RigidBodyDynamics::Math;

tests/ContactsTests.cc

 
 #include <iostream>
 
-#include "Logging.h"
+#include "rbdl/Logging.h"
 
-#include "Model.h"
-#include "Contacts.h"
-#include "Dynamics.h"
-#include "Kinematics.h"
+#include "rbdl/Model.h"
+#include "rbdl/Contacts.h"
+#include "rbdl/Dynamics.h"
+#include "rbdl/Kinematics.h"
 
 #include "Fixtures.h"
 

tests/DynamicsTests.cc

 #include <iostream>
 #include <limits>
 
-#include "Logging.h"
+#include "rbdl/Logging.h"
 
-#include "Model.h"
-#include "Kinematics.h"
-#include "Dynamics.h"
-#include "Contacts.h"
+#include "rbdl/Model.h"
+#include "rbdl/Kinematics.h"
+#include "rbdl/Dynamics.h"
+#include "rbdl/Contacts.h"
+
 #include "Fixtures.h"
 
 using namespace std;
-#include "rbdl.h"
+#include "rbdl/rbdl.h"
 
 struct FixedBase3DoF {
 	FixedBase3DoF () {

tests/FloatingBaseTests.cc

 
 #include <iostream>
 
-#include "rbdl_mathutils.h"
-#include "Logging.h"
+#include "rbdl/rbdl_mathutils.h"
+#include "rbdl/Logging.h"
 
-#include "Model.h"
-#include "Kinematics.h"
-#include "Dynamics.h"
-#include "Dynamics_experimental.h"
+#include "rbdl/Model.h"
+#include "rbdl/Kinematics.h"
+#include "rbdl/Dynamics.h"
+#include "rbdl/Dynamics_experimental.h"
 
 using namespace std;
 using namespace RigidBodyDynamics;

tests/ImpulsesTests.cc

 
 #include <iostream>
 
-#include "Logging.h"
+#include "rbdl/Logging.h"
 
-#include "Model.h"
-#include "Contacts.h"
-#include "Dynamics.h"
-#include "Kinematics.h"
+#include "rbdl/Model.h"
+#include "rbdl/Contacts.h"
+#include "rbdl/Dynamics.h"
+#include "rbdl/Kinematics.h"
 
 using namespace std;
 using namespace RigidBodyDynamics;

tests/InverseDynamicsTests.cc

 
 #include <iostream>
 
-#include "Logging.h"
+#include "rbdl/Logging.h"
 
-#include "Model.h"
-#include "Dynamics.h"
-#include "Dynamics_experimental.h"
+#include "rbdl/Model.h"
+#include "rbdl/Dynamics.h"
+#include "rbdl/Dynamics_experimental.h"
 
 using namespace std;
 using namespace RigidBodyDynamics;

tests/KinematicsTests.cc

 
 #include <iostream>
 
-#include "rbdl_mathutils.h"
-#include "Logging.h"
+#include "rbdl/rbdl_mathutils.h"
+#include "rbdl/Logging.h"
 
-#include "Model.h"
-#include "Kinematics.h"
-#include "Dynamics.h"
+#include "rbdl/Model.h"
+#include "rbdl/Kinematics.h"
+#include "rbdl/Dynamics.h"
 
 using namespace std;
 using namespace RigidBodyDynamics;

tests/MathTests.cc

 #include <UnitTest++.h>
 
-#include "Logging.h"
-#include "rbdl_math.h"
-#include "rbdl_mathutils.h"
+#include "rbdl/Logging.h"
+#include "rbdl/rbdl_math.h"
+#include "rbdl/rbdl_mathutils.h"
 #include <iostream>
 
 const double TEST_PREC = 1.0e-14;

tests/ModelTests.cc

 
 #include <iostream>
 
-#include "rbdl_mathutils.h"
-#include "Logging.h"
+#include "rbdl/rbdl_mathutils.h"
+#include "rbdl/Logging.h"
 
-#include "Model.h"
-#include "Kinematics.h"
-#include "Dynamics.h"
+#include "rbdl/Model.h"
+#include "rbdl/Kinematics.h"
+#include "rbdl/Dynamics.h"
 
 using namespace std;
 using namespace RigidBodyDynamics;

tests/SpatialAlgebraTests.cc

 #include <iostream>
 #include <iomanip>
 
-#include "Body.h"
-#include "rbdl_math.h"
-#include "rbdl_mathutils.h"
+#include "rbdl/Body.h"
+#include "rbdl/rbdl_math.h"
+#include "rbdl/rbdl_mathutils.h"
 
 using namespace std;
 using namespace RigidBodyDynamics;

tests/TwolegModelTests.cc

 
 #include <iostream>
 
-#include "Logging.h"
+#include "rbdl/Logging.h"
 
-#include "Model.h"
-#include "Contacts.h"
-#include "Dynamics.h"
-#include "Kinematics.h"
+#include "rbdl/Model.h"
+#include "rbdl/Contacts.h"
+#include "rbdl/Dynamics.h"
+#include "rbdl/Kinematics.h"
 
 using namespace std;
 using namespace RigidBodyDynamics;
 #include <iostream>
 #include <string>
 
-#include <rbdl.h>
+#include <rbdl/rbdl.h>
 
 int main (int argc, char *argv[])
 {

utils/include_change.sh

+#!/bin/bash
+
+# Go through and change includes for RBDL to use prefix 'rbdl/'
+
+# Using: http://stackoverflow.com/questions/11003418/calling-functions-with-xargs-within-a-bash-script
+function rbdl_include_change()
+{
+	# Could probably just make this a for loop. Meh
+	# Couldn't add a redirection at the very end, so just resorted to a hack
+	sed 's/#include "/#include "rbdl\//g' $1 \
+		| bash -c "cat > '$1'"
+#		| sed 's/#include <rbdl_/#include <rbdl\/rbdl_/g' \
+#		| sed 's/#include "rbdl\/Eigen/#include "Eigen/g' \
+}
+export -f rbdl_include_change
+
+function rbdl_do_it()
+{
+	find $1 -type f -print0 | xargs -0 -n 1 bash -c 'rbdl_include_change $1' _
+}
+
+# Run from base directory
+
+#rbdl_do_it ./include
+#rbdl_do_it ./src
+
+# Make sure plugin is changed as well
+#sed -i 's/#define EIGEN_MATRIX_PLUGIN "MatrixAddons.h"/#define EIGEN_MATRIX_PLUGIN "rbdl\/MatrixAddons.h"/g' ./include/rbdl/rbdl_math.h
+
+rbdl_do_it ./tests
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.