CSULB EE400D TECHNICAL DOCUMENTATION ARDUINO/ARXTERRA PROGRAMMING PART I - COMMANDS.

Slides:



Advertisements
Similar presentations
Custom Commands: Arxterra Control Panel & Android Application Creating A Custom Command Command Control Panel Interface Implementation Example Tommy Sanchez.
Advertisements

Getting Started: Arxterra Control Panel & Android Applications
Lab7: Introduction to Arduino
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
1 CSC 551: Web Programming Spring 2004 client-side programming with JavaScript  scripts vs. programs  JavaScript vs. JScript vs. VBScript  common tasks.
 Both System.out and System.err are streams—a sequence of bytes.  System.out (the standard output stream) displays output  System.err (the standard.
Developed in collaboration with Introduction to Programming.
Programing Concept Ken Youssefi/Ping HsuIntroduction to Engineering – E10 1 ENGR 10 Introduction to Engineering (Part A)
Arxterra: Understanding the Communication Between Arduino and Phone Connection Type: How Connect Phone To Arduino Communication from Phone to Arduino Communication.
Vex 1.0 © 2005 Carnegie Mellon Robotics Academy Inc. Programming in easyC.
CSULB EE400D TECHNICAL DOCUMENTATION ARDUINO/ARXTERRA PROGRAMMING PART II - TELEMETRY.
LSU 06/04/2007BASIC Stamp Editor1 The BASIC Stamp Editor Programming Unit, Lecture 3.
Computerized Train Control System by: Shawn Lord Christian Thompson.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
What is RobotC?!?! Team 2425 Hydra. Overview What is RobotC What is RobotC used for What you need to program a robot How a robot program works Framework.
Programming Games Computer science big ideas. Computer Science jargon. Show virtual dog Homework: [Catch up: dice game, credit card or other form.] Plan.
Chapter Introduction to Computers and Programming 1.
LEGO NXT Robot Programming Introduction to Programming a Lego NXT robot in Java.
A First Program Using C#
Chapter 4 Code Editor Goals and Objectives Program more efficiently? How can you speed up your development process? Do you want to learn useful shortcuts.
Github & Arduino How To: Post On Github How To: Download from Github How To: Upload Code Downloaded from Github to Arduino Tommy Sanchez EE400D Spring.
STAY CONNECTED TOLLFREEEXPRESS CONTROL PANEL GUIDE.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
by Chris Brown under Prof. Susan Rodger Duke University June 2012
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Purpose  This training course describes how to configure the the C/C++ compiler options.
Program ultrasonic range sensor in autonomous mode
Dr Masri Ayob TK 2633: Microprocessor & Interfacing Lecture 7: Assembly Language.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
Operator Precedence First the contents of all parentheses are evaluated beginning with the innermost set of parenthesis. Second all multiplications, divisions,
THE BIG PICTURE. How does JavaScript interact with the browser?
Teacher/Mentor Institute Using easyC Joel Kirkland July 30-31, 2015.
Programing Concept Ken Youssefi/Ping HsuIntroduction to Engineering – E10 1 ENGR 10 Introduction to Engineering (Part A)
PHP meets MySQL.
Gorman, Stubbs, & CEP Inc. 1 Introduction to Operating Systems Lesson 4 Microsoft Windows XP.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
Outline Overview Video Format Conversion Connection with An authentication Streaming media Transferring media.
Specview 32 Release 2.5 Enhancements
CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
Hans-Peter Plag November 6, 2014 Session 4 (Programming Languages) (Data Types and Variables) Expressions and Operators Flow Control.
Chapter 18 – Miscellaneous Topics. Multiple File Programs u Makes possible to accommodate many programmers working on same project u More efficient to.
What is PHP? PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server PHP supports.
ALL TERRAIN ROBOT 1 Wilmer Arellano. The Client’s Need  Verbally presented at class time.  Modify the All Terrain Manual Robot into an autonomous Gripper.
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
Overview All data can be corrupted, for reliable communications we must be able to detect and correct errors implemented at the data link and transport.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
Arxterra Telemetry Code Example is the Temperature Sensor from ATechTop Here is the setup subroutine of the original code from Sparkfun: #define TRUE 1.
 Control Flow statements ◦ Selection statements ◦ Iteration statements ◦ Jump statements.
Java Programming, Second Edition Chapter Twelve Advanced Inheritance Concepts.
Programming - Motion Intro to Robotics. Motors and Sensors Setup The first thing we need to do is tell ROBOTC that we have motors on our robot. Choose.
Chapter 1 Java Programming Review. Introduction Java is platform-independent, meaning that you can write a program once and run it anywhere. Java programs.
© Oxford University Press All rights reserved. CHAPTER 10 THE PREPROCESSOR DIRECTIVE.
Introduction to Javascript. What is javascript?  The most popular web scripting language in the world  Used to produce rich thin client web applications.
Vex Robotics program three: using motors and sensors together.
Text2PTO: Modernizing Patent Application Filing A Proposal for Submitting Text Applications to the USPTO.
3DoT Technical Documentation
Arxterra: Understanding the Communication Between Arduino and Phone
Getting Started: Arxterra Control Panel & Application
Getting started with the Arxterra software and 3DoT Firmware
3DoT Technical Documentation
3DoT Technical Documentation
Chapter 13 - The Preprocessor
Using Procedures and Exception Handling
Programming - Buttons Intro to Robotics.
Programming - Buttons Intro to Robotics.
Super User Training Lesson #2 Documents
Presentation transcript:

CSULB EE400D TECHNICAL DOCUMENTATION ARDUINO/ARXTERRA PROGRAMMING PART I - COMMANDS

GETTING STARTED ARXROBOT FIRMWARE – DEFINE ROBOT FEATURES You can download the arxrobot_firmware from the Arxterra GitHub releases page: Based on the Arxterra robot you are building, set definitions to TRUE or FALSE mini-Rosco rover configured with bluetooth communictions with an ultrasonic pinger.

GETTING STARTED ARXROBOT FIRMWARE – DEFINE ROBOT PINOUTS Once you have configured your code. Open the pinouts_robot.h tab and make sure your rover’s pinouts are correct.

COMMAND ENCODING BYTE ARRAY FORMATTED INTO A PACKET Packet ID 0xA5 indicates the start of a command packet Packet Length is the number of bytes following minus the LRC byte. Command ID is an 8-bit code identifying the instruction to be executed. Command ID byte is followed by some number of bytes. Longitudinal Redundancy Check (LRC) is generated over the entire packet.

COMMAND ENCODING EXAMPLE - MOVE (0X01) FORWARD HALF SPEED TEST i = N = A A1 MOV forward half speed sendPacket data[0] A5 = Command Packet ID data[1] 05 = Packet Length N w/o parity byte data[2] 01 = Move ID data[3] 01 = Left Motor Forward data[4] 80 = Half Speed (128/255) data[5] 01 = Right Motor Forward data[6] 80 = Half Speed (128/255) data[7] A1 = Longitudinal Redundancy Check (LRC)

COMMAND ENCODING COMMAND DEFINITIONS IS INCLUDED IN THE PINOUTS_ROBOT.H FILE arxrobot-firmware alpha version 0.8.2

COMMAND ENCODING CUSTOM COMMANDS Arxterra control panel allows you to create your own custom commands Control panel designed to support a Hexapod robot  Control Panel User interface (UI) widgets include: radio buttons, sliders, drop down menus, and more. Use command IDs 0x40 to 0x5F Learn how to create your own custom UI widget, Jeff Gome’s Video SeriesVideo Series Tommy Sanchez “Creating Custom Commands With the Arxterra Application”Creating Custom Commands With the Arxterra Application

IMPLEMENTING COMMANDS HOW THE ARXROBOT FIRMWARE DETECTS, READS, AND HANDLES COMMANDS All Arduino programs contain a setup() and a loop() method. Commands are detected in the loop() method. Once detected, commands are decoded in the commandDecoder() function. You can find the command decoder code under the command tab within the Arduino IDE (Integrated Development Environment).

IMPLEMENTING COMMANDS COMMAND DECODER FINITE STATE MACHINE (FSM)

IMPLEMENTING COMMANDS COMMAND EXCEPTION CODES 01 Start byte 0xA5 expected 02 Packet length out of range LRC checksum error 04 Undefined command decoder FSM state 05 Array out of range i >= 23

IMPLEMENTING COMMANDS HOW THE ARXROBOT FIRMWARE DETECTS, READS, AND HANDLES COMMANDS If the command is successfully decoded then the commandHandler function is called from state 3 of the FSM. The data parameter points to the received byte-array. The N parameter is the length of the packet as previously defined

IMPLEMENTING COMMANDS COMMAND DECODER To understand these two parameters, review move (0x01) command example. i = N = Data = A A1 MOV forward half speed The command handler function assigns the third byte to the unsigned byte variable cmd. uint8_t cmd = data[2]; Next a series of if-else-if statements direct action to be taken by the Arduino if (cmd == MOVE) {... } else if (cmd == CAMERA_MOVE){... } else if (cmd == CAMERA_RESET){...

IMPLEMENTING COMMANDS HOW TO WRITE ARDUINO CODE FOR YOUR ROBOT’S UNIQUE COMMAND(S) Develop and test your code in a separate Arduino ino file(s). Once you know it works, then add to arxrobot_firmware Two approaches to modifying the code for your robot. 1. The simplest is to throw away the code within the else if block and adding your own. 2. The second is to add your code in such a way that the original functionality of the code is not lost.

IMPLEMENTING COMMANDS METHOD 2: MAINTAINING CODE COMPATIBILITY Step 1 Add a new C++ preprocessor directive for your robot. Declare it TRUE and the remaining robots FALSE. #define BiPed TRUE #define PaperBot FALSE #define Rosco FALSE Step 2 Scroll down to the command block you are implementing Append a #elif preprocessor conditional directive (before #endif). Add a function call to your command

IMPLEMENTING COMMANDS METHOD 2: MAINTAINING CODE COMPATIBILITY – CONTINUED Step 3 Save and close the Arduino IDE. Add the ino file(s) containing the functions that are unique to your robot. Reopen the Arduino IDE. The new ino file(s) will now appear as tab(s). Rename the setup() method from your development software and call from the setup() method in arxrobot_firmware. For example setup_BiPed() Rename the loop() method from your development software and call from the loop() method in arxrobot_firmware. For example update_BiPed() Compile your code and verify that there are no errors.

IMPLEMENTING COMMANDS METHOD 2: MAINTAINING CODE COMPATIBILITY - EXAMPLE if (cmd == MOVE) { #if Rosco == TRUE // Adafruit L293D motorshield move_L293D(data); #elif Pathfinder // Pololu VNH5019 motorshield move_VNH5019(data); #elif PaperBot // Sparkfun TB6612FNG move_TB6612FNG(data); #elif BiPed walk_BiPed(data); #endif

IMPLEMENTING COMMANDS UNPACKING/FORMATTING COMMAND ARGUMENTS All command data is in the form of a byte array, formatted as an Arxterra command packet. Your unique commands may want data formatted as a type other than an 8-bit byte. In this example, four (4) bytes are converted into a 32-bit “unsigned long” data type and saved in variable ping_interval.

COMMANDS ADDITIONAL READING Here is the companion document to this presentation. Programming.pdf Programming.pdf