Skip to content

Commit

Permalink
Merge pull request #138 from mujin/fixSamples20230801
Browse files Browse the repository at this point in the history
fix samples/tests compilation
  • Loading branch information
yoshikikanemoto authored Nov 13, 2024
2 parents 7597a02 + e12e58a commit e24f8a2
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 49 deletions.
16 changes: 8 additions & 8 deletions samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ build_sample(mujindeleteallscenes)
build_sample(mujindeleteallitlprograms)
if (libzmq_FOUND)
build_sample(mujinbinpickingtask)
build_sample(mujinjog)
# build_sample(mujinjog)
build_sample(mujinupdategeometry)
build_sample(mujinmovetoollinear)
# build_sample(mujinmovetoollinear)
build_sample(mujintransform)
build_sample(mujinsetdofvalues)
build_sample(mujincreateikparam)
build_sample(mujingetpublishedtaskstate)
# build_sample(mujincreateikparam)
# build_sample(mujingetpublishedtaskstate)
build_sample(mujingrabrelease)
build_sample(mujinpointcloud)
# build_sample(mujinpointcloud)
build_sample(mujincreateinstobject)
build_sample(mujinmovetohandposition)
build_sample(mujinmoveandcancel)
build_sample(mujinplanexecute)
# build_sample(mujinmovetohandposition)
# build_sample(mujinmoveandcancel)
# build_sample(mujinplanexecute)
build_sample(mujincreateitltask)
build_sample(mujinlistobjects)
build_sample(mujinqueryobject)
Expand Down
2 changes: 1 addition & 1 deletion samples/mujinbinpickingtask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ int main(int argc, char ** argv)
binpickingzmq->Initialize("", binpickingTaskZmqPort, binpickingTaskHeartbeatPort, zmqcontext);

Transform t;
binpickingzmq->GetTransform(testobjectname,t);
binpickingzmq->GetTransform(testobjectname,t,"mm");
std::cout << "testobject " << testobjectname << " pose: [" << t.quaternion[0] << ", " << t.quaternion[1] << ", " << t.quaternion[2] << ", " << t.quaternion[3] << ", " << t.translate[0] << ", " << t.translate[1] << ", " << t.translate[2] << "]";
}
4 changes: 2 additions & 2 deletions samples/mujinexecutetask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ using namespace mujinclient;

int main(int argc, char ** argv)
{
if( argc < 2 ) {
if( argc < 3 ) {
std::cout << "need username:password. Example: mujinclienttest myuser:mypass [url]\n\nurl - [optional] For example https://controller.mujin.co.jp/" << std::endl;
return 1;
}
Expand All @@ -22,7 +22,7 @@ int main(int argc, char ** argv)
if( argc >= 5 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3], argv[4]);
}
if( argc == 4 ) {
else if( argc == 4 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3]);
}
else if( argc == 3 ) {
Expand Down
4 changes: 2 additions & 2 deletions samples/mujinexecutetask_fast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ using namespace mujinclient;

int main(int argc, char ** argv)
{
if( argc < 2 ) {
if( argc < 3 ) {
std::cout << "need username:password. Example: mujinclienttest myuser:mypass [url]\n\nurl - [optional] For example https://controller.mujin.co.jp/" << std::endl;
return 1;
}
Expand All @@ -22,7 +22,7 @@ int main(int argc, char ** argv)
if( argc >= 5 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3], argv[4]);
}
if( argc == 4 ) {
else if( argc == 4 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3]);
}
else if( argc == 3 ) {
Expand Down
4 changes: 2 additions & 2 deletions samples/mujinexecutetask_robodia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ using namespace mujinclient;

int main(int argc, char ** argv)
{
if( argc < 2 ) {
if( argc < 3 ) {
std::cout << "need username:password. Example: mujinclienttest myuser:mypass [url]\n\nurl - [optional] For example https://controller.mujin.co.jp/" << std::endl;
return 1;
}
Expand All @@ -22,7 +22,7 @@ int main(int argc, char ** argv)
if( argc >= 5 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3], argv[4]);
}
if( argc == 4 ) {
else if( argc == 4 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3]);
}
else if( argc == 3 ) {
Expand Down
4 changes: 2 additions & 2 deletions samples/mujinideal_densowave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ using namespace mujinclient;

int main(int argc, char ** argv)
{
if( argc < 2 ) {
if( argc < 3 ) {
std::cout << "need username:password. Example: mujinclienttest myuser:mypass [url]\n\nurl - [optional] For example https://controller.mujin.co.jp/" << std::endl;
return 1;
}
Expand All @@ -24,7 +24,7 @@ int main(int argc, char ** argv)
if( argc >= 5 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3], argv[4]);
}
if( argc == 4 ) {
else if( argc == 4 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3]);
}
else if( argc == 3 ) {
Expand Down
4 changes: 2 additions & 2 deletions samples/mujinimportscene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ using namespace mujinclient;

int main(int argc, char ** argv)
{
if( argc < 2 ) {
if( argc < 3 ) {
std::cout << "need username:password. Example: mujinclienttest myuser:mypass [url]\n\nurl - [optional] For example https://controller.mujin.co.jp/" << std::endl;
return 1;
}
Expand All @@ -20,7 +20,7 @@ int main(int argc, char ** argv)
if( argc >= 5 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3], argv[4]);
}
if( argc == 4 ) {
else if( argc == 4 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3]);
}
else if( argc == 3 ) {
Expand Down
9 changes: 3 additions & 6 deletions samples/mujinimportscene_robodia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ using namespace mujinclient;

int main(int argc, char ** argv)
{
if( argc < 2 ) {
if( argc < 3 ) {
std::cout << "need username:password. Example: mujinclienttest myuser:mypass [url]\n\nurl - [optional] For example https://controller.mujin.co.jp/" << std::endl;
return 1;
}
Expand All @@ -20,14 +20,11 @@ int main(int argc, char ** argv)
if( argc >= 5 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3], argv[4]);
}
if( argc == 4 ) {
else if( argc == 4 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3]);
}
else if( argc == 3 ) {
controller = CreateControllerClient(argv[1], argv[2]);
}
else {
controller = CreateControllerClient(argv[1]);
controller = CreateControllerClient(argv[1], argv[2]);
}
std::cout << "connected to controller v" << controller->GetVersion() << std::endl;

