Welcome, Guest. Please Login.
Surveyor Corporation Surveyor SRV-1
Home Help Search Login

Surveyor Robotics Forum

Welcome to the user support forum for Surveyor SRV-1 robots, SRV-1 robot controllers and SVS stereo vision systems. To register for this forum, please send an email to support@surveyor.com which includes your desired forum user name, your registration email address, and a brief explanation of why you wish to join, and we will create a forum account for you.

Please note that there is a Search button in the forum toolbar for forum topics. Another effective search method for the entire surveyor.com site is to use Google, e.g. "xyz site://www.surveyor.com" where "xyz" is the search topic.



Pages: 1
Send Topic Print
Sending M commands to SRV1 (Read 1234 times)
ashmanq
YaBB Newbies
*




Posts: 40
Sending M commands to SRV1
02/28/08 at 6:28am
 
When sending commands to the SRV1 I use strings that are then converted to bytes and sent to the robot. How do you represent negative values as ASCII characters using the M command? Like when I want the robot to reverse for a certain amount of time.
Back to top
 
 
  IP Logged
veider
Junior Member
**




Posts: 73
Re: Sending M commands to SRV1
Reply #1 - 02/28/08 at 6:50am
 
Quote from ashmanq on 02/28/08 at 6:28am:
When sending commands to the SRV1 I use strings that are then converted to bytes and sent to the robot. How do you represent negative values as ASCII characters using the M command? Like when I want the robot to reverse for a certain amount of time.

0x00 to 0x7F is for forward where 0x00 is the slowest 0x7f - the fastest
0xff to 0x81 is for backward where 0xff is the slowest 0x81 - the fastest
Back to top
 
 

.byte EB FE
veider 719961   IP Logged
ashmanq
YaBB Newbies
*




Posts: 40
Re: Sending M commands to SRV1
Reply #2 - 02/28/08 at 6:58am
 
How would you represent the negative set og hex codes as an ASCII chataracter e.g where 0x77 = w.
Back to top
 
 
  IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: Sending M commands to SRV1
Reply #3 - 02/28/08 at 8:25am
 
Basically, you can't use ASCII with the 'M' command to generate negative values.
 
We use two different formats with the SRV_protocol commands - all commands are initiated by an ASCII character ('V', 'M', etc), but with some commands, the following characters are 8-bit binary (represented as hex), and with other commands, the following characters are ASCII decimal ('0' - '9'), e.g.
 
- M, S, s, ir, iw and f commands are examples where 8-bit (non-ASCII) parameters are passed, though it's sometimes possible to find ASCII characters to represent the binary values (e.g. control-A = 0x01, '0' = 0x30, etc)
 
- q, vb, vn, vs, vc, vr, and vf commands take ASCII decimal parameters
 
I just updated http://www.surveyor.com/blackfin/SRV_protocol_bf.html in hopes of clarifying which commands use 8-bit binary parameters vs ASCII decimal characters.  If there are any suggestions on how to make this more obvious, please let me know.
Back to top
 
« Last Edit: 02/28/08 at 8:26am by admin »  

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
Pages: 1
Send Topic Print