Versions Compared

Key

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

...

  1. Right click on "virtual_track_with_oa" project, set as StartUp project.


  2. 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.



  3. Right click on "virtual_track_with_oa", then "properties",set "Command Arguments" as follows: 
    Syntax :virtual_track_with_oa <IP address>

  4. Click " F5" to execute.
  5. Robot's motion could be seen in Robostudio.
    Multimedia
    namebandicam 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
    languagecpp
    firstline1
    titleVirtual Track with OA Navigation
    linenumberstrue
        
    		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;;

...