Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 代码功能说明: 获取电量/充电状态

    Code Block
    languagecpp
    firstline1
    title获取传感器数据
    linenumberstrue
    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);
    


...