预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

在线预览结束,喜欢就下载吧,查找使用更方便

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

源程序如下:/*TemplatetoaccessARIA(ActivMediaRoboticsInterfaceforApplications)usingMicrosoftVisualC++,consoleProjects.*/#include"Aria.h"#include<cstdlib>#include<iostream>#include<iomanip>#include<fstream>#include<ctime>#include<math.h>#include<cmath>usingnamespacestd;//therobotArRobot*robot;ArSonarDevicesonar;//sonar,mustbeaddedtotherobotArSicksick;//thelaserintstep=0;doubled0,d1,d3,d2,d4,d15;doubleth,r,PI=3.1415926;doubleminimum=0;//sonarsensoroffsetpositionswithrespecttorobotlocalcoordinateframedoublerobotSonarX[8]={69,114,148,166,166,148,114,69};doublerobotSonarY[8]={136,119,78,27,-27,-78,-119,-136};doublerobotSonarTh[8]={90.0,50.0,30.0,10.0,-10.0,-30.0,-50.0,-90.0};doublelaserData[2][180];doublesonarData[5][16];//last5setsofsonarreadingsdoubleposData[5];//odometryreadingslongframeCount=-1;//howmanyiterationsofthesensorgrabbingfunctionshavebeenrun/*********************************************************************************Filesforloggingpositionandsensordata*********************************************************************************/ofstreampositionData("positionvals.txt");ofstreamsonarVals("sonarvals.txt");ofstreamglobalFrame("globalFrame.txt");/*********************************************************************************FunctionDefinitions*********************************************************************************/voidgrabNewPositionData(void);voidlogPositionData(void);voidgrabNewSonarData(void);voidlogRawSonarData(void);voidMapToGlobalFrame(void);boolflag=true;boolweWantToTurnTheRobot=true;booldecideWhichDirectionToTurn=true;boolturnRobotRight=false;boolturnRobotLeft=false;voidupdate(void){//YourCodeHeregrabNewSonarData();grabNewPositionData();logPositionData();logRawSonarData();//grabNewLaserData();MapToGlobalFrame();