Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tried to fix samples/tests compilation #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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] << "]";
}
9 changes: 3 additions & 6 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,14 +22,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
9 changes: 3 additions & 6 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,14 +22,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
9 changes: 3 additions & 6 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,14 +22,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
9 changes: 3 additions & 6 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,14 +24,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
9 changes: 3 additions & 6 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,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
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
7 changes: 2 additions & 5 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,15 +22,12 @@ 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]);
}
std::cout << "connected to controller v" << controller->GetVersion() << std::endl;

// get all supported keys
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