1 2. Controlling Robot Car in Ogre References: 1. LEGO.com MINDSTORMS NXT Home, 2. OGRE 3D, 3. MSDN,

Slides:



Advertisements
Similar presentations
CIMCO Integration Software Products
Advertisements

Getting started with LEGO NXT Mindstorms software This is intended to be a short introduction to the LEGO Mindstorms software and programming the LEGO.
Controlling Robot Car via Smartphone Supervisor: Dr. Jamal Kharousheh Prepared by : Hamza Qaddara Esmat Hedariya Hareth Hanani Faculty of Engineering Telecommunication.
EIGHTH GRADE ROBOTICS KITTATINNY REGIONAL HIGH SCHOOL MR. SHEA Introduction to Programming
1 3. Controlling Robot Car by Wireless Sensor The ultimate objective of the project is to control the car motion using the steering wheel The only connection.
1 Integrated Project (EIE330) Dr Daniel Lun Department of Electronic and Information Engineering Tel: Office: DE637
Chris Harrison Stacey Kuznetsov Mariya Lysenkova Jennifer Refat Gabriel Sinkin.
Remote Surveillance Vehicle Design Review By: Bill Burgdorf Tom Fisher Eleni Binopolus-Rumayor.
The NXT is the brain of a MINDSTORMS® robot. It’s an intelligent, computer-controlled LEGO® brick that lets a MINDSTORMS robot come alive and perform.
LEGO Mindstorms NXT Programming We will be using the Common Palette for our Robots This is how you download your program onto the brick Drag and drop a.
Iridium WOCE/SVP/BP Buoy METOCEAN WOCE/SVP/BP/Iridium By Bernie Petolas, P. Eng. Product Manager METOCEAN Data Systems Ltd. Dartmouth NS B3B 1R9 Canada.
1 References: 1. J.M. Hart, Windows System Programming, 4th Ed., Addison-Wesley, 2010, Ch.12 2.Microsoft Kinect SDK for Developers,
Process-to-Process Delivery:
Music by Touch. 1. Provide an example “stimulus-sensor- coordinator-effector-response” framework for both your (human) sense of touch and the robotic.
LEGO Mindstorms NXT Introduction. Component NXT Brick Touch Sensor Light Sensor Ultrasonic Sensor Interactive Servo Motors MMN Lab.
Hands-On Microsoft Windows Server 2003 Networking Chapter Three TCP/IP Architecture.
70-291: MCSE Guide to Managing a Microsoft Windows Server 2003 Network Chapter 3: TCP/IP Architecture.
Your Python program uses the create library. It supplies functions that send commands: to your laptop’s Bluetooth radio, then to the BAM on the Create,
Programming Concepts Part B Ping Hsu. Functions A function is a way to organize the program so that: – frequently used sets of instructions or – a set.
GIRLS Robotic Camp. Let’s Begin Meet and Greet – Camp leaders introduce themselves – Students introduce themselves.
The George Washington University Electrical & Computer Engineering Department ECE 002 Dr. S. Ahmadi Class 2.
Software Framework for Teleoperated Vehicles Team Eye-Create ECE 4007 L01 Karishma Jiva Ali Benquassmi Safayet Ahmed Armaghan Mahmud Khin Lay Nwe.
Robot and Servo Drive Lab. Department of Electrical Engineering Southern Taiwan University of Science and Technology 05/07/2014 T A R Y U D I Interfacing.
HOW WEB SERVER WORKS? By- PUSHPENDU MONDAL RAJAT CHAUHAN RAHUL YADAV RANJIT MEENA RAHUL TYAGI.
10/10/ Controlling YOUR ROBOT. 10/10/2015 Basic Stamp  Basic Stamp Input - output pins Interpreter Chip Power supply: 5 Volts voltage Memory: EEPROM.
1Computer Graphics Input and Interaction Lecture 8 John Shearer Culture Lab – space 2
Robotics Overview of NXT-G Actuators in Mindstorms. Touch sensor Labwork: Right turn. Touch/bump. [Explore move versus Motor Move mini & motor mini. Motor*.]
Chapter 6-2 the TCP/IP Layers. The four layers of the TCP/IP model are listed in Table 6-2. The layers are The four layers of the TCP/IP model are listed.
University of Pennsylvania Moore School of Electrical Engineering ABSTRACT: The ability to communicate is essential for surviving in today’s world, but.
Transport Layer Moving Segments. Transport Layer Protocols Provide a logical communication link between processes running on different hosts as if directly.
A tiny turtle robot DEI The University of Padova.
ENTC-489 Embedded Real Time Software Development Embedded Real Time Software Development Week 11 Design Examples.
COP 4930 Computer Network Projects Summer C 2004 Prof. Roy B. Levow Lecture 3.
Department of Computer Science & Engineering Green Client/Server Software to Save Energy in Network Devices Axel Vigo, Mentor: Miguel Jimeno, Advisor:
Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks.
Castor Bot. Now, we will begin creating a robot Log onto your computer On your screen, click on the website labeled “castor bot” Your building instructions.
Find the Mindstorms Icon on the computer.. To start a new program click go.
Joe Cohen Presentation Overview  Project definition and requirements  Solution process and explanation  Methodology.
LEGO® MINDSTORMS® NXT Move Block.
SCJ and EV3 Robots Leadership Election. Background Safety Critical Java – A safety critical programming model in Java EV3 mindstorms Lego Robot – A robot.
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 4/Lab3.
The George Washington University Electrical & Computer Engineering Department ECE 002 Dr. S. Ahmadi Class3/Lab 2.
Prepared by Dr. Jiying Zhao University of Ottawa Canada.
CSE Design Lab Milestone III Karl SchwirzJames Hopkins Dennis O’FlahertyDave Festa.
Mindstorm NXT-G Introduction Towson University Robotics.
BEGINNER FLL PROGRAMMING WORKSHOP BY DROIDS ROBOTICS & EV3LESSONS.
EG1003: Introduction to Engineering and Design Laboratory 4: Sensors.
EG1003: Introduction to Engineering and Design Laboratory 4: Sensors.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
An operating system (OS) is a collection of system programs that together control the operation of a computer system.
MEH108 - Intro. To Engineering Applications KOU Electronics and Communications Engineering.
EV3 Programming By Dianna de Matos.
NXT Mindstorms Kit Programming
Chapter 9: Transport Layer
Instructor Materials Chapter 9: Transport Layer
What Is an Electric Motor? How Does a Rotation Sensor Work?
Understanding Communication with a Robot? Activity (60 minutes)
Module 2 Controlling a Lego EV3 Robot
Introductory Presentation
Sasha Popov November 16, 2018 iRobot Create.
Module F: Presentation Understanding Robot Fundamentals
Robot Programming Computer Literacy S2.
Controlling YOUR ROBOT
Process-to-Process Delivery:
Warm Up- What is a robot? Describe in one sentence what you understand by the term ‘robot’ 2. What are the main parts of a robot? What do people do to.
TA: Donghyun (David) Kim
Process-to-Process Delivery: UDP, TCP
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Getting started with LEGO EV3 Mindstorms software
LEGO MINDSTORMS NXT PROGRAMMING
Presentation transcript:

