4 using namespace mujinclient;
6 #include <boost/program_options.hpp>
8 int main(
int argc,
char ** argv)
11 namespace bpo = boost::program_options;
12 bpo::options_description desc(
"Options");
15 (
"help,h",
"produce help message")
16 (
"controller_ip", bpo::value<std::string>()->required(),
"ip of the mujin controller, e.g. controller3")
17 (
"controller_port", bpo::value<unsigned int>()->default_value(80),
"port of the mujin controller, e.g. 80")
18 (
"controller_username_password", bpo::value<std::string>()->required(),
"username and password to the mujin controller, e.g. username:password")
19 (
"binpicking_task_zmq_port", bpo::value<unsigned int>()->required(),
"port of the binpicking task on the mujin controller, e.g. 7100")
20 (
"binpicking_task_heartbeat_port", bpo::value<unsigned int>()->required(),
"port of the binpicking task's heartbeat signal on the mujin controller, e.g. 7101")
21 (
"binpicking_task_scenepk", bpo::value<std::string>()->required(),
"scene pk of the binpicking task on the mujin controller, e.g. irex2013.mujin.dae")
22 (
"robotname", bpo::value<std::string>()->required(),
"robot name, e.g. VP-5243I")
23 (
"testobjectname", bpo::value<std::string>()->required(),
"test object name in the scene, e.g. floor")
26 bpo::variables_map opts;
27 bpo::store(bpo::parse_command_line(argc, argv, desc), opts);
35 if(opts.count(
"help") || badargs) {
36 std::cout <<
"Usage: " << argv[0] <<
" [OPTS]" << std::endl;
37 std::cout << std::endl;
38 std::cout << desc << std::endl;
42 const std::string controllerIp = opts[
"controller_ip"].as<std::string>();
43 const unsigned int controllerPort = opts[
"controller_port"].as<
unsigned int>();
44 const std::string controllerUsernamePass = opts[
"controller_username_password"].as<std::string>();
45 const unsigned int binpickingTaskZmqPort = opts[
"binpicking_task_zmq_port"].as<
unsigned int>();
46 const unsigned int binpickingTaskHeartbeatPort = opts[
"binpicking_task_heartbeat_port"].as<
unsigned int>();
47 const std::string binpickingTaskScenePk = opts[
"binpicking_task_scenepk"].as<std::string>();
48 const std::string robotname = opts[
"robotname"].as<std::string>();
49 const std::string testobjectname = opts[
"testobjectname"].as<std::string>();
52 std::stringstream url_ss;
53 url_ss <<
"http://"<< controllerIp <<
":" << controllerPort;
57 boost::shared_ptr<zmq::context_t> zmqcontext(
new zmq::context_t(2));
58 binpickingzmq->Initialize(
"", binpickingTaskZmqPort, binpickingTaskHeartbeatPort, zmqcontext);
61 binpickingzmq->GetTransform(testobjectname,t);