Add elasticity plugins to xml_native_writer_test. Fixes #961.
PiperOrigin-RevId: 545454207 Change-Id: I4e93499eaa53e5bc8c8afa682986657cef3ac20f
This commit is contained in:
committed by
Copybara-Service
parent
2b38148d24
commit
46e06c4cac
@@ -19,6 +19,7 @@
|
||||
#include <absl/strings/string_view.h>
|
||||
#include <mujoco/mjdata.h>
|
||||
#include <mujoco/mjmodel.h>
|
||||
#include <mujoco/mujoco.h>
|
||||
|
||||
namespace mujoco {
|
||||
|
||||
@@ -65,5 +66,29 @@ const std::string SaveAndReadXml(const mjModel* model);
|
||||
std::vector<mjtNum> GetCtrlNoise(const mjModel* m, int nsteps,
|
||||
mjtNum ctrlnoise = 0.01);
|
||||
|
||||
// Installs elasticity plugins
|
||||
// TODO(quaglino): load all plugins with a macro
|
||||
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
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace mujoco
|
||||
#endif // MUJOCO_TEST_FIXTURE_H_
|
||||
|
||||
Reference in New Issue
Block a user