WiRobot X80 Manuel d'utilisateur

Naviguer en ligne ou télécharger Manuel d'utilisateur pour Matériel d'enregistrement WiRobot X80. LAMPIRAN A FOTO WIROBOT X80 Manuel d'utilisatio

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer

Résumé du contenu

Page 1 - FOTO WIROBOT X80

LAMPIRAN A FOTO WIROBOT X80

Page 2 - Tampak Samping

B-8 SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here m_MOTSDK.connectRobot("drrobot1"); //m_

Page 3

B-9 sText += _T(" + "); sText += sIP; m_ComboBindTo.AddString(sIP); } m_ComboBindTo.SetCurSel(0); Print(sText); /

Page 4

B-10 //kamera void CRDPDlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKG

Page 5 - PROGRAM UTAMA

B-11 } // The system calls this to obtain the cursor to display while the user drags // the minimized window. HCURSOR CRDPDlg::OnQueryDragIcon() {

Page 6

B-12 dwBindIP = m_LocalIP.Get(dSel = 1); CString sBindIP; m_ComboBindTo.GetWindowText(sBindIP); DWORD dwErr = m_Socket.Listen(dwBindIP, m

Page 7

B-13 DWORD dwIP; m_IPAddr.GetAddress(dwIP); dwIP = htonl(dwIP); DWORD dwErr = m_Socket.ConnectTo(dwIP, m_Port); if(dwErr) Print(_T(&qu

Page 8

B-14 else SetWindowText(TITLE + _T(" - Client")); //loop run until the main window was closed or a severe error occurred while(T

Page 9

B-15 if(dwEvent & FD_ACCEPT) sEvent += _T("FD_ACCEPT "); if(dwEvent & FD_CONNECT) sEvent +=

Page 10

B-16 else if(sClientCmd.Compare("MOVE_RIGHT") == 0) { OnBtnRight(); } else

Page 11

B-17 Print(_T("%s"), sEvent + sMsg); IPclient = FormatIP(dwIP); } // It is not necessary to update the Combobox a

Page 12

A-1 Tampak Atas Tampak Samping

Page 13

B-18 // Close all open Socket if(!m_Socket.GetSocketCount()) Print(_T("No Socket Open!")); else CloseSockets(); } void CRDPD

Page 14

B-19 m_ComboSendTo.ResetContent(); DWORD dwCount = m_Socket.GetSocketCount(); if(m_Socket.GetState() & TCP::cSocket::E_Connected)

Page 15

B-20 while(PeekMessage(&kMsg, NULL, NULL, NULL, PM_NOREMOVE)) { AfxGetThread()->PumpMessage(); } } void CRDPDlg::OnClose() { //

Page 16

B-21 m_sOutput += _T("\r\n"); LeaveCriticalSection(&m_CriticalSection); } CString CRDPDlg::FormatDisplayName(DWORD dwIndex) { /

Page 17

B-22 { // Get a human readable error message for an API error code // Some translation of error codes are really stupid --> show the original

Page 18

B-23 case WSAEPFNOSUPPORT: sCode = _T("WSAEPFNOSUPPORT"); break; case WSAEAFNOSUPPORT: sCode = _T("WSAEAFNOSUPPORT&q

Page 19

B-24 case WSAENOTEMPTY: sCode = _T("WSAENOTEMPTY"); break; case WSAEPROCLIM: sCode = _T("WSAEPROCLIM"); bre

Page 20

B-25 case WSAEREFUSED: sCode = _T("WSAEREFUSED"); break; case WSAHOST_NOT_FOUND: sCode = _T("WSAHOST_NOT_FOUND&quo

Page 21

B-26 void CRDPDlg::OnBtnSndTxt() { // TODO: Add your control notification handler code here // Send a text string to one or multiple destinatio

Page 22

B-27 } } else { SendTo(dSel, sSendData); } } BOOL CRDPDlg::SendTo(DWORD dwIndex, CString sSendData) { // Sends data to the socket

Page 23

Tampak Depan Tampak Belakang

Page 24

B-28 Print(_T("WSA_IO_PENDING -> Error: A previous send operation is still pending. This data will not be sent")); return TRUE;

Page 25

B-29 //m_PIR1 = m_MOTSDK.GetSensorHumanMotion1(); //m_PIR2 = m_MOTSDK.GetSensorHumanMotion2(); UpdateData(false); } void CRDPDlg::OnMotorSe

Page 26

B-30 void CRDPDlg::SendClientCmd(CString sClientCmd) { int dSel = m_ComboSendTo.GetCurSel(); if(dSel == 0 && (m_Socket.GetState() &

Page 27

B-31 } if(m_Sonar3 > 35) { OnBtnStop(); OnMotorSensorEventDrrobotsdkcontrolctrl1(); belokkanansedikit(); OnBtnFwd(); }

Page 28

B-32 long cmd1,cmd2; cmd1 = m_encoder1 - cWHOLE_RANGE / 3; cmd2 = m_encoder2 - cWHOLE_RANGE / 3; // change cmd1, cmd2 to valid

Page 29

B-33 m_MOTSDK.SetDcMotorPositionControlPID (1, 600,30,600); m_MOTSDK.DcMotorPositionTimeCtrAll (cmd1,cmd2,NO_CONTROL,NO_CONTROL,NO_CONTROL,NO_CON

Page 30

B-34 void CRDPDlg::OnBtnRight() { // TODO: Add your control notification handler code here BelokKanan(); } void CRDPDlg::OnBtnLeft() {

Page 31

B-35 long cmd1,cmd2; cmd1 = m_encoder1 - cWHOLE_RANGE / 12; cmd2 = m_encoder2 - cWHOLE_RANGE / 12; // change cmd1, cmd2 to valid

Page 32

B-36 m_MOTSDK.DcMotorPositionTimeCtrAll (cmd1,cmd2,NO_CONTROL,NO_CONTROL,NO_CONTROL,NO_CONTROL,1000); } void CRDPDlg::OnBUTTONBKiS() { // T

Page 33

B-37 if (cmd2 > cFULL_COUNT) cmd2 = cmd2 - cFULL_COUNT; m_MOTSDK.SetDcMotorControlMode (0,M_POSITION); m_MOTSDK.SetDcMotorControlMode (1

Page 34

B-2 LAMPIRAN B PROGRAM PADA PENGONTROL VISUAL C++

Page 35

B-38 m_MOTSDK.EnableServo (0); m_MOTSDK.ServoTimeCtr (0,3500,1500); } void CRDPDlg::OnBTNServoKiri() { // TODO: Add your control notific

Page 36

B-39 Sleep(10000); OnBtnStop(); } void CRDPDlg::AmbilGambar() { OnBTNServoAtas(); OnBTNServoKanan(); Sleep(2000); OnBtnTakePhoto();

Page 37

B-40 void CRDPDlg::CariRuangan() { JlnLurus(); Sleep(2000); OnBtnStop(); } void CRDPDlg::CariManusia() { if((m_PIR1 > 2000) &&

Page 38

B-41 warna = "blue"; if(IPclient == "192.168.0.203") warna = "green"; } SUBPROGRAM WiRobotSDK // Machine

Page 39

B-42 { CString result; GetProperty(0x2, VT_BSTR, (void*)&result); return result; } void CWiRobotSDK::SetRobotName(LPCTSTR propVal) { Set

Page 40

B-43 InvokeHelper(0x5, DISPATCH_METHOD, VT_I2, (void*)&result, NULL); return result; } short CWiRobotSDK::GetSensorSonar2() { short result

Page 41

B-44 short result; InvokeHelper(0xb, DISPATCH_METHOD, VT_I2, (void*)&result, NULL); return result; } short CWiRobotSDK::GetSensorHumanAlar

Page 42

B-45 { short result; InvokeHelper(0x11, DISPATCH_METHOD, VT_I2, (void*)&result, NULL); return result; } short CWiRobotSDK::GetSensorTemper

Page 43 - WiRobotSDK

B-46 void CWiRobotSDK::EnableDcMotor(short channel) { static BYTE parms[] = VTS_I2; InvokeHelper(0x17, DISPATCH_METHOD, VT_EMPTY, NULL, parms

Page 44

B-47 { static BYTE parms[] = VTS_I2 VTS_I2; InvokeHelper(0x1c, DISPATCH_METHOD, VT_EMPTY, NULL, parms, channel, filterMethod); } void C

Page 45

B-3 PROGRAM UTAMA // RDPDlg.cpp : implementation file // #include "stdafx.h" #include "RDP.h" #include "RDPDlg.h" #i

Page 46

B-48 static BYTE parms[] = VTS_I2 VTS_I2 VTS_I2; InvokeHelper(0x21, DISPATCH_METHOD, VT_EMPTY, NULL, parms, channel, cmdValue, timePerio

Page 47

B-49 { static BYTE parms[] = VTS_BSTR; InvokeHelper(0x26, DISPATCH_METHOD, VT_EMPTY, NULL, parms, fileName); } void CWiRobotSDK::TakePh

Page 48

B-50 } short CWiRobotSDK::GetSensorIRCode1() { short result; InvokeHelper(0x2b, DISPATCH_METHOD, VT_I2, (void*)&result, NULL); return resu

Page 49

B-51 { static BYTE parms[] = VTS_I2 VTS_I2 VTS_I2 VTS_I2 VTS_I2 VTS_I2 VTS_I2; InvokeHelper(0x30, DISPATCH_METHOD, VT_EMPTY, NULL, parms,

Page 50

B-52 cmd1, cmd2, cmd3, cmd4, cmd5, cmd6); } void CWiRobotSDK::DcMotorPwmNonTimeCtrAll(short cmd1, short cmd2, short cmd3, short cmd4, short cmd

Page 51

B-53 static BYTE parms[] = VTS_I2 VTS_I2 VTS_I2 VTS_I2 VTS_I2 VTS_I2 VTS_I2; InvokeHelper(0x3a, DISPATCH_METHOD, VT_EMPTY, NULL, parms,

Page 52

B-54 void CWiRobotSDK::LcdDisplayPMS(LPCTSTR bmpFileName) { static BYTE parms[] = VTS_BSTR; InvokeHelper(0x40, DISPATCH_METHOD, VT_EMPTY, NUL

Page 53

B-55 } short CWiRobotSDK::GetSensorPot4() { short result; InvokeHelper(0x46, DISPATCH_METHOD, VT_I2, (void*)&result, NULL); return result;

Page 54

B-56 short result; InvokeHelper(0x4b, DISPATCH_METHOD, VT_I2, (void*)&result, NULL); return result; } short CWiRobotSDK::GetCustomAD1() {

Page 55

B-57 { short result; InvokeHelper(0x51, DISPATCH_METHOD, VT_I2, (void*)&result, NULL); return result; } short CWiRobotSDK::GetCustomAD7()

Page 56

B-4 // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CAboutDlg) protected: virtual void DoDataExchange(CDataExchange* pDX

Page 57

B-58 Packets); } void CWiRobotSDK::SetSysMotorSensorPeriod(short PeriodTime) { static BYTE parms[] = VTS_I2; InvokeHelper(0x57, DISPATC

Page 58

B-59 void CWiRobotSDK::DisableMotorSensorSending() { InvokeHelper(0x5d, DISPATCH_METHOD, VT_EMPTY, NULL, NULL); } void CWiRobotSDK::DisableStanda

Page 59

B-60 long CWiRobotSDK::GetVoiceSegLength() { long result; InvokeHelper(0x64, DISPATCH_METHOD, VT_I4, (void*)&result, NULL); return result;

Page 60

B-61 return result; } short CWiRobotSDK::GetMotorCurrent5() { short result; InvokeHelper(0x6a, DISPATCH_METHOD, VT_I2, (void*)&result, NUL

Page 61

B-62 InvokeHelper(0x6f, DISPATCH_METHOD, VT_I2, (void*)&result, NULL); return result; } short CWiRobotSDK::GetEncoderDir1() { short result

Page 62

B-63 static BYTE parms[] = VTS_I2; InvokeHelper(0x74, DISPATCH_METHOD, VT_I2, (void*)&result, parms, channel); return result; } vo

Page 63

B-64 static BYTE parms[] = VTS_I2; InvokeHelper(0x79, DISPATCH_METHOD, VT_EMPTY, NULL, parms, Polarity); } void CWiRobotSDK::SetMotorPo

Page 64

B-65 { static BYTE parms[] = VTS_I2; InvokeHelper(0x7f, DISPATCH_METHOD, VT_EMPTY, NULL, parms, channel); } void CWiRobotSDK::ResumeDcM

Page 65

B-66 { short result; InvokeHelper(0x84, DISPATCH_METHOD, VT_I2, (void*)&result, NULL); return result; } short CWiRobotSDK::getSenID3() {

Page 66

B-67 short CWiRobotSDK::GetGPS04() { short result; InvokeHelper(0x8a, DISPATCH_METHOD, VT_I2, (void*)&result, NULL); return result; } shor

Page 67

B-5 CRDPDlg::CRDPDlg(CWnd* pParent /*=NULL*/) : CDialog(CRDPDlg::IDD, pParent) { //{{AFX_DATA_INIT(CRDPDlg) m_Port = 2000; m_Text = _T("

Page 68

B-68 } SUBPROGRAM SOCKET #include "stdafx.h" #include "Socket.h" /* ------------------------------------------------------

Page 69

B-69 s8_Name signed 8 Bit (char) s16_Name signed 16 Bit (SHORT, WCHAR) s32_Name signed 32 Bit (LONG, int) s64_Name signed 64 B

Page 70

B-70 return 0; // Winsock version 2.0 is available on ALL Windows operating systems // except Windows 95 which comes with Winsock 1.1 W

Page 71

B-71 DWORD TCP::cSocket::GetSocket(DWORD u32_Index, SOCKET* ph_Socket, DWORD* pu32_IP) { if (u32_Index >= mi_List.mu32_Count) return ERROR_I

Page 72

B-72 mi_List.Add(h_Socket, h_Event); return 0; } // Creates a Server socket // You must wait for FD_ACCEPT events before sending data // u32_Bi

Page 73

B-73 } // The server is not yet connected (wait for FD_ACCEPT!) mi_List.me_State = E_Server; return 0; } // Creates a Client socket // u32_

Page 74

B-74 mi_List.me_State = E_Client; pk_Data->u32_IP = u32_ServIP; return 0; } // Waits for incoming events on the port and processes them (u

Page 75

B-75 // The first event is used to escape from WaitForMultiplEvents in cLock::Request() mi_List.mh_Events[0] = mk_Lock.h_ExitEvent; // Wait un

Page 76

B-76 { if (k_Events.iErrorCode[FD_ACCEPT_BIT]) return k_Events.iErrorCode[FD_ACCEPT_BIT]; SOCKADDR_IN k_Addr; int s32_Len = size

Page 77

B-77 } *ph_Socket = pk_Data->h_Socket; *pu32_IP = pk_Data->u32_IP; // ------------------------------------------- if (k_Events.l

Page 78

B-6 DDX_Control(pDX, IDC_BUTTON_SERVICE, m_Service); DDX_Control(pDX, IDC_DRROBOTSDKCONTROLCTRL1, m_MOTSDK); DDX_Control(pDX, IDC_IPADD, m_IPAd

Page 79

B-78 if (u32_Err && u32_Err != WSAEWOULDBLOCK) { mi_List.Remove(u32_Index); // remove socket with Read error

Page 80

B-79 } } // Do not return 0 here (multiple events may be set!!) } // ------------------------------------------- if (k_Events.l

Page 81

B-80 for (DWORD C=0; C<u32_Count; C++) { (*pu32_Index)++; if (*pu32_Index >= u32_Count) *pu32_Index = 0; // Check if th

Page 82

B-81 // Send the remaining data and adjust the pu32_Pos pointer. // If the data was sent only partially (WSAEWOULDBLOCK) this function must be called

Page 83

B-82 return u32_Err; if (!(mi_List.me_State & E_Connected)) return WSAENOTCONN; // Socket is not connected int s32_Index = mi_List.

Page 84

B-83 { DWORD u32_Err = Initialize(); if (u32_Err) return u32_Err; char s8_Host[500]; if (gethostname(s8_Host, sizeof(s8_Host)) == SOCKET

Page 85

B-84 - uses a socket at Index=0 which only waits for incomming connection requests. (always: mu32_IP[0]==0) - The socket at Index=0

Page 86

B-85 return &mk_Data[mu32_Count++]; } BOOL TCP::cSocket::cList::Remove(DWORD u32_Index) { if (u32_Index >= mu32_Count) return FALSE;

Page 87

B-86 for (DWORD i=0; i<mu32_Count; i++) { if (mk_Data[i].h_Socket == h_Socket) return i; } return -1; } /**********************

Page 88

B-87 CloseHandle(h_ExitEvent); CloseHandle(h_Mutex); } DWORD TCP::cSocket::kLock::Init() { if (!h_LoopEvent) h_LoopEvent = CreateEvent(0, TRUE

Page 89

B-7 ON_BN_CLICKED(IDC_BTN_RIGHT, OnBtnRight) ON_BN_CLICKED(IDC_BTN_LEFT, OnBtnLeft) ON_BN_CLICKED(IDC_BUTTON_BKiS, OnBUTTONBKiS) ON_BN_CLICKE

Page 90

B-88 // THIRD: Wait until ProcessEvents() has exited (only if multithreading) if (WaitForSingleObject(pk_Lock->h_Mutex, INFINITE) == WAIT_FAIL

Page 91

B-89 SUBPROGRAM DIB // Dib.cpp: implementation of the CDib class. // ////////////////////////////////////////////////////////////////////// #incl

Page 92

B-90 UINT CDib::GetNumPaletteColors() { // Calculate # entries in color table: // if biClrUsed is not specified, then use: // (2,16,256) for (1,4,8)-

Page 93

B-91 BOOL CDib::Load(CFile &file) { BITMAPFILEHEADER hdr; DWORD len = file.Read(&hdr, sizeof(hdr)); if ((len!=sizeof(hdr)) || (hdr.bfType!=

Page 94

B-92 // This is as easy as it gets in Windows. return DrawDibDraw(m_hdd, dc, rcDst->left, rcDst->top, rcDst->Width(), rcDst->Heigh

Page 95

B-93 { hLogPal = GlobalAlloc (GHND, sizeof (LOGPALETTE) + sizeof (PALETTEENTRY) * nColors); lpPal = (LPLOGPALETTE) GlobalLock (hLogPal); lpPal->pa

Page 96 - MYDIBVIEWER

B-94 return bRet; } SUBPROGRAM MYDIBVIEWER // MyDIBViewerDlg.cpp : implementation file // #include "stdafx.h" #include "MyDIBVi

Page 97

B-95 } BEGIN_MESSAGE_MAP(CMyDIBViewerDlg, CDialog) //{{AFX_MSG_MAP(CMyDIBViewerDlg) ON_WM_PAINT() ON_WM_QUERYDRAGICON() //}}AFX_MSG_MAP END_

Page 98

B-96 int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); in

Page 99

B-97 { pix = dc.GetPixel(x,y); red += GetRValue(pix); green += GetGValue(pix); blue += GetBValue(pix); } } if((

Commentaires sur ces manuels

Pas de commentaire