智能机器人课程设计报告

上传人:给**** 文档编号:126883375 上传时间:2020-03-28 格式:DOC 页数:10 大小:54.50KB
返回 下载 相关 举报
智能机器人课程设计报告_第1页
第1页 / 共10页
智能机器人课程设计报告_第2页
第2页 / 共10页
智能机器人课程设计报告_第3页
第3页 / 共10页
智能机器人课程设计报告_第4页
第4页 / 共10页
智能机器人课程设计报告_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《智能机器人课程设计报告》由会员分享,可在线阅读,更多相关《智能机器人课程设计报告(10页珍藏版)》请在金锄头文库上搜索。

1、天津师范大学计算机与信息工程学院课程设计报告课程名称: 机器人设计 设计题目: 专 业: 信息工程 班 级: 组 别: 学生姓名: 学 号: 起止日期: 指导教师: 同组人员: 课程设计题目机器人设计实验姓名学号班级班级专业信息工程组别组长组员指导教师课程设计目的设计家庭组机器人和机器人行走课程设计环境Vc+课程设计任务和要求用C+语言设计一个颜色识别的程序和一个机器人行走程序课程设计内容描述:1 绪论 通过学习机器人设计2课程,学会了家庭组机器人和足球机器人的一些理论知识。了解了机器人方向识别,动手调试了全景摄像头和前置摄像头,设置了场地、球门、白线、足球等的颜色数值。2. 颜色识别的产生

2、结合梁老师给的人脸识别程序,通过改变人脸模型建立颜色识别程序。 3. 平台的选择及搭建 根据刘老师给的参考资料,首先安装了DirectX9.0 SDK和Visual C+软件,然后一步步的按照老师所给的步骤,先建立基本界面,接着编制串口通讯控制机器人的程序,读取距离传感器信息等,最后得出了机器人行走程序如下。课程设计源程序:机器人行走/ VoyTestDlg.cpp : implementation file/#include stdafx.h#include VoyTest.h#include VoyTestDlg.h#ifdef _DEBUG#define new DEBUG_NEW#un

3、def THIS_FILEstatic char THIS_FILE = _FILE_;#endif/ CAboutDlg dialog used for App Aboutclass CAboutDlg : public CDialogpublic:CAboutDlg();/ Dialog Data/AFX_DATA(CAboutDlg)enum IDD = IDD_ABOUTBOX ;/AFX_DATA/ ClassWizard generated virtual function overrides/AFX_VIRTUAL(CAboutDlg)protected:virtual void

4、 DoDataExchange(CDataExchange* pDX); / DDX/DDV support/AFX_VIRTUAL/ Implementationprotected:/AFX_MSG(CAboutDlg)/AFX_MSGDECLARE_MESSAGE_MAP();CAboutDlg:CAboutDlg() : CDialog(CAboutDlg:IDD)/AFX_DATA_INIT(CAboutDlg)/AFX_DATA_INITvoid CAboutDlg:DoDataExchange(CDataExchange* pDX)CDialog:DoDataExchange(pD

5、X);/AFX_DATA_MAP(CAboutDlg)/AFX_DATA_MAPBEGIN_MESSAGE_MAP(CAboutDlg, CDialog)/AFX_MSG_MAP(CAboutDlg)/ No message handlers/AFX_MSG_MAPEND_MESSAGE_MAP()/ CVoyTestDlg dialogCVoyTestDlg:CVoyTestDlg(CWnd* pParent /*=NULL*/): CDialog(CVoyTestDlg:IDD, pParent)/AFX_DATA_INIT(CVoyTestDlg)m_nPort = 0;/AFX_DAT

6、A_INIT/ Note that LoadIcon does not require a subsequent DestroyIcon in Win32m_hIcon = AfxGetApp()-LoadIcon(IDR_MAINFRAME);void CVoyTestDlg:DoDataExchange(CDataExchange* pDX)CDialog:DoDataExchange(pDX);/AFX_DATA_MAP(CVoyTestDlg)DDX_Text(pDX, IDC_PORT, m_nPort);/AFX_DATA_MAPBEGIN_MESSAGE_MAP(CVoyTest

7、Dlg, CDialog)/AFX_MSG_MAP(CVoyTestDlg)ON_WM_SYSCOMMAND()ON_WM_PAINT()ON_WM_QUERYDRAGICON()ON_BN_CLICKED(IDC_OPEN, OnOpen)ON_BN_CLICKED(IDC_FORWARD, OnForward)ON_BN_CLICKED(IDC_BACKWARD, OnBackward)ON_BN_CLICKED(IDC_TURELEFT, OnTureleft)ON_BN_CLICKED(IDC_TURERIGHT, OnTureright)ON_BN_CLICKED(IDC_BRAKE

8、, OnBrake)/AFX_MSG_MAPEND_MESSAGE_MAP()/ CVoyTestDlg message handlersBOOL CVoyTestDlg:OnInitDialog()CDialog:OnInitDialog();/ Add About. menu item to system menu./ IDM_ABOUTBOX must be in the system command range.ASSERT(IDM_ABOUTBOX & 0xFFF0) = IDM_ABOUTBOX);ASSERT(IDM_ABOUTBOX AppendMenu(MF_SEPARATO

9、R);pSysMenu-AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);/ Set the icon for this dialog. The framework does this automatically/ when the applications main window is not a dialogSetIcon(m_hIcon, TRUE);/ Set big iconSetIcon(m_hIcon, FALSE);/ Set small icon/ TODO: Add extra initialization hereretu

10、rn TRUE; / return TRUE unless you set the focus to a controlvoid CVoyTestDlg:OnSysCommand(UINT nID, LPARAM lParam)if (nID & 0xFFF0) = IDM_ABOUTBOX)CAboutDlg dlgAbout;dlgAbout.DoModal();elseCDialog:OnSysCommand(nID, lParam);/ If you add a minimize button to your dialog, you will need the code below/

11、to draw the icon. For MFC applications using the document/view model,/ this is automatically done for you by the framework.void CVoyTestDlg:OnPaint() if (IsIconic()CPaintDC dc(this); / device context for paintingSendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);/ Center icon in client rectangleint cxIcon = GetSystemMetrics(SM_CXICON);int cyIcon = GetSystemMetrics(SM_CYICON);CRect rect;GetClientRect(&rect);int x = (rect.Width() - cxIcon + 1) / 2;int y = (rect.Height() - cyIcon + 1) / 2;/ Draw the icondc.DrawIcon(x, y, m_hIcon);

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 系统集成

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号