1 2. Controlling Robot Car in Ogre References: 1. LEGO.com MINDSTORMS NXT Home, 2. OGRE 3D, 3. MSDN, Microsoft Department of ELECTRONIC AND INFORMATION ENGINEERING 2. Controlling Robot Car in Ogre by Dr Daniel Lun

2 LEGO Mindstorms® Robots The LEGO Mindstorms® is a robotic building system consisting of: The NXT Intelligent Brick: the brain of the system Sensors and servo motors LEGO TECHNIC Elements Programming software

3 Architecture of the Car Racing System Motion Tracking Server Game Server (Mindstorms Control ) Motion Tracking System Network Video Server Marker 3D Graphics Server Video + 3D Graphics Bluetooth radio (Control car movement) RF (Transmit video) Department of ELECTRONIC AND INFORMATION ENGINEERING Introduction by Dr Daniel Lun Your program

4 Software Architecture Game Server (Mindstorms Control) Network backbone Windows Socket Server IP: Port: 8889 Game mCarNo mTime WindowSocket Client Windows Socket Your Client Program Ogre Graphics Engine (also use for car control) Should be used to keep the reserved car number and the time to wait for a free car Bluetooth Wireless Control Department of ELECTRONIC AND INFORMATION ENGINEERING 2. Controlling Robot Car in Ogre by Dr Daniel Lun

5 Game Server To simplify the task of controlling the robot car, a Game Server is developed Provide a Windows socket interface that allows multiple clients to connect with it using TCP/IP Commands sent to the Game Server should be in the form of a string Four commands: CONNECT Group_no Student_ID MOVE DurationSteeringSpeed CMOVEDurationSteeringSpeed Q Department of ELECTRONIC AND INFORMATION ENGINEERING 2. Controlling Robot Car in Ogre by Dr Daniel Lun

6 Command CONNECT Before using a robot car, user needs to make a request to the system User needs to provide his group number and student ID for registration e.g. “CONNECT Group d” The whole command should be in the form of a string with space between the parameters The command string should be sent to the Game Server via the Windows Socket connection established Consult your tutor about your group number Department of ELECTRONIC AND INFORMATION ENGINEERING 2. Controlling Robot Car in Ogre by Dr Daniel Lun

