需要:
软件平台:
- Visual Studio 2010
- Slamware Windows SDK: https://download.slamtec.com/api/download/slamware-sdk-windows/2.5.0%20dev%2020170718?lang=netural
- Sample Code:
硬件平台:
(以下任选其一)
- Slamware SDP mini
- Slamware SDP
- Slamware 套装 (基于Slamware导航方案的用户机器人系统)
- Zeus/Apollo等底盘系统
编译运行:
准备工作: 开启机器人系统电源,雷达转动之后代表系统已经成功启动。
- 在sample code所在文件夹中,打开 samples.sln
- 右键rotation_action_demo, 打开属性选项,将Slamware SDK 的include目录和lib目录添加到工程
- 右键rotation_action_demo, 将此工程设置成StartUp project
- 右键rotation_action_demo, 在Debugging页面中command Arguments处输入 192.168.11.1 (Slamware AP 模式默认IP地址)。 注: 此sample为 windows console application, 也可以在console中用命令行执行,用法为:rotation_action_demo <IP address>
- 点击F5运行
- (TODO 添加RoboStudio的视频)
描述:
代码功能说明:机器人先逆时针转一周,再顺时针转一周,最后转到yaw值为pi的位置。
旋转指定角度/旋转到指定角度SlamwareCorePlatform sdp = SlamwareCorePlatform::connect(argv[1], 1445); std::cout <<"SDK Version: " << sdp.getSDKVersion() << std::endl; std::cout <<"SDP Version: " << sdp.getSDPVersion() << std::endl; rpos::actions::MoveAction action = sdp.getCurrentAction(); if (action) action.cancel(); //anticlockwise rotation rpos::core::Rotation rotation(pi*2, 0, 0); action = sdp.rotate(rotation); action.waitUntilDone(); std::cout << "Action Status: " << action.getStatus() << std::endl; //clockwise rotation rotation.yaw() = pi * (-2); action = sdp.rotate(rotation); action.waitUntilDone(); std::cout << "Action Status: " << action.getStatus() << std::endl; //rotate to a certain orientation rpos::core::Rotation orientation(pi, 0, 0); action = sdp.rotateTo(orientation); action.waitUntilDone(); std::cout << "Action Status: " << action.getStatus() << std::endl;