You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

本页介绍了go_home_charge的用法, 包含机器人回充命令的使用


本页内容



需要

软件平台

硬件平台

(以下任选其一)

  • Slamware SDP mini 
  • Slamware SDP
  • Slamware 套装 (基于Slamware导航方案的用户机器人系统)
  • Zeus/Apollo等底盘系统

编译运行

  1. 打开samples工程
  2. 右键go_home_to_charge, 打开属性选项,将Slamware SDK 的include目录和lib目录添加到工程
  3. 右键go_home_to_charge, 将此工程设置成StartUp project
  4. 右键go_home_to_charge, 在Debugging页面中command Arguments处输入 192.168.11.1
    格式说明:go_home_to_charge <IP address> 
  5. 点击F5运行
  6. (TODO 添加RoboStudio的视频)

描述:

  • 代码功能说明: 调用goHome()接口来进行自动回充,如果没有找到充电桩或者充电失败,会重复至多三次调用goHome()

    自动回充
            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);
    


  • No labels