Pioneer 3TM, 2TM manual Packet Checksum, Packet Errors

Page 38

ActivMedia Robotics Operating System

always first. Some data are strings of up to a maximum 200 bytes, prefaced by a length byte. Unlike common data integers, the two-byte checksum appears with its most- significant byte first (opposite order).

Packet Checksum

Calculate the PSOS/P2OS/AROS client-server packet checksum by successively adding data byte pairs (high byte first) to a running checksum (initially zero), disregarding sign and overflow. If there are an odd number of data bytes, the last byte is XORed to the low-order byte of the checksum.

int calc_chksum(unsigned char *ptr)

{

//ptr is array of bytes

//first is data count

int n; int c = 0;

n = *(ptr++);

/* Step over byte count

*/

n -= 2;

/* don't include checksum word */

while (n > 1)

 

 

{

 

 

c += (*(ptr)<<8) *(ptr+1); c = c & 0xffff;

n -= 2; ptr += 2;

}

if (n > 0)

c = c ^ (int)*(ptr++); return(c);

}

NOTE: The checksum integer is placed at the end of the packet, with its bytes in the reverse order of that used for data integers; that is, b0 is the high byte and b1 is the low byte.

Packet Errors

AROS ignores a client command packet whose byte count exceeds 204 (total packet size of 206 bytes) or has an erroneous checksum. The client should similarly ignore erroneous SIPs.

AROS does not acknowledge receipt of a command packet nor does it have any facility to handle client acknowledgment of a SIP. Accordingly, when designing client applications, keep in mind serial communication limitations, particularly data rates and physical linkage. Communication between an onboard PC client connected with the server via a signal cable is much more reliable than over radios, for example. And don’t expect to send a client command every millisecond if the HOST serial port’s baud rate is set to 9,600 kbps.

Because of the real-time nature of client-server mobile-robotics interactions, we made a conscious decision to provide an unacknowledged communication packet interface. Retransmitting server information or command packets would serve no useful purpose, because old data would be virtually useless in maintaining responsive robot behaviors.

Nonetheless, the client-server interface provides a simple means for dealing with ignored command packets: Most of the client commands alter state variables in the server. By examining those values in respective SIPs, client software may detect ignored commands and re-issue them until achieving the correct state.

32

Image 38
Contents Pioneer H8-Series Operations Manual Page Important Safety Instructions Table of Contents Operating the Aria Demonstration Client Appendix C Basic Components all shipments IntroductionRobot Package Optional Components and Attachments partial listSupport Website User-Supplied Components / System RequirementsAdditional Resources NewsgroupsSupport Support@activmedia.comWhat Is Pioneer? Pioneer Reference PlatformPlus MOTOR-POWER Board Hitachi H8S-BASED MicrocontrollerClient Software Http//robots.activmedia.comSupporting Software Pioneer LegacyPioneer 1 and AT Pioneer 2 and PeopleBotActivMedia Robotics Modes of Operation Server ModeMaintenance and Standalone Modes Joydrive and Self Test ModesSpecifications & Controls Physical CharacteristicsMain Components Motor Stop ButtonUser Control Panel P3-DX User Control PanelBody, Nose, and Accessory Panels Sonar Arrays with Gain AdjustmentBatteries and Power Motors, Wheels, and Position EncodersBattery Indicators and Low Voltage Conditions RechargingDOCKING/CHARGING System Manual Operation Robot Power OFFManual Operation Robot Power and Systems on Radio Controls and Accessories Client-server connection optionsOnboard PC Computer Control PanelOperating the Onboard PC PC NetworkingUPS and Genpowerd Safety Aros Watchdogs Quick Start Preparative AssemblyInstall Aria Starting UP Client and Server Install BatteriesClient-Server Communications Drive Self-TestDemo Startup Options IpthruSuccessful Connection Operating the Aria Demonstration ClientProper Connections DisconnectingQuickstart Troubleshooting OFF SRIsimJoydrive Mode Joydrive and Self-TestsEngaging SELF-TESTS ActivMedia Robotics Operating System CLIENT-SERVER Communication Packet ProtocolsPacket Errors Packet ChecksumServer Information Packets Multiply by DistConvFactor‡Client Commands Before Client ConnectionP2OS CLIENT-SERVER Connection Keeping the Beat-PULSE Autoconfiguration SYNC2Opening the Servers-OPEN Closing the Connection-CLOSEMotion Commands RotationActivMedia Robots in Motion Platform Dependent and Independent VariablesPID Controls Internal coordinate systemSonar Enable/Disabling SonarPosition Integration Polling Sequence and RateStalls and Emergencies 11-15 ReservedAccessory Commands and Packets Packet ProcessingChanging Baud Rates and Autobauding CONFIGpac and Config CommandSerial Port Communications Gripper packets HOST-to-AUX Serial TransfersEncoder Packets Sounds TCM2Onboard PC Heading Correction GyroInput Output I/O User I/OBumper and IR I/O IO packetsDigital Port Controls Expansion I/ODOCKING/CHARGING System I/O Docking/Charging ServersMonitoring the Recharge Cycle Charge State Overcharge ~Volts Charge current ID7ActivMedia Robotics Operating System Aros Maintenance Mode Updating & Reconfiguring ArosWhere to GET Aros Software Simple Aros UpdatesUpdating and Reconfiguring Aros Starting AroscfChanging Parameters Configuring Aros Operating ParametersInteractive Commands Save Your Work PID ParametersKeyword Ticksmm and Revcount 0056 0057 0060 0034Stallval and Stallcount BumpersUpdating and Reconfiguring Aros Drive Lubrication Maintenance & RepairTire Inflation BatteriesTightening the AT Drive Belt Alternative Battery ChargersAutomated Docking/Charging System Getting Inside Removing the NoseOpening the Deck Factory RepairsH8S Ports & Connections Power ConnectorAppendix a H8S MicrocontrollerSerial Ports User I/O, Gripper, Docking/Charging PortOD7 Expansion I/O BusUser Control Interface Bumper PortsMotors, Encoders, and IR Sensors Joystick Port Appendix B Pioneer 3 and 2-PLUS MOTOR-POWER BoardConfiguration for Current and Temperature Sensing Controller Power and Interface Radio, Auxiliary, and User Power ConnectorsIR Signal and Power GNDRadio Modem Settings Appendix CAppendix D Serial Ethernet SettingsConsole mode Webpage Peer-to-Peer NetworkingSpecifications Appendix EControls and Ports Warranty & Liabilities Columbia Drive Amherst, NH 603