This document introduces the demo project of "go_laser_scan", including how to get the original data of laser scanning.
...
Content
Table of Contents |
---|
...
IDE Preperation
Software
- Visual Studio 2010 SP1
- Slamware Windows SDK:Slamware Windows SDK
- RoboStudio(for map display):Robostudio installer
Sample Code:
Info Higher version of Visual Studio will cause errors. Sometime you will need to upgrade SP1 package to make your VS compatable with .Net Framework.
Hardware
(Either one of following)
- Slamware SDP mini
- Slamware SDP
- Slamware Kit
- Zeus/Apollo robot base
...
Download
...
Compiling
- Right click on "get_laser_scan" project, set as StartUp project.
Right click on " get_laser_scan ", 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 " get_laser_scan ", then "properties",set "Command Arguments" as follows:
Syntax :get_laser_scan <IP address>> - Click " F5" to execute.
- The output from console will be as follows:
...
Code
Get the original data of laser scanning
Code Block language cpp firstline 1 title Get the original data of laser scanning linenumbers true SlamwareCorePlatform sdp = SlamwareCorePlatform::connect(argv[1], 1445); std::cout <<"SDK Version: " << sdp.getSDKVersion() << std::endl; std::cout <<"SDP Version: " << sdp.getSDPVersion() << std::endl; rpos::features::system_resource::LaserScan laser_scan = sdp.getLaserScan(); std::vector<rpos::core::LaserPoint> laser_points =laser_scan.getLaserPoints(); for (std::vector<rpos::core::LaserPoint>::iterator it = laser_points.begin(); it!= laser_points.end(); ++it) std::cout << "Angle: " << it->angle() << "; Distance: " << it->distance() << "; is Valid: " << it->valid() << std::endl;