7 Command CONNECT (Con’t) Upon the receipt of the command, the Game Server will respond in either one of the following 2 ways: 1. Sending back the acknowledgement string “ACK CarNo” CarNo are two characters, e.g. “01”, “02”, … “10” that indicate the no. of the car reserved 2. Sending back the negative acknowledgement string “NCK Time” It means that no free car is available. The user needs to wait Time seconds for a free car, where Time is a set of numerical characters representing the no. of seconds Department of ELECTRONIC AND INFORMATION ENGINEERING 2. Controlling Robot Car in Ogre by Dr Daniel Lun

8 Command MOVE and CMOVE Once a car is reserved, user can send the MOVE or CMOVE command to control its motion Both MOVE and CMOVE have the same format: “MOVE or CMOVEDurationSteeringSpeed” Duration: Characters that indicate the degree of wheel rotate (e.g. 720) (positive  forward; negative  backward) Steering: Characters that indicate the direction of car movement (-100 to 100) (positive  turning right, negative  turning left) Speed: Characters that indicate the speed of the car (0 to 100 (full speed)) Department of ELECTRONIC AND INFORMATION ENGINEERING 2. Controlling Robot Car in Ogre by Dr Daniel Lun

9 When to use MOVE and CMOVE The difference of MOVE and CMOVE is only in how the car stops MOVE: Stop with a brake CMOVE: Natural stop hence the car may coast for a while depending on the ground condition MOVE is used when precise control is needed CMOVE is used when smooth movement is needed Department of ELECTRONIC AND INFORMATION ENGINEERING 2. Controlling Robot Car in Ogre by Dr Daniel Lun

10 Command Q To break the connection with the Game Server, the user can send a string with a single letter Q e.g. “Q” Once a connection is made, you need to break the connection before stopping your program An error window will be generated by the system otherwise Department of ELECTRONIC AND INFORMATION ENGINEERING 2. Controlling Robot Car in Ogre by Dr Daniel Lun

11 Command Queue of Mindstorms The NXT of Mindstorms has a command queue that allows the buffering of 5 commands working in the first-in-first-out mode If the buffer is full and a new command is received, the oldest command in the queue will be thrashed to make space for the new one Department of ELECTRONIC AND INFORMATION ENGINEERING 2. Controlling Robot Car in Ogre by Dr Daniel Lun The queue has only one command waiting for execution. The next command will go to slot The queue is full. Command 1 will be thrashed to make space for new command New command received Case 1 Case 2  5

12 Advices If you issue commands faster than the rate that Mindstorms executes the commands, need to prepare some commands may be loss; need to prepare your commands will have a delay for going thru the queue before they are executed If you issue commands slower than the rate that Mindstorms executes the commands, the robot car just stays there to wait for your command The rate of execution of the commands is determined by the speed and duration of your MOVE or CMOVE commands the faster the speed & shorter the duration, the higher is the rate Need a good match between the rate of issuing commands and the choice of MOVE or CMOVE parameters Department of ELECTRONIC AND INFORMATION ENGINEERING 2. Controlling Robot Car in Ogre by Dr Daniel Lun

13 Advices (con’t) For better control of your car (e.g. for turning), you may want to have shorter duration, slower speed The choice of turning angle may also be important for better control For going faster (e.g. to run on a straight road), you may want to have longer duration, higher speed You may also want to use CMOVE instead of MOVE for a smoother motion To maximize the performance, the rate of issuing the commands should match with the parameters you have chosen Department of ELECTRONIC AND INFORMATION ENGINEERING 2. Controlling Robot Car in Ogre by Dr Daniel Lun

14 Things to do in Lab2 1.To develop the Game class, which is derived from the WindowSocket class Create a Windows socket using the functions of WindowSocket and connect to the Game server Implement all member functions for reserving and controlling the movement of the car 2.To complete the application in Ogre such that When key 1 to 4 is pressed on the keyboard, the car will move forward, backward, turn left and right, respectively in MOVE mode When key 5 to 8 is pressed on the keyboard, the car will move forward, backward, turn left and right, respectively in CMOVE mode Department of ELECTRONIC AND INFORMATION ENGINEERING 2. Controlling Robot Car in Ogre by Dr Daniel Lun

15 The Game class class Game : public WindowSocket { public: Game(void); ~Game(void); void GetCar(void);// Reserve a car void MoveCar(int duration, int steering, int speed); // Move the car based on the parameters void CMoveCar(int duration, int steering, int speed); // CMove the car based on the parameters int GetCarNo() {return mCarNo;} int GetCarTime() {return mTime;} private: int mCarNo; // Store the reserved car number int mTime; // Store the waiting time }; class Game : public WindowSocket { public: Game(void); ~Game(void); void GetCar(void);// Reserve a car void MoveCar(int duration, int steering, int speed); // Move the car based on the parameters void CMoveCar(int duration, int steering, int speed); // CMove the car based on the parameters int GetCarNo() {return mCarNo;} int GetCarTime() {return mTime;} private: int mCarNo; // Store the reserved car number int mTime; // Store the waiting time };