Beruflich Dokumente
Kultur Dokumente
Chapter 1: Introduction
Mobile Robots are a class of unmanned ground vehicles that can
be controlled by a human operator from a distance over some form of a
communication link. Such robots have plethora of applications ranging
from inspection and maintenance in industry to surveillance and
reconnaissance in law enforcement. In all aforementioned cases, these
vehicles provide access to places that are unsafe or impossible for
humans to reach. The need for such robots is varied and specific, so
fulfilling them means custom building systems or buying and customizing
existing systems which are both expensive options. The main aspect of
our project is software for controlling a robot over a wireless network
and retrieving video and other streaming data like GPS over the same
network.
The ministry of defense, research institutions, and any party that has an
existing hardware platform but needs some form of customization in
software.
1
Customized Mobile Robot System
This Figure shows the description of our project which used in the robot
End windows CE 6.0 platform builder operating system and the hard
ware is ebox 4300 and there are peripherals like iRobot, GPS and
Webcam. On The other hand the control computer used Linux operating
System and the hardware is Personal computer and controlled the robot
by joystick.
2
Customized Mobile Robot System
In this figure we explain in detail what happen inside the system .Since
each hardware part has special API to make it work in the ebox. On the
other hand, in the PC has the graphical user interface to show what the
robot do and to link between them we used communication library with
TCP/UDP protocol.
Project Description
Software Requirements
OS Windows CE compatible
Hardware Requirements
Communication Specifications
Network layer IP
Control Specification
The table above shows the initial specifications for the project. Real time
video, sensor feedback, and real time control of vehicle mobility which
are vital features necessary to make mobile robots feasible were all
achieved. Any delay between video capture on the robot and the time
when it is displayed, is unnoticeable. There is a small delay present from
3
Customized Mobile Robot System
when the user issues a command to move and when the robot responds,
this was not a problem due to the relatively slow speed of the robot.
Furthermore, the quality of the data sent back including video frames,
GPS and sensors, were close to, when not the maximum allowed by the
sensor. More specifically, the frames were of better resolution at
320*240 pixels, than originally specified. Although the original
specification of 10 frames per second wasn’t met in the demonstration,
the demonstrated 5 frames per second was sufficient to safely control
the robot and furthermore, the frame rate can be increased with a
minor change in the video streaming software. Similarly the sample rates
for the sensor and GPS receiver are also 5 per second and are sufficient
and can still be changed with minor changes in the software.
4
Customized Mobile Robot System
Overall, with the exceptions noted, all the specifications for the software
were satisfied. The test platform for testing the software framework was
also built. The original specifications for it are shown in the table below.
Peripherals
Mobility Requirements
Presented in the table below are the actual hardware specifications for
the test platform.
5
Customized Mobile Robot System
Motivation
6
Customized Mobile Robot System
their needs. We are now able to provide this service because of the
modular and layered nature of our systems and protocols that we have
successfully demonstrated in our project. The main contribution of this
project is the synergy and integration between simple software and
hardware modules to perform complex and tedious tasks. The market
segment of the proposed solution is larger due to its flexibility and
modularity. Henceforth, greater sales with lower marketing costs are
expected.
Thesis Contributions
The project has demonstrated a set of basic principles to enable rapid
development of robotic systems: scalability, abstraction, real-time, and
modularity.
Scalability means providing support for the integration of new software
and hardware into the system. Scalability, therefore, allows older
designs to be modified for newer applications with reduced
development time.
Abstraction allows software development independent of hardware or
the underlying system. This approach allows for reduced development
time, as less time has to be spent on researching the underlying
hardware and system.
Real-time principle is the selection of an appropriate real-time operating
system such as Windows CE. Such operating systems also provide many
services and abstractions that will help reduce development time.
7
Customized Mobile Robot System
Unlike RF and fiber used by conventional TGVs like MATILDA, the use of
widely deployed packet switched services like GPRS can allow the use of
existing infrastructure and control over longer distances.
The prototype features includes the product features listed above and
the features listed below.
8
Customized Mobile Robot System
Thesis Outlines
This thesis consists of 3 parts in 7 Chapters; the current chapter is the
first one. Part 1: “The Robot End” consists of two chapters. Chapter one
describes the robot hardware (eBox & iRobot). Chapter 2 illustrates the
robot embedded software and description of creating an OS image by
Windows CE 6.0 Platform Builder and the four processes handled by the
eBox.
Part 2 introduces “Computer End” software that run on the PC and the
four processes handled by the PC are demonstrated at chapter 4.
9
Customized Mobile Robot System
10
Customized Mobile Robot System
Shown in figure (2.2) the top level system diagram. All hardware
attached to the iRobot Create which is the system’s main platform that
carries all parts. The REHI “Robot E-Box Hardware Interface” is the
intermediate linking between the e-Box and the iRobot Create because
of reasons discussed. Peripheral devices like webcam and the Phidgets
board with their peripherals are connected to the e-Box through
standard USB. Remote controlling computer is connected to the system
through Wi-Fi networking by the included Wi-Fi card in the e-Box.
11
Customized Mobile Robot System
12
Customized Mobile Robot System
Like the Create Robot, the serial interface on the GPS receiver is a TTL
Serial interface and so another MAX232 chip is necessary to interface
the GPS receiver and the eBox. Furthermore the GPS receiver is still
powered over the USB cable.
DB9 RS232 Serial ports were used to access serial devices. Because
both of the devices had TTL serial interfaces, MAX232 chips had to be
used to convert between the two levels. Standard USB was also used to
access the Phidgets board and webcam as well as to power the GPS
receiver.
13
Customized Mobile Robot System
14
Customized Mobile Robot System
15
Customized Mobile Robot System
The REHI circuit is the link between the irobot and the ebox and it has
two component max232 to convert between two levels (Parallel / Serial)
and the power regulator (PTN 78020W).
16
Customized Mobile Robot System
3.1.1.1 Introduction
17
Customized Mobile Robot System
18
Customized Mobile Robot System
Visual Studio
CodeGear Delphi Prism, which runs in Visual Studio, also supports the
.NET Compact Framework and thus can be used to develop mobile
applications. It employs the Oxygene compiler created by RemObjects,
which targets the .NET, .NET Compact Framework and Mono. Its
command-line compiler is available free of charge.
Platform Builder
This programming tool is used for building the platform (BSP + Kernel),
device drivers (shared source or custom made) and also the application.
This is a one step environment to get the system up and running. One
can also use Platform Builder to export an SDK (software development
kit) for the target microprocessor (SuperH, X86, MIPS, ARM etc.) to be
used with another associated tool set named below.
19
Customized Mobile Robot System
Features
20
Customized Mobile Robot System
21
Customized Mobile Robot System
The windows CE OS image that would run on the e-Box, first had to be
configured before building. Without going into too much detail, these
are some of the configurations used in Platform Builder:
Finally we modified the default registry to use Software FIFO with ISR for
both serial ports to allow for Fast Serial Port incoming data handling.
There are currently 4 independent processes that run at the robot end.
One of these processes, “ControlTheRobot” handles serial
communication with the robot and also acts as a server to the remote
controller, while the rest of the processes each handle a different input
peripheral like sonar, GPS and video and also act as the respective
servers for the remote controller. The use of separate processes for
independent functionalities has a number of advantages. Mainly it
reduces the complexity of the overall design, exploiting Windows CE’s
multiprocessing capability. Adding additional sensors or removing them
is a matter of just adding or removing these independent server
applications.
The main purpose of the libraries is to abstract the hardware and details
of the underlying system. These libraries also provide modularity and
22
Customized Mobile Robot System
Because the applications are written in C++, the design, especially that of
the “ControlTheRobot” application, takes advantage of the Object
Oriented nature of the language. More specifically inheritance and
abstract classes are used to enable the above described adaptability.
3.5.1 Conclusion
Real Time Embedded Systems are used in many electronic devices and
the real-time response requirements are best met by Windows CE
Operating System.
Application development is made simple by CE, and its optimized
features make it an ideal OS for embedded systems.
Our senior design project will require a real-time embedded system that
would perform the specific task of controlling a robot's sensors and
movement, and Windows CE would the ideal OS for the application. This
embedded system will communicate the computer end through a
wireless network.
Description
23
Customized Mobile Robot System
24
Customized Mobile Robot System
25
Customized Mobile Robot System
Abstract command
EC_Command.cpp
Table 3.1: List of code files used for the ControlTheRobot process
ControlTheRobot - UML
ControlTheRobot::BatteryCapacitySensorCmd
+BatteryCapacitySensorCmd()
+~BatteryCapacitySensorCmd()
+Execute(in paramLength : unsigned int, in params : char*)
ControlTheRobot::BatteryChargeSensorCmd
+BatteryChargeSensorCmd()
+~BatteryChargeSensorCmd()
+Execute(in paramLength : unsigned int, in params : char*)
ControlTheRobot::BatteryTemperatureSensorCmd
+BatteryTemperatureSensorCmd()
+~BatteryTemperatureSensorCmd()
+Execute(in paramLength : unsigned int, in params : char*)
ControlTheRobot::Buffer
-m_pBuffer : char *
-m_CommandID : long
-m_CommandParameters : char *
-m_size : unsigned int
+Buffer(in size : unsigned int, in Buffer : char*)
+~Buffer()
+GetCommandID() : long
+GetSize() : unsigned int
+CopyParamsTo(in buffer : char*)
-Buffer()
26
Customized Mobile Robot System
ControlTheRobot::CAbstractCommandFactory
+CAbstractCommandFactory()
+~CAbstractCommandFactory()
+GetCommand(in ID : CommandID) : EC_AbstractCommand *
#Clear()
ControlTheRobot::CCommandExecuter
-m_pCommandFactory : CAbstractCommandFactory *
+CCommandExecuter(in commandFactory : CAbstractCommandFactory*)
+~CCommandExecuter()
+Execute(in ID : long, in paramSize : unsigned int, in parameters : char*)
ControlTheRobot::CConnection
-m_Socket : SOCKET
-m_Address : sockaddr_in
-m_RemoteControllerSocket : SOCKET
-m_RemoteControllerAddress : sockaddr_in
+CConnection()
+~CConnection()
+InitChannel()
+CloseChannel()
+NextMessageBuffer() : Buffer *
ControlTheRobot::CConnectionException
+CConnectionException()
+CConnectionException(in msg : const char*)
+setMessage(in msg : const char*)
ControlTheRobot::CConnectionManager
+m_RemoteControllerIP : CIPAddress
+CConnectionManager()
+~CConnectionManager()
+QueryControllerAddress() : CIPAddress
ControlTheRobot::CConnectionSocket
-m_socket : SOCKET
-m_SocketAddress : sockaddr_in
-m_IPAddress : in_addr
+CConnectionSocket()
+~CConnectionSocket()
27
Customized Mobile Robot System
ControlTheRobot::CEyeCreateRobot
-m_bInitialized : bool
-m_Connection : CConnection
-m_CommandFactory : CIRobotCommandFactory
+CEyeCreateRobot()
+~CEyeCreateRobot()
+Start() : bool
+Shutdown()
+ExecuteAnyPendingCommand()
+IsInitialized() : bool
-ExecuteCommand(in ID : long)
-Forward()
-Backward()
-TurnLeft(in angle : unsigned short)
-TurnRight(in angle : unsigned short)
-Stop()
-CloseConnection()
ControlTheRobot::CIPAddress
+CIPAddress()
+~CIPAddress()
ControlTheRobot::CIRobotCommandFactory
-m_CommandMap : map
+GetCommand(in ID : CommandID) : EC_AbstractCommand *
#Clear()
+CIRobotCommandFactory()
+~CIRobotCommandFactory()
ControlTheRobot::CMotionCommand
+CMotionCommand()
+~CMotionCommand()
ControlTheRobot::ControlCmd
+ControlCmd()
+~ControlCmd()
+Execute(in paramLength : unsigned int, in params : char*)
ControlTheRobot::CoverCmd
+CoverCmd()
+~CoverCmd()
+Execute(in paramLength : unsigned int, in params : char*)
ControlTheRobot::CurrentSensorCmd
+CurrentSensorCmd()
+~CurrentSensorCmd()
+Execute(in paramLength : unsigned int, in params : char*)
28
Customized Mobile Robot System
ControlTheRobot::DriveCmd
+DriveCmd()
+~DriveCmd()
+Execute(in paramLength : unsigned int, in params : char*)
ControlTheRobot::DriveDirectCmd
+DriveDirectCmd()
+~DriveDirectCmd()
+Execute(in paramLength : unsigned int, in params : char*)
ControlTheRobot::EC_AbstractCommand
#m_Parameters : char *
#m_ParamBufferLength : unsigned int
+EC_AbstractCommand()
+~EC_AbstractCommand()
+Execute(in paramLength : unsigned int, in params : char*)
+SetParameters(in paramLength : unsigned int, in params : char*)
ControlTheRobot::EnterFullModeCmd
+EnterFullModeCmd()
+~EnterFullModeCmd()
+Execute(in paramLength : unsigned int, in params : char*)
ControlTheRobot::EnterSafeModeCmd
+EnterSafeModeCmd()
+~EnterSafeModeCmd()
+Execute(in paramLength : unsigned int, in params : char*)
ControlTheRobot::LowSideDriversCmd
+LowSideDriversCmd()
+~LowSideDriversCmd()
+Execute(in paramLength : unsigned int, in params : char*)
ControlTheRobot::SendIRCmd
+SendIRCmd()
+~SendIRCmd()
+Execute(in paramLength : unsigned int, in params : char*)
ControlTheRobot::SensorsCmd
+SensorsCmd()
+~SensorsCmd()
+Execute(in paramLength : unsigned int, in params : char*)
29
Customized Mobile Robot System
ControlTheRobot::StartCmd
+StartCmd()
+~StartCmd()
+Execute(in paramLength : unsigned int, in params : char*)
ControlTheRobot::StopCmd
+StopCmd()
+~StopCmd()
+Execute(in paramLength : unsigned int, in params : char*)
ControlTheRobot::ThreadBase
#m_ThreadCtx : ThreadContext
#m_pThreadFunc : LPTHREAD_START_ROUTINE
+ThreadBase()
+~ThreadBase()
+Start(in arg : void* = 0) : DWORD
+Stop(in bForceKill : bool = false) : DWORD
+GetExitCode() : DWORD
#EntryPoint(in pArg : LPVOID) : DWORD
#Run(in arg : LPVOID) : DWORD
#BeforeRun()
#AfterRun()
#BeforeStop()
#AfterStop()
«struct»ControlTheRobot::ThreadContext
+m_hThread : HANDLE
+m_dwTID : DWORD
+m_pUserData : LPVOID
+m_pParent : LPVOID
+m_dwExitCode : DWORD
+ThreadContext()
30
Customized Mobile Robot System
«utility»ControlTheRobot::Utility
+g_hInst : HINSTANCE
+g_hWndCommandBar : HWND
+theRobot : CEyeCreateRobot
+gBuffer : Buffer * = NULL
+hSerialPort : HANDLE
+WinMain(in hInstance : HINSTANCE, in hPrevInstance : HINSTANCE, in lpCmdLine : LPWSTR, in nShowCmd : int) : int
+MyRegisterClass(in hInstance : HINSTANCE, in szWindowClass : LPTSTR) : ATOM
+InitInstance(in hInstance : HINSTANCE, in nCmdShow : int) : BOOL
+WndProc(in hWnd : HWND, in message : UINT, in wParam : WPARAM, in lParam : LPARAM) : LRESULT
+About(in hDlg : HWND, in message : UINT, in wParam : WPARAM, in lParam : LPARAM) : INT_PTR
+TheTimerProc(in hwnd : HWND, in message : UINT, in idTimer : UINT_PTR, in dwTime : DWORD)
+MyRegisterClass(in hInstance : HINSTANCE, in szWindowClass : LPTSTR) : ATOM
+InitInstance(in hInstance : HINSTANCE, in nCmdShow : int) : BOOL
+WndProc(in hWnd : HWND, in message : UINT, in wParam : WPARAM, in lParam : LPARAM) : LRESULT
+About(in hDlg : HWND, in message : UINT, in wParam : WPARAM, in lParam : LPARAM) : INT_PTR
+TheTimerProc(in hwnd : HWND, in message : UINT, in idTimer : UINT_PTR, in dwTime : DWORD)
+Initialize() : bool
+Shutdown()
+StartRobot() : bool
+SetBaud(in baud : BaudRate)
+Control()
+EnterSafeMode()
+EnterFullMode()
+Spot()
+Cover()
+Demo(in demo : DemoCode)
+Drive(in velocity : unsigned short, in radius : unsigned short)
+Stop()
+LEDs(in whichLEDs : Byte, in color : Byte, in intensity : Byte)
+PlaySong(in songNumber : Byte)
+Sensors(in packetID : SensorPacketID)
+CoverAndDock()
+LowSideDrivers(in control : Byte)
+PWM_LowSideDrivers(in lsd0dutycycle : Byte, in lsd1dutycycle : Byte, in lsd2dutycycle : Byte)
+DriveDirect(in rightwheelvelocity : short, in leftwheelvelocity : short)
+DigitalOutputs()
+Stream()
+QueryList()
+PauseResumeStream()
+SendIR(in value : Byte)
+Script()
+PlayScript()
+ShowScript()
+WaitTime(in time : Byte)
+WaitDistance(in distance : short)
+WaitAngle(in angle : short)
+WaitEvent(in eventCode : EventCode)
+BumpsAndWheelDropsSensor(in value : Byte &)
+WallSensor(in value : Byte &)
+CliffLeftSensor(in value : Byte &)
+CliffRightSensor(in value : Byte &)
+CliffFrontLeftSensor(in value : Byte &)
+CliffFromRightSensor(in value : Byte &)
+VirtualWallSensor(in value : Byte &)
+LowSideDriverAndWheelOvercurrentsSensor(in value : Byte &)
+InfraRedSensor(in value : Byte &)
+ButtonsSensor(in value : Byte &)
+DistanceSensor(in value : short &)
+AngleSensor(in value : short &)
+ChargingStateSensor(in state : Byte &)
+VoltageSensor(in value : short &)
+CurrentSensor(in value : short &)
+BatteryTemperatureSensor(in value : Byte &)
+BatteryChargeSensor(in value : short &)
+BatteryCapacitySensor(in value : short &)
+WallSignalSensor(in value : short &)
+CliffLeftSignalSensor(in value : short &)
+CliffFrontLeftSignalSensor(in value : short &)
+CliffFrontRightSignalSensor(in value : short &)
+CliffRightSignalSensor(in value : short &)
+GetUserDigitalInputs(in userInput : Byte &)
+GetUserAnalogInputs(in userInput : short &)
+GetChargingSourcesAvailable(in sources : Byte &)
+GetOIMode(in mode : Byte &)
+GetSongNumber(in songNumber : Byte &)
+GetSongPlaying(in playingSong : Byte &)
+GetNumberOfStreamPackets(in number : Byte &)
+GetRequestedVelocity(in velocity : short &)
+GetRequestedRadius(in radius : short &)
+GetRequestedRightVelocity(in velocity : short &)
+GetRequestedLeftVelocity(in velocity : short &)
+Forward(in velocity : short)
+Backward(in velocity : short)
+InitializeSongs()
+getAddrByName(in name : char*) : in_addr
+initServer(in port : int, in servSock : SOCKET*, in ServAddr : sockaddr_in*) : int
+connectToServer(in pSock : SOCKET*, in port : unsigned short, in passedIPAddr : in_addr) : int
+waitForClient(in servSock : SOCKET, in clntSock : SOCKET*, in ClntAddr : sockaddr_in*) : int
+sendByte(in Sendable : char, in clntSock : int) : int
+sendAddr(in Sendable[] : char, in clntSock : int) : int
+getByte(in sock : SOCKET) : char
+getAddr(in addr : in_addr*, in sock : SOCKET) : int
+registerServer() : int
+getRegServAddr(in servAddr : in_addr*, in blocking : char) : int
+receiveBPP(in ppbuffer : char**, in sock : SOCKET) : int
+transmitBPP(in size : int, in message : char*, in sock : SOCKET) : int
31
Customized Mobile Robot System
ControlTheRobot::VoltageSensorCmd
+VoltageSensorCmd()
+~VoltageSensorCmd()
+Execute(in paramLength : unsigned int, in params : char*)
ControlTheRobot::WaitAngleCmd
+WaitAngleCmd()
+~WaitAngleCmd()
+Execute(in paramLength : unsigned int, in params : char*)
ControlTheRobot::WaitDistanceCmd
+WaitDistanceCmd()
+~WaitDistanceCmd()
+Execute(in paramLength : unsigned int, in params : char*)
ControlTheRobot::WaitEventCmd
+WaitEventCmd()
+~WaitEventCmd()
+Execute(in paramLength : unsigned int, in params : char*)
ControlTheRobot::WaitTimeCmd
+WaitTimeCmd()
+~WaitTimeCmd()
+Execute(in paramLength : unsigned int, in params : char*)
ControlTheRobot::WallSignalSensorCmd
+WallSignalSensorCmd()
+~WallSignalSensorCmd()
+Execute(in paramLength : unsigned int, in params : char*)
32
Customized Mobile Robot System
Description
Table 2.2: List of code files used for the eBox_GPS process
«utility»Utility
+g_hInst : HINSTANCE
+g_hWndCommandBar : HWND
+WinMain(in hInstance : HINSTANCE, in hPrevInstance : HINSTANCE, in lpCmdLine : LPWSTR, in nShowCmd : int) : int
+MyRegisterClass(in hInstance : HINSTANCE, in szWindowClass : LPTSTR) : ATOM
+InitInstance(in hInstance : HINSTANCE, in nCmdShow : int) : BOOL
+WndProc(in hWnd : HWND, in message : UINT, in wParam : WPARAM, in lParam : LPARAM) : LRESULT
+About(in hDlg : HWND, in message : UINT, in wParam : WPARAM, in lParam : LPARAM) : INT_PTR
33
Customized Mobile Robot System
3.5.2.3 VideoSender
Table 2.3: List of code files used for the VideoSender process
3.5.2.4 Sensors
Table 2.4: List of code files used for the Sensors process
34
Customized Mobile Robot System
The QT library was used in the development of the GUI. Unlike the multi
processed nature of the framework at the robot end, this is not feasible
at the control interface end, since both the video and the sensor data
will have to be presented in the same GUI, which must also allow the
user to give commands to control the robot. Modularity is still permitted
however, by utilizing classes and encapsulation as well as independent
panes on a main window.
The top four views display data sent back by the robot. The top left is the
video sent back by the webcam at approximately 5 frames per second.
The top right and center left panes display latitude/longitude and
altitude data respectively. Lastly, the center right panel plots the sensor
data. More detailed GPS data is presented on the bottom left and center
including heading. Finally, the arrows on the bottom right allow the
robot to be controlled.
35
Customized Mobile Robot System
Other than the main window, which is the main parent class, the panels
displaying the video, latitude/longitude and sensor data are child classes
called view classes that inherit from the QFrame class. The view classes
mentioned are in turn parent classes of thread classes. These thread
classes spawn threads responsible for connecting to the correct data
server at the robot end, receiving data from those servers, and passing
the data up the class hierarchy to the appropriate class to be interpreted
and displayed represents the hierarchical structure of the more
important classes in the program.
36
Customized Mobile Robot System
events occur, it passes the information about which button was clicked
to the CreateRobot class, which in turn transmits commands to the
robot. When the user clicks on disconnect command in the menu, the
“Main Window” invoke the necessary methods in the view classes,
which in turn raise specific flags. When these flags are raised, the
threads that poll the flag close the connection to the servers and
terminate.
The run methods executed by the data receiving threads in the Control
Interface have a general structure that is a complement to the structure
of the data servers, discussed in shows the flow chart representing its
structure.
As shown in the figure, once connected, the thread receives data from
the server, updates the relevant display and checks the “Stop requested”
flag. If the flag is set, the connection is closed and the thread is stopped.
Otherwise, it continues to try to receive more data from the server.
37
Customized Mobile Robot System
The code and associated documentation for both the robot end servers and
the Control Interface, is available on the included CD.
Technical Information
RemoteController Application (ANSI C++)
Development tool: Qt SDK “Nokia Corporation”
License: GNU – Open Source
Table 4.1: List of code files used for the RemoteController application
38
Customized Mobile Robot System
4.5.1 main.cpp
Description
QApplication
The QApplication class manages the GUI application's control flow and
main settings.
QApplication contains the main event loop, where all events from the
window system and other sources are processed and dispatched. It also
handles the application's initialization and finalization, and provides
session management. In addition, it handles most system-wide and
application-wide settings.
Code Block
#include <QApplication>
QPushButton
Code Block
#include <QPushButton>
39
Customized Mobile Robot System
4.5 .2 MainWindow.cpp
Description
UML
MainWindow
-m_DataUpdateTimer : QTimer *
-m_ForwardTimer : QTimer *
-m_BackwardTimer : QTimer *
-m_RightTurnTimer : QTimer *
-m_LeftTurnTimer : QTimer *
-compass : QwtCompassNoMouse *
-m_connectionDialog : ConnectionDialog
-m_availableRobots : QStringList
-theRobot : CreateRobot
+MainWindow(in parent : QWidget*)
+~MainWindow()
+displayError(in error : int, in strError : const QString &)
+on_actionOpen_Connection_triggered()
+on_actionClose_Connection_triggered()
+on_actionList_Robots_triggered()
+on_actionExit_triggered()
+on_RightButton_clicked()
+on_ForwardButton_clicked()
+on_LeftButton_clicked()
+on_ReverseButton_clicked()
+on_RightButton_pressed()
+on_RightButton_released()
+on_ForwardButton_pressed()
+on_ForwardButton_released()
+on_LeftButton_pressed()
+on_LeftButton_released()
+on_ReverseButton_pressed()
+on_ReverseButton_released()
-MoveBackward()
-TurnRight()
-TurnLeft()
-RemindDataThreads()
-StopMotion()
-QueryRelayForAvailableRobots()
-CreateCompassWidget()
QDebug
40
Customized Mobile Robot System
Code Block
#include <QDebug>
QTimer
Code Block
#include <QTimer>
QLayout
Code Block
#include <qlayout.h>
QWidget
The QWidget class is the base class of all user interface objects.
The widget is the atom of the user interface: it receives mouse, keyboard
and other events from the window system, and paints a representation
of itself on the screen. Every widget is rectangular, and they are sorted
41
Customized Mobile Robot System
Code Block
#include <QWidget>
QMainWindow
Code Block
QMainWindow
QGirdLayout
QGridLayout takes the space made available to it (by its parent layout or
by the parentWidget()), divides it up into rows and columns, and puts
each widget it manages into the correct cell.
Code Block
QGridLayout
QPalette
The QPalette class contains color groups for each widget state.
Code Block
QPalette
42
Customized Mobile Robot System
QMap
Code Block
QMap
QString
Code Block
QString
QColor
The QColor class provides colors based on RGB, HSV or CMYK values.
Code Block
QColor
43
Customized Mobile Robot System
QDialog
Code Block
QDialog
4.5.3 MainWindow.ui
Description
This is the Main Window GUI that provides 4 grids for each video images,
GPS data, sensor data and navigation options.
44
Customized Mobile Robot System
UML
Ui_MainWindow
+actionOpen_Connection : QAction *
+actionClose_Connection : QAction *
+actionList_Robots : QAction *
+actionExit : QAction *
+centralwidget : QWidget *
+widget_2 : QWidget *
+VideoFrame : ImageView *
+GPSFrame : GPSView *
+PlotFrame : PlotView *
+SensorsFrame : SensorsView *
+widget : QWidget *
+RightButton : QPushButton *
+ForwardButton : QPushButton *
+LeftButton : QPushButton *
+ReverseButton : QPushButton *
+LongitudeEdit : QLCDNumber *
+LatitudeEdit : QLCDNumber *
+AltitudeEdit : QLCDNumber *
+label : QLabel *
+label_2 : QLabel *
+label_3 : QLabel *
+CompassHolder : QWidget *
+label_4 : QLabel *
+groupBox : QGroupBox *
+NoGPSFixRB : QRadioButton *
+GPSFixRB : QRadioButton *
+DGPSFixRB : QRadioButton *
+label_5 : QLabel *
+label_6 : QLabel *
+label_7 : QLabel *
+GPSTimeLCD : QLCDNumber *
+menubar : QMenuBar *
+menuConnection : QMenu *
+statusbar : QStatusBar *
+setupUi(in MainWindow : QMainWindow*)
+retranslateUi(in MainWindow : QMainWindow*)
45
Customized Mobile Robot System
Preview
4.5.4 ConnectionDialog.ui
Description
46
Customized Mobile Robot System
UML
Ui_ConnectionDialog
+buttonBox : QDialogButtonBox *
+availableRobotsCB : QComboBox *
+robotIPAddressEdit : QLineEdit *
+robotsListRB : QRadioButton *
+provideIPAddressRB : QRadioButton *
+setupUi(in ConnectionDialog : QDialog*)
+retranslateUi(in ConnectionDialog : QDialog*)
4.5.5 EyeCreateRobot.cpp
Description
UML
CreateRobot
-socket : QTcpSocket
-host : QString
-port : quint16
-connected : bool
+CreateRobot(in parent : QObject* = NULL)
+~CreateRobot()
+ConnectTo(in host : QString, in port : quint16) : bool
+disconnect()
+Forward()
+Backward()
+Left()
+Right()
+Stop()
-TransmitMessage(in length : unsigned int, in message : char*)
QObject
Code Block
47
Customized Mobile Robot System
#include <QObject>
4.5.6 plotview.ui
Description
PlotView Class allows adding plots for sensor and GPS data in the main
window.
UML
Ui_PlotViewClass
4.5.7 plotview.cpp
Description
UML
48
Customized Mobile Robot System
PlotView
-crv : QwtPlotCurve
-index : int
-maxData : int
-minData : int
-xval[120] : double
-yval[120] : double
-xMap : QwtScaleMap
-yMap : QwtScaleMap
+PlotView(in parent : QWidget* = 0)
+~PlotView()
+newData(in val : float)
+newData(in data : char*, in size : int)
+shiftDown(in rect : QRect &, in offset : int)
+drawContents(in p : QPainter*)
+paintEvent(in Parameter1 : QPaintEvent*)
QFrame
The QFrame class is the base class of widgets that can have a frame.
Code Block
QFrame
QRect
The QRect class defines a rectangle in the plane using integer precision.
Code Block
QRect
QPaintEvent
49
Customized Mobile Robot System
Paint events are sent to widgets that need to update themselves, for
instance when part of a widget is exposed because a covering widget
was moved.
Code Block
QPaintEvent
QColor
The QColor class provides colors based on RGB, HSV or CMYK values.
Code Block
QColor
QBrush
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Code Block
QBrush
QPainter
Code Block
50
Customized Mobile Robot System
QPainter
QPaintEngine
Code Block
QPaintEngine
4.5.8 VideoFrameThread.cpp
Description
The thread that handles opening the socket and waiting for the video
frame
UML
VideoFrameThread
-m_parent : ImageView *
-m_FrameData : char *
-hostName : QString
-port : quint16
-mutex : QMutex
-cond : QWaitCondition
-stopRequested : bool
-connected : bool
+VideoFrameThread(in parent : ImageView* = 0)
+~VideoFrameThread()
+setRobotAddress(in address : const QString &)
+stop()
+quitRunning()
+isConnected() : bool
+requestNewFrame()
+run()
+error(in socketError : int, in message : const QString &)
+connectedToRobot()
51
Customized Mobile Robot System
QThread
Code Block
#include <QThread>
QString
The QString class provides a Unicode character string.
Code Block
#include <QString>
QTcpSocket
The QTcpSocket class provides a TCP socket.
Code Block
#include <QTcpSocket>
QDataStream
Code Block
52
Customized Mobile Robot System
#include <QDataStream>
QMutexLocker
Code Block
#include <QMutexLocker>
4.5.9 ImageView.cpp
Description
UML
ImageView
-graphicsView : QGraphicsView *
-label : QLabel *
-imageLabel : QLabel *
-m_pixmap : QPixmap
-m_Image : QImage
-m_byteArray : QByteArray
-n_Name : QString
-m_imageFileName : QString
-m_FrameData : char *
-m_thread : VideoFrameThread
+ImageView(in parent : QWidget* = 0)
+connectTo(in address : const QString &)
+disconnect()
+newFrameData(in frameData : const unsigned char*, in size : int)
+SocketErrorHandler(in socketError : int, in message : const QString &)
+ConnectionEstablished()
QtGUI
53
Customized Mobile Robot System
Code Block
#include <QtGui>
QString
The QString class provides a Unicode character string.
Code Block
#include <QString>
QWidget
The QWidget class is the base class of all user interface objects.
Code Block
#include <QWidget>
QFrame
The QFrame class is the base class of widgets that can have a frame.
Code Block
#include <QFrame>
QLabel
The QLabel widget provides a text or image display
Code Block
#include <QLabel>
54
Customized Mobile Robot System
QPallette
The QPalette class contains color groups for each widget state
Code Block
#include <QPalette>
QSizePolicy
The QSizePolicy class is layouts attribute describing horizontal and
vertical resizing policy.
Code Block
#include <QSizePolicy>
QGraphicsView
The QGraphicsView class provides a widget for displaying the contents of
a QGraphicsScene.
Code Block
#include <QGraphicsView>
QPainter
The QPainter class performs low-level painting on widgets and other
paint devices.
Code Block
#include <QPainter>
QGridLayout
The QGridLayout class lays out widgets in a grid
Code Block
#include <QGridLayout>
55
Customized Mobile Robot System
QAbstractSocket
The QAbstractSocket class provides the base functionality common to all
socket types.
Code Block
#include <QAbsrtactSocket>
QMessageBox
The QMessageBox class provides a modal dialog for informing the user
or for asking the user a question and receiving an answer.
Code Block
#include <QMessageBox>
QPixmap
The QPixmap class is an off-screen image representation that can be
used as a paint device.
Code Block
#include <QPixmap>
4.5.10 GPSSentences.cpp
Description
56
Customized Mobile Robot System
UML
GPSSentence
+m_sentencetext : QString
+valid : bool
+m_GPSPoint : GPS_Point
+time : QString
+validity : QString
+Latitude : QString
+NS : QString
+Longitude : QString
+EW : QString
+Altitude : QString
+units : QString
+fixQuality : QString
+numSatellites : QString
+HorizontalDilutionOfPrecision : QString
+speedOverGround : QString
+courseMadeGood : QString
+UTCDateOfFix : QString
+MagneticVariation : QString
+MV_EW : QString
+checksum : QString
+GPSSentence(in str : QString)
+~GPSSentence()
+setSentence(in str : const QString &)
+isValid() : bool
+getGPSPoint() : GPS_Point
-GPSSentence()
-extractInfo()
QStringList
Code Block
#include <QStringList>
QString
The QString class provides a Unicode character string.
Code Block
#include <QString>
57
Customized Mobile Robot System
4.5.11 GPSView.cpp
Description
UML
GPSView
-graphicsView : QGraphicsView *
-scene : QGraphicsScene *
-label : QLabel *
-zoomSlider : QSlider *
-m_theGPS_Path : GPS_Path
-boundingBox : QGraphicsRectItem *
-m_thread : GPSDataThread
-GPSInfo : GPSSentence
-m_parent : MainWindow *
+GPSView(in parent : QWidget* = 0)
+view() : QGraphicsView *
+newGPSData(in data : const char*, in size : quint32)
+connectTo(in address : const QString &)
+disconnect()
+setParent(in parent : MainWindow*)
+paintEvent(in event : QPaintEvent*)
-setResetButtonEnabled()
-setupMatrix()
-toggleAntialiasing()
-zoomIn()
-zoomOut()
-ConnectionEstablished()
-populateScene()
-clearScene()
QWidget
The QWidget class is the base class of all user interface objects.
Code Block
#include <QWidget>
QFrame
The QFrame class is the base class of widgets that can have a frame.
58
Customized Mobile Robot System
Code Block
#include <QFrame>
QLabel
The QLabel widget provides a text or image display
Code Block
#include <QLabel>
QGraphicsView
Code Block
#include <QGraphicsView>
QPainter
The QPainter class performs low-level painting on widgets and other
paint devices.
Code Block
#include <QPainter>
QFile
The QFile class provides an interface for reading from and writing to
files.
Code Block
59
Customized Mobile Robot System
#include <QFile>
QAbstractSocket
The QAbstractSocket class provides the base functionality common to all
socket types.
Code Block
#include <QAbsrtactSocket>
QMessageBox
The QMessageBox class provides a modal dialog for informing the user
or for asking the user a question and receiving an answer.
Code Block
#include <QMessageBox>
QPixmap
The QPixmap class is an off-screen image representation that can be
used as a paint device.
Code Block
#include <QPixmap>
4.5.12 GPSDataThread.cpp
Description
The thread that handles opening the socket and waiting for GPS data
60
Customized Mobile Robot System
UML
GPSDataThread
-m_parent : GPSView *
-hostName : QString
-port : quint16
-mutex : QMutex
-cond : QWaitCondition
-stopRequested : bool
-m_GPSData : char *
-connected : bool
+GPSDataThread(in parent : GPSView* = 0)
+~GPSDataThread()
+setRobotAddress(in address : const QString &)
+stop()
+isConnected() : bool
+startAcquiringGPSData(in hostName : const QString &, in port : quint16)
+run()
+quitRunning()
+wakeUpAndWork()
+error(in socketError : int, in message : const QString &)
QtNetwork
The QtNetwork module offers classes that allow you to write TCP/IP
clients and servers
Code Block
QT += network
#include <QtNetwork>
QFrame
The QFrame class is the base class of widgets that can have a frame.
Code Block
#include <QFrame>
QThread
61
Customized Mobile Robot System
Code Block
#include <QThread>
QMutexLocker
Code Block
#include <QMutexLocker>
QTcpSocket
Code Block
#include <QTcpSocket>
QDataStream
Code Block
62
Customized Mobile Robot System
#include <QDataStream>
4.5.13 ConnectionDialog.cpp
Description
Offers a dialog box to the user to choose a robot address from a list, or
to enter an IP address
UML
ConnectionDialog
-robotAddress : QString
-IPAddress : QHostAddress
+ConnectionDialog(in parent : QWidget*)
+~ConnectionDialog()
+populateWithRobotsAddresses(in list : const QStringList &)
+currentSelection() : QString
+SetRobotAddress(in index : int)
+on_robotsListRB_toggled(in value : bool)
+on_provideIPAddressRB_toggled(in value : bool)
-validateIPAddressFormat() : bool
QWidget
The QWidget class is the base class of all user interface objects.
The widget is the atom of the user interface: it receives mouse, keyboard
and other events from the window system, and paints a representation
of itself on the screen. Every widget is rectangular, and they are sorted
in a Z-order. A widget is clipped by its parent and by the widgets in front
of it.
Code Block
#include <QWidget>
63
Customized Mobile Robot System
QDialog
The QDialog class is the base class of dialog windows. A dialog window is
a top-level window mostly used for short-term tasks and brief
communications with the user.
QDialogs can provide a return value, and they can have default buttons.
QDialogs can also have a QSizeGrip in their lower-right corner,
usingsetSizeGripEnabled()
Code Block
#include <QDialog>
QComboBox
Code Block
#include <QComboBox>
QString
Code Block
64
Customized Mobile Robot System
#include <QString>
QLineEdit
A line edit allows the user to enter and edit a single line of plain text with
a useful collection of editing functions, including undo and redo, cut and
paste, and drag and drop. By changing the echoMode() of a line edit, it
can also be used as a "write-only" field, for inputs such as passwords.
Code Block
#include <QLineEdit>
QHostAddress
Code Block
#include <QHostAddress>
65
Customized Mobile Robot System
4.5.14 SensorsView.cpp
Description
UML
SensorsView
-crv : QwtPlotCurve
-index : int
-maxData : int
-minData : int
-xval[120] : double
-yval[120] : double
-xMap : QwtScaleMap
-yMap : QwtScaleMap
-m_thread : SensorsDataThread
+SensorsView(in parent : QWidget* = 0)
+~SensorsView()
+newData(in val : float)
+newData(in data : char*, in size : int)
+connectTo(in address : const QString &)
+disconnect()
+shiftDown(in rect : QRect &, in offset : int)
+drawContents(in p : QPainter*)
+paintEvent(in Parameter1 : QPaintEvent*)
QWidget
66
Customized Mobile Robot System
The QWidget class is the base class of all user interface objects.
it receives mouse, keyboard and other events from the window system,
and paints a representation of itself on the screen. Every widget is
rectangular, and they are sorted in a Z-order. A widget is clipped by its
parent and by the widgets in front of it.
Code Block
#include <Qwidget>
QFrame
The QFrame class is the base class of widgets that can have a frame.
Code Block
QFrame(parent)
Qt Gui Module
QColor
The QColor class provides colors based on RGB, HSV or CMYK values
Code Block
#include <Qcolor>
QRect
The QRect class defines a rectangle in the plane using integer precision.
Code Block
#include <Qrect>
67
Customized Mobile Robot System
QPaintEvent
Code Block
#include <Qpaintevent>
QBrush Class
The QBrush class defines the fill pattern of shapes drawn by QPainter
Code Block
#include <QBrush>
QPainter
Code Block
#include <Qpainter>
QPaintEngine
Code Block
#include <QpaintEngine>
QFont
68
Customized Mobile Robot System
Code Block
#include <QFont>
QThread
Code Block
#include <QThread>
4.5.15 SensorsDataThread.cpp
Description
The thread that handles opening the socket and waiting for the sensor
data
QtNetwork Library
The QtNetwork module offers classes that allow you to write TCP/IP
clients and servers.
Code Block
#include <QtNetwork>
QThread
69
Customized Mobile Robot System
Code Block
#include <QThread>
QMutexLocker
Code Block
#include <QMutexLocker>
QTcpSocket Class
QDataStream
Code Block
#include<Qdatastream>
70
Customized Mobile Robot System
UML
SensorsDataThread
-m_parent : SensorsView *
-hostName : QString
-port : quint16
-mutex : QMutex
-cond : QWaitCondition
-stopRequested : bool
-m_SensorsData : char *
-connected : bool
+SensorsDataThread(in parent : SensorsView* = 0)
+~SensorsDataThread()
+setRobotAddress(in address : const QString &)
+stop()
+isConnected() : bool
+startAcquiringGPSData(in hostName : const QString &, in port : quint16)
+run()
+quitRunning()
+wakeUpAndWork()
+error(in socketError : int, in message : const QString &)
C++ was chosen as the language for writing the robot end code. It has
the advantage of running faster than programs like JAVA that require
services from other programs like C# or JAVA and .Net or JVM
respectively. Furthermore writing the code in C++ makes it more
portable since there are C++ compilers available for most platforms.
Finally, unlike C, C++ provides Object Oriented abstractions that make
writing and modifying code easier.
C++ was also used to develop the Control Interface software with the QT
library. Using C++ has all the advantages listed above and furthermore,
QT is supported on Windows and many Unix based systems like Linux
and Macs. JAVA could have been used as the alternative. Finally, linux
was used at the Control Interface since unlike Windows the use of the
QT library is free on Linux.
71
Customized Mobile Robot System
b) Multitasking
d) Hardware support
e) Networking connectivity
72
Customized Mobile Robot System
f) Network servers
g) Application support
73
Customized Mobile Robot System
Chapter 5: Networking
5.1 Introduction
There are a lot of chooses for wireless network like Bluetooth, RF,
InfraRed (IRDA), Wi-Fi, WI-MAX, ZigBee, GSM, GPRS, 3/4G)
5.1.1 Bluetooth
74
Customized Mobile Robot System
75
Customized Mobile Robot System
Wi-Fi
Features
76
Customized Mobile Robot System
Security
Bluejacking
77
Customized Mobile Robot System
5.1.2 ZigBee
78
Customized Mobile Robot System
79
Customized Mobile Robot System
Infrared lasers are used to provide the light for optical fiber
communications systems. Infrared light with a wavelength around 1,330
nm (least dispersion) or 1,550 nm (best transmission) are the best
choices for standard silica fibers.
5.1.4 Wi-Fi
The term Wi-Fi is often used by the public as a synonym for wireless LAN
(WLAN); but not every wireless LAN product has a Wi-Fi certification,
which may be because of certification costs that must be paid for each
certified device type.
80
Customized Mobile Robot System
A Wi-Fi enabled device such as a PC, game console, mobile phone, MP3
player or PDA can connect to the Internet when within range of a
wireless network connected to the Internet. The coverage of one or
more interconnected access points — called a hotspot — can comprise
an area as small as a single room with wireless-opaque walls or as large
as many square miles covered by overlapping access points. Wi-Fi
technology has served to set up mesh networks, for example, in London
both architectures can operate in community networks
Wi-Fi allows local area networks (LANs) to be deployed without wires for
client devices, typically reducing the costs of network deployment and
expansion. Spaces where cables cannot be run, such as outdoor areas
and historical buildings, can host wireless LANs.
Wireless network adapters are now built into most laptops. The price of
chipsets for Wi-Fi continues to drop, making it an economical
networking option included in even more devices. Wi-Fi has become
widespread in corporate infrastructures.
Wi-Fi is widely available in more than 220,000 public hotspots and tens
of millions of homes and corporate and university campuses worldwide.
The current version of Wi-Fi Protected Access encryption (WPA2) is not
easily defeated, provided strong passwords are used. New protocols for
Quality of Service (WMM) make Wi-Fi more suitable for latency-sensitive
applications (such as voice and video), and power saving mechanisms
(WMM Power Save) improve battery operation. With this advantages we
recommened with wi-fi in this project.
81
Customized Mobile Robot System
IEEE 802.11 is a set of standards carrying out wireless local area network
(WLAN) computer communication in the 2.4, 3.6 and 5 GHz frequency
bands. They are implemented by the IEEE LAN/MAN Standards
Committee IEEE 802 .
802.11b and 802.11g use the 2.4 GHz ISM band, operating in the United
States under Part 15 of the US Federal Communications Commission
Rules and Regulations. Because of this choice of frequency band,
802.11b and g equipment may occasionally suffer interference from
microwave ovens, cordless telephones and Bluetooth devices. Both
802.11 and Bluetooth control their interference and susceptibility to
interference by using spread spectrum modulation. Bluetooth uses a
frequency hopping spread spectrum signaling method (FHSS) while
802.11b/g use the direct sequence spread spectrum signaling (DSSS) and
orthogonal frequency division multiplexing (OFDM) methods
respectively. 802.11a uses the 5 GHz U-NII band, which, for much of the
world, offers at least 19 non-overlapping channels rather than the 3
offered in the 2.4 GHz ISM frequency band Propagation around objects
such as walls and furniture tends to be better at higher frequencies This
is because higher frequencies scatter more, which helps them get
around objects .However penetration is better with lower frequencies.
Better or worse performance with higher or lower frequencies
(channels) may be realized, depending on the environment. Wi-Fi
generally reflects around objects rather than going through them.
82
Customized Mobile Robot System
Mobility in Wi-Fi
83
Customized Mobile Robot System
Wi-Fi Hardware
Standard Devices
84
Customized Mobile Robot System
Embedded systems
These Wi-Fi modules are designed so that designers need minimal Wi-Fi
knowledge to wireless-enable their products.
Network Security
The main issue with wireless network security is its simplified access to
the network compared to traditional wired networks such as Ethernet.
With wired networking it is necessary to either gain access to a building,
physically connecting into the internal network, or break through an
external firewall. Most business networks protect sensitive data and
systems by attempting to disallow external access. Thus being able to
85
Customized Mobile Robot System
Attackers who have gained access to a Wi-Fi network can use DNS
spoofing attacks very effectively against any other user of the network,
because they can see the DNS requests made, and often respond with a
spoofed answer before the queried DNS server has a chance to reply.
Securing methods
86
Customized Mobile Robot System
Protocols
The original version of the standard IEEE 802.11 was released in 1997
and clarified in 1999, but is today obsolete. It specified two net bit rates
of 1 or 2 megabits per second (Mbit/s), plus forward error correction
code. It specified three alternative physical layer technologies: diffuse
infrared operating at 1 Mbit/s; frequency-hopping spread spectrum
operating at 1 Mbit/s or 2 Mbit/s; and direct-sequence spread spectrum
operating at 1 Mbit/s or 2 Mbit/s. The latter two radio technologies used
microwave transmission over the Industrial Scientific Medical frequency
band at 2.4 GHz. Some earlier WLAN technologies used lower
frequencies, such as the U.S. 900 MHz ISM band.
802.11a
Release date Op. Frequency Throughput (type.) Net bit rate (max.) Gross bit rate (max.)
The 802.11a standard uses the same data link layer protocol and frame
format as the original standard, but an OFDM based air interface
(physical layer). It operates in the 5 GHz band with a maximum net data
rate of 54 Mbit/s, plus error correction code, which yields realistic net
achievable throughput in the mid-20 Mbit/s
Since the 2.4 GHz band is heavily used to the point of being crowded,
using the relatively un-used 5 GHz band gives 802.11a a significant
advantage. However, this high carrier frequency also brings a
disadvantage: The effective overall range of 802.11a is less than that of
802.11b/g; and in theory 802.11a signals cannot penetrate as far as
those for 802.11b because they are absorbed more readily by walls and
87
Customized Mobile Robot System
802.11b
Release date Frequency band Throughput (type.) Net bit rate (max.)
802.11b has a maximum raw data rate of 11 Mbit/s and uses the same
media access method defined in the original standard. 802.11b products
appeared on the market in early 2000, since 802.11b is a direct
extension of the modulation technique defined in the original standard.
The dramatic increase in throughput of 802.11b (compared to the
original standard) along with simultaneous substantial price reductions
led to the rapid acceptance of 802.11b as the definitive wireless LAN
technology.
802.11g
Release date Op. Frequency Throughput (type.) Net bit rate (max.) Gross bit rate (max.)
88
Customized Mobile Robot System
802.11-2007
In 2003, task group TGma was authorized to "roll up" many of the
amendments to the 1999 version of the 802.11 standard. REVma or
802.11ma, as it was called, created a single document that merged 8
amendments (802.11a,b,d,e,g,h,i,j) with the base standard. Upon
approval on March 08, 2007, 802.11REVma was renamed to the current
base standard IEEE 802.11-2007.
802.11n
Release date Op. Frequency Throughput (type.) Net bit rate (max.)
89
Customized Mobile Robot System
January 2010 (est.) 5 GHz and/or 2.4 GHz 144 Mbit/s 600 Mbit/s
90
Customized Mobile Robot System
5.1.5 WiMAX
91
Customized Mobile Robot System
Both 802.11 and 802.16 define Peer-to-Peer (P2P) and ad hoc networks,
where an end user communicates to users or servers on another Local
Area Network (LAN) using its access point or base station
Uses
The bandwidth and range of WiMAX make it suitable for the following
potential applications:
92
Customized Mobile Robot System
Broadband Access
93
Customized Mobile Robot System
Current certified devices can be found at the WiMAX Forum web site.
This is not a complete list of devices available as certified modules are
embedded into laptops, MIDs (Mobile Internet Devices), and private
labeled devices.
Some analysts have questioned how the deal will work out: Although
fixed-mobile convergence has been a recognized factor in the industry,
prior attempts to form partnerships among wireless and cable
companies have generally failed to lead to significant benefits to the
participants. Other analysts point out that as wireless progresses to
higher bandwidth, it inevitably competes more directly with cable and
DSL, thrusting competitors into bed together. Also, as wireless
broadband networks grow denser and usage habits shift, the need for
increased backhaul and media service will accelerate, therefore the
opportunity to leverage cable assets is expected to increase.
94
Customized Mobile Robot System
Technical information
95
Customized Mobile Robot System
In Wi-Fi the media access controller (MAC) uses contention access — all
subscriber stations that wish to pass data through a wireless access
point (AP) are competing for the AP's attention on a random interrupt
basis. This can cause subscriber stations distant from the AP to be
repeatedly interrupted by closer stations, greatly reducing their
throughput.
In contrast, the 802.16 MAC uses a scheduling algorithm for which the
subscriber station needs to compete only once (for initial entry into the
network). After that it is allocated an access slot by the base station. The
time slot can enlarge and contract, but remains assigned to the
subscriber station, which means that other subscribers cannot use it. In
addition to being stable under overload and over-subscription the
802.16 scheduling algorithm can also be more bandwidth efficient. The
scheduling algorithm also allows the base station to control QoS
parameters by balancing the time-slot assignments among the
application needs of the subscriber stations.
Physical layer
96
Customized Mobile Robot System
Future development
The goal for the long term evolution of both WiMAX and LTE is to
achieve 100 Mbit/s mobile and 1 Gbit/s fixed-nomadic bandwidth as set
by ITU for 4G NGMN (Next Generation Mobile Network) systems
through the adaptive use of MIMO-AAS and smart, granular network
topologies. 3GPP LTE and WiMAX-m are concentrating much effort on
MIMO-AAS, mobile multi-hop relay networking and related
developments needed to deliver 10X and higher Co-Channel reuses
multiples.
97
Customized Mobile Robot System
GPRS was developed as a GSM response to the earlier CDPD and i-mode
packet switched cellular technologies.
Services
98
Customized Mobile Robot System
Protocols supported
When TCP/IP is used, each phone can have one or more IP addresses
allocated. GPRS will store and forward the IP packets to the phone
during cell handover (when you move from one cell to another). A radio
noise induced pause can be interpreted by TCP as packet loss, and cause
a temporary throttling in transmission speed.
99
Customized Mobile Robot System
Hardware
Class A
Class B
Class C
USB GPRS modems use a terminal-like interface USB 2.0 and later, data
formats V.42bis, and RFC 1144 and external antennas. Modems can be
added as cards (for laptops) or external USB devices which are similar in
shape and size to a computer mouse
100
Customized Mobile Robot System
Data rates
ITU has not provided a clear definition of the data rate users can expect
from 3G equipment or providers. Thus users sold 3G service may not be
able to point to a standard and say that the rates it specifies are not
being met. While stating in commentary that "it is expected that IMT-
2000 will provide higher transmission rates: a minimum speed of 2
Mbit/s and maximum of 14.4 Mbit/s for stationary users, and 348 kbit/s
in a moving vehicle, the ITU does not actually clearly specify minimum or
average rates or what modes of the interfaces qualify as 3G, so various
rates are sold as 3G intended to meet customers’ expectations of
broadband speed.
Security
Evolution from 2G
2G networks were built mainly for voice data and slow transmission.
From 2G to 2.5G
GPRS could provide data rates from 56 kbit/s up to 114 kbit/s. It can be
used for services such as Wireless Application Protocol (WAP) access,
Multimedia Messaging Service (MMS), and for Internet communication
services such as email and World Wide Web access. GPRS data transfer
101
Customized Mobile Robot System
Evolution towards 4G
Issues
102
Customized Mobile Robot System
4. There are higher level tools for programs that span more than one
machine. RPC, DCOM and windows remoting are examples.
103
Customized Mobile Robot System
104
Customized Mobile Robot System
The following are the major system calls supplied by Berkeley sockets
and UNIX to perform TCP communications. There are other calls that we
will use and calls to support UDP. These will be presented later.
4. Read - to get data that was sent on the connection. It returns the
number of bytes read. 0 is returned if the connection broken.
(NOTE: WIN32 gives an error return.).
105
Customized Mobile Robot System
call. This is like advertising the service. This socket is called the
listening socket. Note: there are some port numbers that are
referred to as well-known ports. See /etc/services for a list. A
good habit is to always select port numbers that are greater than
7000.
Client:
^ |
|______|
Server:
106
Customized Mobile Robot System
^ ^ | |
|_______|______|______|
107
Customized Mobile Robot System
108
Customized Mobile Robot System
Simulation
Components
109
Customized Mobile Robot System
CCR and DSS are also available separately for use in commercial
applications that require a high level of concurrency and/or must be
distributed across multiple nodes in a network.
Tools
MRDS supports the iRobotCreate entity, hence it’s a perfect choice for
simulation to provide rapid development of simulation procedure.
110
Customized Mobile Robot System
Simulation Scenario
You can choose to interact only with the managed physics engine API if
you don't want any visualization. However, it is strongly recommended
that you always use the simulation engine service and define custom
entities that disable rendering. This greatly simplifies persistence of
state, inspection and debugging of simulation code.
Running project goes from the DSS Command Prompt using the
following command:
SimulatedBumper.Y2006.M05.Proxy
SimulatedDifferentialDrive.2006.M06.Proxy
111
Customized Mobile Robot System
SimulatedLRF.Y2006.M05.Proxy
SimulatedWebcam.Y2006.M09.Proxy
Service Start
112
Customized Mobile Robot System
After the laser, bumper, and camera are created it’s noticeable that they
are inserted as children to the motor base entity:
The simulation engine plus the VisualEntity base class take care of
initializing and properly updating and rendering the child entities each
frame. The following steps explain each entity creation method in more
detail.
The parent entity is a differential drive motor base with the physics
shape dimensions of the iRobotCreate. Pay close attention to the name
of the entity. This is how a simulation service finds the entity it needs to
run. The CreateEntityPartner method creates a service partner that lets
the service know what entity it needs to bind to at runtime.
The following code snippet shows you how to create the laser entity and
start its associated service. Again, pay close attention to the entity name
and make sure that name matches the partner name.
One interesting thing about this sensor entity is that it must be placed
on top of the motor base (using the relative pose). For modular robots,
sensors and additional hardware must be specified in terms of the
parent entity and in a loosely coupled manner.
113
Customized Mobile Robot System
This section shows you how to build a bumper array entity using just two
shapes placed in front of and behind the motor base. The Pioneer mesh
used actually shows 10 bumpers total, but they are approximated by
using just two. Again, note the relative pose for the bumper shapes.
The bumper array entity uses contact notifications from the physics
engine to report collisions with other shapes in the physics simulation. A
shape can only report collisions if the following field is set to true
Camera Entity
This section shows you how to add a realtime camera in the simulation
that captures the scene from the perspective of a camera entity. The
camera is mounted on the motor base (it's added as a child of the
DifferentialDrive entity), so it moves when the robot moves. It simulates
a USB or wireless webcam attached to a mobile robot, proving a very
common and useful simulated sensor that can be utilized for vision
processing and other tasks.
114
Customized Mobile Robot System
Partnering with Services with the Entity that simulates the hardware
1. First activate a simple interleave that waits once for either a Drop
operation or the entity notification. Notice the
InsertEntityNotificationHandlerFirstTime handler is registered
only once.
2. In the notification handler that runs just once, we call the normal
notification handler that caches the entity instance and configures
service state.
3. The base class Start method is called so the service activates its
operation handlers and inserts to the directory.
115
Customized Mobile Robot System
Compile and run the simulation using the steps described in the Getting
Started section of this simulation. You should see the visualization
window open with a table and wheeled robot next to it. You may notice
blinking red circles appear on the side of the table, seemingly floating in
space. This is custom visualization of the laser impact points on the
physics shape for the table. Since the physics view of the table has solid
sides, the laser range finder sees a solid block. Using the "simple
dashboard" sample service, you can connect to the simulation node and
connect to the simulated range finder to see what it "sees".
1. Enter the machine name and TCP port number of the simulation
node. As a shortcut, you can just type local host with no port
specified.
2. Click the Connect button in the Remote Node area. Two services
should appear in the Service Directory window.
3. Click the Connect button in the Laser Range Finder area.
You can also drive the robot by using the Simple Dashboard UI.
116
Customized Mobile Robot System
117
Customized Mobile Robot System
118
Customized Mobile Robot System
Chapter 7: Conclusions
Our goal is to develop software to enable teleoperation of a robot, and
as prototype we customized this software for the iRobot Create. The
most important objective was to enable control of hardware over a
wireless network so that teleoperation is possible, and then enable
integration of different hardware to make customization easy and make
our service attractive to customers. These objectives were met
successfully, and shown through our demonstration.
For further improvements, a rotating webcam would have been better
so that obstacles can be avoided when moving the robot backwards.
Also, a joystick control would provide an easier control device for a user,
and also allow diagonal movement of the robot. To have a better
prototype it would have been ideal if a robot more suited for terrain
exploration was used, instead of iRobot Create.
As we customize our software, we might see a trend of a specific
function requested by our clients, and it would be efficient for our
business to integrate that into our software to lower customization time.
119
Customized Mobile Robot System
References
1. Z. Dehaui, X. Cunxi, L. Xuemei. “Design and Implementation of a Security and
Patrol Robot System,” in Proc. IEEE International Conference on Mechatronics
and Automation, 2005, pp 1745-49.
2. D. López de Ipiña, I. Vázquez, J. Ruiz de Garibay, D. Sainz. “GPRS-based Real-
Time Remote Control of MicroBots with M2M Capabilities,” in Proc. IEEE
Computational Intelligence in Robotics and Automation, 2005, pp.145-150.
3. “iRobot® Government and Industrial Robots,” *Online Document], 2007,
[cited 2007 Sep 14], http://www.irobot.com/sp.cfm?pageid=109
4. Microsoft renames Windows CE, sets CE 6.0 launch date
5. Windows Embedded Homepage
6. "The Meaning of "CE" in Windows CE". Q166915. Microsoft. 2002-09-03.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q166915.
Retrieved on 2006-09-15.
7. a b c Talk:Microsoft Windows CE#Is Windows CE a trimmed down version of
desktop Windows ??? 090517
8. "Pen Computing Magazine: Windows CE .net".
http://www.pencomputing.com/WinCE/dotnet.html. 090517
pencomputing.com
9. a b c "MS readies WinCE 5.0 preview".
http://www.theregister.co.uk/2004/03/29/ms_readies_wince/. 090517
theregister.co.uk
10. "The History of the PDA".
http://seditaville.com/academic/summary/The%20History%20of%20Microso
ft%20Mobile%20OS(Ver%202).doc. 090517 seditaville.com
11. "Introduction to Microsoft embedded technologies - Session 1".
http://www.embedded.net.nz/Presentations%20PPT%20%20PDF/Embedded
%20Introduction%20-%20Session%201.ppt. 090517 embedded.net.nz
12. "Differences between Windows CE 5.0 and Windows CE 6.0".
http://www.windowsfordevices.com/articles/AT9457847627.html. 090517
windowsfordevices.com
13. Apple (2002-07-17). Apple Introduces "Jaguar," the Next Major Release of
Mac OS X. Press release.
http://www.apple.com/pr/library/2002/jul/17jaguar.html. Retrieved on
2008-02-04.
14. "HTC TyTN Specification" (PDF). HTC.
http://www.europe.htc.com/z/pdf/products/1766_TyTN_LFLT_OUT.PDF.
Retrieved on 2008-02-04.
15. (PDF) Simple Pairing Whitepaper. Version V10r00. Bluetooth SIG. 2006-08-
03. http://bluetooth.com/NR/rdonlyres/0A0B3F36-D15F-4470-85A6-
F2CCFA26F70F/0/SimplePairing_WP_V10r00.pdf. Retrieved on 2007-02-01.
16. Michael Oryl (2007-03-15). "Bluetooth 2.1 Offers Touch Based Pairing,
Reduced Power Consumption". MobileBurn.
http://www.mobileburn.com/news.jsp?Id=3213. Retrieved on 2008-02-04.
120
Customized Mobile Robot System
121
Customized Mobile Robot System
Appendices
Attached a list of datasheets of hardware used listed by order of
appearance in this section.
122