10 using namespace mujinclient;
12 int main(
int argc,
char ** argv)
15 std::cout <<
"need username:password. Example: mujinclienttest myuser:mypass [url]\n\nurl - [optional] For example https://controller.mujin.co.jp/" << std::endl;
26 else if( argc == 3 ) {
32 std::cout <<
"connected to controller v" << controller->GetVersion() << std::endl;
34 std::string sceneuri =
"mujin:/test.mujin.dae";
35 std::string scenepk = controller->GetScenePrimaryKeyFromURI_UTF8(sceneuri);
39 controller->ImportSceneToCOLLADA_UTF8(
"mujin:/densowave_wincaps_data/vs060a3_test0/test0.WPJ",
"wincaps", sceneuri);
42 if( ex.
message().find(
"need to remove it first") != std::string::npos ) {
43 std::cout <<
"file already imported, would you like to delete and re-import? (yes/no) ";
46 if( answer == std::string(
"yes") ) {
47 std::cout <<
"try removing the file and importing again" << std::endl;
50 controller->ImportSceneToCOLLADA_UTF8(
"mujin:/densowave_wincaps_data/vs060a3_test0/test0.WPJ",
"wincaps", sceneuri);
54 std::cout <<
"error importing scene" << ex.
message() << std::endl;
60 std::vector<SceneResource::InstObjectPtr> instobjects;
62 std::cout <<
"scene instance objects: ";
63 for(
size_t i = 0; i < instobjects.size(); ++i) {
64 std::cout << instobjects[i]->name <<
", ";
66 std::cout << std::endl;
69 std::cout <<
"exception thrown: " << ex.
message() << std::endl;