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;
35 controller->SyncUpload_UTF8(
"../share/mujincontrollerclient/robodia_demo1/robodia_demo1.xml",
"mujin:/robodia_demo1/",
"cecrobodiaxml");
38 std::string sceneuri =
"mujin:/robodia_demo1.mujin.dae";
40 controller->ImportSceneToCOLLADA_UTF8(
"mujin:/robodia_demo1/robodia_demo1.xml",
"cecrobodiaxml", sceneuri);
43 if( ex.
message().find(
"need to remove it first") != std::string::npos ) {
44 std::cout <<
"file already imported, would you like to delete and re-import? (yes/no) ";
47 if( answer == std::string(
"yes") ) {
48 std::cout <<
"try removing the file and importing again" << std::endl;
51 controller->ImportSceneToCOLLADA_UTF8(
"mujin:/robodia_demo1/robodia_demo1.xml",
"cecrobodiaxml", sceneuri);
55 std::cout <<
"error importing scene" << ex.
message() << std::endl;
61 std::string scenepk = controller->GetScenePrimaryKeyFromURI_UTF8(sceneuri);
63 std::vector<SceneResource::InstObjectPtr> instobjects;
65 std::cout <<
"scene instance objects: ";
66 for(
size_t i = 0; i < instobjects.size(); ++i) {
67 std::cout << instobjects[i]->name <<
", ";
69 std::cout << std::endl;
72 std::cout <<
"exception thrown: " << ex.
message() << std::endl;