Excerpt |
---|
This document introduces the demo project of “virtual_track_with_oa”, including a brief introduction to Virtual Track with OA Navigation mode. It can be understood as high-speed priority in road navigation. 1. Between the starting point and the target point, if there is a track, it will take precedence on the track. 2. If there are obstacles on the track, it will go off the track and then go on the track. |
...
Content
Table of Contents |
---|
...
IDE Preperation
...
- Right click on "virtual_track_with_oa" project, set as StartUp project.
Right click on "virtual_track_with_oa", then " Properties",configure "include" and "lib" directories to the corresponding folder path of Slamware SDK.
Info It's not necessary to copy files to the project directory, user will only need to configure the path of SDK.
- Right click on "virtual_track_with_oa", then "properties",set "Command Arguments" as follows:
Syntax :virtual_track_with_oa <IP address> - Click " F5" to execute.
- Robot's motion could be seen in Robostudio.
Multimedia name bandicam 2018-08-15 18-20-25-768.mp4
...
Code
Draw a 6-meter-long forward trajectory in metre track in the forward direction of the x-axis direction of the robot's current position of the robot, and then walk move along the trajectory track to the target point.
Code Block language cpp firstline 1 title Virtual Track with OA Navigation linenumbers true SlamwareCorePlatform sdp = SlamwareCorePlatform::connect(ip_address, 1445); std::cout <<"SDK Version: " << sdp.getSDKVersion() << std::endl; std::cout <<"SDP Version: " << sdp.getSDPVersion() << std::endl; //draw a 6 meter virtual track rpos::core::Pose sdp_pos = sdp.getPose(); rpos::core::Line line(rpos::core::Point(sdp_pos.x(), sdp_pos.y()),rpos::core::Point(sdp_pos.x() + 6, sdp_pos.y())); sdp.addLine(ArtifactUsageVirtualTrack, line); rpos::actions::MoveAction action = sdp.getCurrentAction(); if (action) action.cancel(); rpos::features::motion_planner::MoveOptions options; options.flag = MoveOptionFlag(MoveOptionFlagKeyPointsWithOA); action = sdp.moveTo(rpos::core::Location(0, 0), options); action.waitUntilDone(); if (action.getStatus() == rpos::core::ActionStatusError) std::cout << "Action Failed: " << action.getReason() << std::endl;;
...