Skip to content

Commit

Permalink
Fixed blocking issue of realtime test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericcsr committed Feb 5, 2022
1 parent fedbe3b commit 6b5360a
Show file tree
Hide file tree
Showing 13 changed files with 598 additions and 593 deletions.
2 changes: 1 addition & 1 deletion unittests/comprehensive/test_FullAcrobot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "TestHelpers.hpp"
#include "stdio.h"

#define iLQR_MPC_TEST
//#define iLQR_MPC_TEST

using namespace dart;
using namespace math;
Expand Down
2 changes: 1 addition & 1 deletion unittests/comprehensive/test_FullArm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "TestHelpers.hpp"
#include "stdio.h"

#define iLQR_MPC_TEST
//#define iLQR_MPC_TEST
#define USE_NOISE

using namespace dart;
Expand Down
5 changes: 3 additions & 2 deletions unittests/comprehensive/test_FullContactCartpole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "TestHelpers.hpp"
#include "stdio.h"

#define iLQR_MPC_TEST
//#define iLQR_MPC_TEST

using namespace dart;
using namespace math;
Expand Down Expand Up @@ -182,7 +182,7 @@ std::shared_ptr<LossFn> getSSIDVelLoss()
return std::make_shared<LossFn>(loss, lossGrad);
}


#ifdef iLQR_MPC_TEST
WorldPtr createWorld(s_t timestep)
{
WorldPtr world = World::create();
Expand Down Expand Up @@ -268,6 +268,7 @@ WorldPtr createWorld(s_t timestep)

return world;
}
#endif

std::mt19937 initializeRandom()
{
Expand Down
2 changes: 1 addition & 1 deletion unittests/comprehensive/test_FullDoublependulum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "TestHelpers.hpp"
#include "stdio.h"

#define iLQR_MPC_TEST
//#define iLQR_MPC_TEST
#define USE_NOISE

using namespace dart;
Expand Down
2 changes: 1 addition & 1 deletion unittests/comprehensive/test_FullWhip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "TestHelpers.hpp"
#include "stdio.h"

#define iLQR_MPC_TEST
//#define iLQR_MPC_TEST
#define USE_NOISE

using namespace dart;
Expand Down
4 changes: 2 additions & 2 deletions unittests/comprehensive/test_HalfCheetahRealtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
#include "TestHelpers.hpp"
#include "stdio.h"

#define ALL_TESTS
// #define NO_VIS
//#define ALL_TESTS
//#define NO_VIS

using namespace dart;
using namespace math;
Expand Down
4 changes: 3 additions & 1 deletion unittests/comprehensive/test_Proto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ TEST(PROTO, SERIALIZE_ROLLOUT)
std::unordered_map<std::string, Eigen::MatrixXs> vel;
std::unordered_map<std::string, Eigen::MatrixXs> force;
Eigen::VectorXs mass = Eigen::VectorXs::Random(dofs);
Eigen::VectorXs spring = Eigen::VectorXs::Random(dofs);
Eigen::VectorXs damping = Eigen::VectorXs::Random(dofs);
std::unordered_map<std::string, Eigen::MatrixXs> metadata;

pos["identity"] = Eigen::MatrixXs::Random(dofs, steps);
Expand All @@ -121,7 +123,7 @@ TEST(PROTO, SERIALIZE_ROLLOUT)
metadata["3"] = Eigen::MatrixXs::Random(dofs, steps);

TrajectoryRolloutReal rollout
= TrajectoryRolloutReal(pos, vel, force, mass, metadata);
= TrajectoryRolloutReal(pos, vel, force, mass, damping, spring, metadata);

proto::TrajectoryRollout proto;
rollout.serialize(proto);
Expand Down
10 changes: 6 additions & 4 deletions unittests/comprehensive/test_Realtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
#include "TestHelpers.hpp"
#include "stdio.h"

#define ALL_TESTS
#define COM_SSID
#define MASS_SSID
//#define ALL_TESTS
//#define COM_SSID
//#define MASS_SSID

using namespace dart;
using namespace math;
Expand Down Expand Up @@ -1292,6 +1292,7 @@ TEST(REALTIME, CARTPOLE_MU_PLOT)
}
#endif

#ifdef ALL_TESTS
TEST(REALTIME, CARTPOLE_COM_PLOT)
{
////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1450,4 +1451,5 @@ TEST(REALTIME, CARTPOLE_COM_PLOT)
solutionMat.row(i) = solutions[i];
}
ssid.saveCSVMatrix("/workspaces/nimblephysics/dart/realtime/saved_data/raw_data/Solutions.csv",solutionMat);
}
}
#endif
Loading

0 comments on commit 6b5360a

Please sign in to comment.