Expand Down
4 changes: 2 additions & 2 deletions samples/mujinshowresults.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ using namespace mujinclient;

int main(int argc, char ** argv)
{
if( argc < 2 ) {
if( argc < 3 ) {
std::cout << "need username:password. Example: mujinclienttest myuser:mypass [url]\n\nurl - [optional] For example https://controller.mujin.co.jp/" << std::endl;
return 1;
}
Expand All @@ -22,7 +22,7 @@ int main(int argc, char ** argv)
if( argc >= 5 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3], argv[4]);
}
if( argc == 4 ) {
else if( argc == 4 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3]);
}
else if( argc == 3 ) {
Expand Down
1 change: 0 additions & 1 deletion samples/mujinupdateenvironmentstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ int main(int argc, char ** argv)
}
std::istringstream ss(s);
while (ss) {
std::string s;
if (!std::getline(ss, s, ',')) {
break;
}
Expand Down
7 changes: 2 additions & 5 deletions test/mujintestutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ mujinclient::ControllerClientPtr CreateControllerFromCommandLine(int argc, char
if( argc >= 5 ) {
controller = mujinclient::CreateControllerClient(argv[1], argv[2], argv[3], argv[4]);
}
if( argc == 4 ) {
else if( argc == 4 ) {
controller = mujinclient::CreateControllerClient(argv[1], argv[2], argv[3]);
}
else if( argc == 3 ) {
controller = mujinclient::CreateControllerClient(argv[1], argv[2]);
}
else {
controller = mujinclient::CreateControllerClient(argv[1]);
controller = mujinclient::CreateControllerClient(argv[1], argv[2]);
}
std::cout << "connected to controller v" << controller->GetVersion() << std::endl;
return controller;
Expand Down
7 changes: 2 additions & 5 deletions test/settaskparameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ int main(int argc, char ** argv)
if( argc >= 5 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3], argv[4]);
}
if( argc == 4 ) {
else if( argc == 4 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3]);
}
else if( argc == 3 ) {
controller = CreateControllerClient(argv[1], argv[2]);
}
else {
controller = CreateControllerClient(argv[1]);
controller = CreateControllerClient(argv[1], argv[2]);
}
std::cout << "connected to controller v" << controller->GetVersion() << std::endl;

Expand Down
7 changes: 2 additions & 5 deletions test/showresults.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ int main(int argc, char ** argv)
if( argc >= 5 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3], argv[4]);
}
if( argc == 4 ) {
else if( argc == 4 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3]);
}
else if( argc == 3 ) {
controller = CreateControllerClient(argv[1], argv[2]);
}
else {
controller = CreateControllerClient(argv[1]);
controller = CreateControllerClient(argv[1], argv[2]);
}
std::cout << "connected to controller v" << controller->GetVersion() << std::endl;
std::vector<std::string> scenekeys;
Expand Down
9 changes: 3 additions & 6 deletions test/uploadregister.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@ int main(int argc, char ** argv)
if( argc >= 5 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3], argv[4]);
}
if( argc == 4 ) {
else if( argc == 4 ) {
controller = CreateControllerClient(argv[1], argv[2], argv[3]);
}
else if( argc == 3 ) {
controller = CreateControllerClient(argv[1], argv[2]);
}
else {
controller = CreateControllerClient(argv[1]);
controller = CreateControllerClient(argv[1], argv[2]);
}
std::cout << "connected to controller v" << controller->GetVersion() << std::endl;

Expand All @@ -35,7 +32,7 @@ int main(int argc, char ** argv)
std::string desturi = "mujin:/testupload/hello.txt";
std::vector<unsigned char> vdata(5), vtestoutputdata;
vdata[0] = 'H'; vdata[1] = 'e'; vdata[2] = 'l'; vdata[3] = 'l'; vdata[4] = 'o';
controller->UploadDataToController_UTF8(vdata,desturi);
controller->UploadDataToController_UTF8(vdata.data(),vdata.size(),desturi);

controller->DownloadFileFromController_UTF8(desturi, vtestoutputdata);
BOOST_ASSERT(vdata.size() == vtestoutputdata.size());
Expand Down

0 comments on commit e24f8a2

Please sign in to comment.