3DoT Technical Documentation

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Custom Commands: Arxterra Control Panel & Android Application Creating A Custom Command Command Control Panel Interface Implementation Example Tommy Sanchez.
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.
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.
C Lecture Notes 1 Program Control (Cont...). C Lecture Notes 2 4.8The do / while Repetition Structure The do / while repetition structure –Similar to.
Introduction. 2 What Is SmartFlow? SmartFlow is the first application to test QoS and analyze the performance and behavior of the new breed of policy-based.
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.
A First Program Using C#
CSULB EE400D TECHNICAL DOCUMENTATION ARDUINO/ARXTERRA PROGRAMMING PART I - COMMANDS.
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.
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.
Dr Masri Ayob TK 2633: Microprocessor & Interfacing Lecture 7: Assembly Language.
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
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)
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.
Specview 32 Release 2.5 Enhancements
CS 8903 Demo Wireless Interface for the Bioloid Robot Chetna Kaur.
Vex Robotics Program six: combining autonomous and radio control.
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
Renesas Technology America Inc. 1 M16C Seminars Lab 3 Creating Projects Using HEW4 14 March 2005 M16C Seminars Lab 3 Creating Projects Using HEW4 Last.
Arxterra Telemetry Code Example is the Temperature Sensor from ATechTop Here is the setup subroutine of the original code from Sparkfun: #define TRUE 1.
Chapter 1 Java Programming Review. Introduction Java is platform-independent, meaning that you can write a program once and run it anywhere. Java programs.
Vex Robotics Program Two: Using two motors. Program two: using the motors In the last section, you learned how to turn on one motor. Now, you will take.
Vex Robotics program three: using motors and sensors together.
Text2PTO: Modernizing Patent Application Filing A Proposal for Submitting Text Applications to the USPTO.
After Construction Name: Per #:.
Secure Coding Rules for C++ Copyright © 2016 Curt Hill
INTRODUCTION TO ROBOTICS Part 5: Programming
Arxterra: Understanding the Communication Between Arduino and Phone
Development Environment
Getting Started: Arxterra Control Panel & Application
Getting started with the Arxterra software and 3DoT Firmware
3DoT Technical Documentation
User-Written Functions
The Machine Model Memory
3DoT Technical Documentation
Business Directory REST API
Project Objectives Publish to a remote server
Topics Introduction to Repetition Structures
Chapter 13 - The Preprocessor
Computer Programming I
JavaScript Syntax and Semantics
Indexer AKEEL AHMED.
Introduction Example: model train controller..
Using Procedures and Exception Handling
Introduction to LabVIEW
MACRO Processors CSCI/CMPE 3334 David Egle.
VISUAL BASIC.
Unit 2 Programming.
About AirPrint AirPrint is an Apple technology that helps you create full-quality printed output without the need to download or install drivers.
Object-Oriented Software Engineering
Programming - Buttons Intro to Robotics.
Programming - Buttons Intro to Robotics.
Super User Training Lesson #2 Documents
Presentation transcript:

3DoT Technical Documentation 3DoT/Arxterra Programming Part I - Commands

Getting Started Arxrobot Firmware – Define Robot Features You can download the arxrobot_firmware from the Arxterra GitHub releases page: https://github.com/arxterra/arxrobot-firmware/releases. Based on the Arxterra robot you are building, set definitions to TRUE or FALSE 3DoT Device with Bluetooth module.

Getting Started Arxrobot Firmware – Define Robot Pinouts Once you have configured your code. Open the pinouts_robot.h and battery_selector 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 A5 05 01 01 80 01 80 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 Command Encoding command definitions is included in the pinouts_robot.h file arxrobot-firmware alpha version 0.8.2

Command Encoding An Introduction to 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 Series Tommy Sanchez “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 1 - 20 03 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 = 0 1 2 3 4 5 6 7 N = 1 2 3 4 5 Data = A5 05 01 01 80 01 80 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. The simplest is to throw away the code within the else if block and adding your own. 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. http://web.csulb.edu/~hill/ee400d/Lectures/Technical%20Training/Arduino%20Programming.pdf