...
代码功能说明: 获取电量/充电状态
Code Block language cpp firstline 1 title 获取传感器数据 linenumbers true const int max_go_home_times = 3; SlamwareCorePlatform sdp = SlamwareCorePlatform::connect(argv[1], 1445); std::cout <<"SDK Version: " << sdp.getSDKVersion() << std::endl; std::cout <<"SDP Version: " << sdp.getSDPVersion() << std::endl; int go_home_count = 1; rpos::actions::MoveAction action; do { action = sdp.goHome(); action.waitUntilDone(); if(action.getStatus() == rpos::core::ActionStatusFinished) break; std::cout << "go home to charge times count: " << go_home_count << std::endl; go_home_count++; } while(go_home_count <= max_go_home_times);
...