Add elasticity plugins to xml_native_writer_test. Fixes #961.

PiperOrigin-RevId: 545454207
Change-Id: I4e93499eaa53e5bc8c8afa682986657cef3ac20f
This commit is contained in:
Alessio Quaglino
2023-07-04 08:28:56 -07:00
committed by Copybara-Service
parent 2b38148d24
commit 46e06c4cac
5 changed files with 56 additions and 36 deletions
-22
View File
@@ -29,28 +29,6 @@
namespace mujoco {
namespace {
class PluginTest : public MujocoTest {
public:
// load plugin library
PluginTest() : MujocoTest() {
#if defined(_WIN32) || defined(__CYGWIN__)
mj_loadPluginLibrary((
std::string(std::getenv("MUJOCO_PLUGIN_DIR")) +
std::string("\\elasticity.dll")).c_str());
#else
#if defined(__APPLE__)
mj_loadPluginLibrary((
std::string(std::getenv("MUJOCO_PLUGIN_DIR")) +
std::string("/libelasticity.dylib")).c_str());
#else
mj_loadPluginLibrary((
std::string(std::getenv("MUJOCO_PLUGIN_DIR")) +
std::string("/libelasticity.so")).c_str());
#endif
#endif
}
};
// -------------------------------- solid -----------------------------------
TEST_F(PluginTest, ElasticEnergy) {
static constexpr char cantilever_xml[] = R"(