<< return to Pixycam.com

User Tools

Site Tools


wiki:v2:line-packets

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:v2:line-packets [2018/10/03 20:49]
jfrench
wiki:v2:line-packets [2018/10/10 19:39] (current)
pixycam [reverseVector(angle)]
Line 1: Line 1:
 ===== Line Tracking - Packet Reference ===== ===== Line Tracking - Packet Reference =====
  
-Check out the [[wiki:​v2:​line_api|Line tracking API]] for more details ​about the response.+Check out the [[wiki:​v2:​line_api|Line tracking API]] for more details.
  
 ==== getMainFeatures(features,​ wait) ==== ==== getMainFeatures(features,​ wait) ====
  
 === Request: === === Request: ===
-^Bit ^Description ^Value ^ +^Bit ^Description ^Value(s) 
-|0 - 1 |Sync | 174 193 |+|0 - 1 |16-bit sync | 174193 (0xc1ae) ​|
 |2 |Type of packet |48 | |2 |Type of packet |48 |
 +|3 |Length of payload |2 |
 +|4 |Request type | 0=main features, 1=all features |
 +|5 |Features (bitmap) | 7=vectors, intersections,​ barcodes |
 +
 +
 +
 +=== Response: ===
 +
 +
 +^Byte ^Description ^Value(s) ^
 +|0 - 1 | 16-bit sync | 175, 193 (0xc1af) |
 +|2 |Type of packet |49 |
 +|3 |Length of payload |(varies) |
 +|4 - 5 |16-bit checksum | sum of payload bytes |
 +|6              | Feature-type | 1=Vector, 2=Intersection,​ 4=Barcode |
 +|7              | Feature-length ​      | (varies) |
 +|8 - 8+feature-length ​ | Feature-data ​   | (varies) |
 +|               | Next feature-type (optional) | (varies) |
 +|               | Next feature-length (optional) | (varies) |
 +|               | Next feature-data (optinal) | (varies) |
 +|               | Next feature-type (optional) | (varies) |
 +|               | Next feature-length (optional) | (varies) |
 +|               | Next feature-data (optinal) | (varies) |
 +
 +Note, this response can have up to three different feature sections, one for vectors (if vector(s) exist), one for intersections (if intersection(s) exist) and one for barcodes (if barcode(s) exist) in the image. ​ Each feature section begins with a feature-type. ​ The feature-length is next, which indicates how many bytes are in the feature-data. ​ The feature-data is last, which has the data associated with the feature. ​ Sometimes the feature-data section will have more than one of the given feature type, for example, there may be three barcodes, in which case the three barcodes will be concatenated in the feature-data without any bytes between them.  ​
 +
 +
 +For the specific feature data types and composition,​ please consult the [[https://​github.com/​charmedlabs/​pixy2/​blob/​master/​src/​host/​arduino/​libraries/​Pixy2/​Pixy2Line.h|Pixy2Line.h]] file. 
 +
 +
 +==== setMode(mode) ====
 +
 +=== Request: ===
 +^Bit ^Description ^Value(s) ^
 +|0 - 1 |16-bit sync | 174, 193 (0xc1ae) |
 +|2 |Type of packet |54 |
 +|3 |Length of payload |1 |
 +|4 |Mode | (varies) | 
 +
 +
 +=== Response: ===
 +
 +
 +^Byte ^Description ^Value(s) ^
 +|0 - 1 | 16-bit sync | 175, 193 (0xc1af) |
 +|2 |Type of packet |1 |
 +|3 |Length of payload |4 |
 +|4 - 5 |16-bit checksum | sum of payload bytes |
 +|6 - 9              | Response/​acknowledge | (varies) |
 +
 +
 +==== setNextTurn(angle) ====
 +
 +=== Request: ===
 +^Bit ^Description ^Value(s) ^
 +|0 - 1 |16-bit sync | 174, 193 (0xc1ae) |
 +|2 |Type of packet |58 |
 +|3 |Length of payload |2 |
 +|4 - 5 |16-bit angle | (varies) | 
 +
 +
 +=== Response: ===
 +
 +
 +^Byte ^Description ^Value(s) ^
 +|0 - 1 | 16-bit sync | 175, 193 (0xc1af) |
 +|2 |Type of packet |1 |
 +|3 |Length of payload |4 |
 +|4 - 5 |16-bit checksum | sum of payload bytes |
 +|6 - 9              | Response/​acknowledge | (varies) |
 +
 +
 +
 +==== setDefaultTurn(angle) ====
 +
 +=== Request: ===
 +^Bit ^Description ^Value(s) ^
 +|0 - 1 |16-bit sync | 174, 193 (0xc1ae) |
 +|2 |Type of packet |60 |
 +|3 |Length of payload |2 |
 +|4 - 5 |16-bit angle | (varies) | 
 +
 +
 +=== Response: ===
 +
 +
 +^Byte ^Description ^Value(s) ^
 +|0 - 1 | 16-bit sync | 175, 193 (0xc1af) |
 +|2 |Type of packet |1 |
 +|3 |Length of payload |4 |
 +|4 - 5 |16-bit checksum | sum of payload bytes |
 +|6 - 9              | Response/​acknowledge | (varies) |
 +
 +
 +
 +==== setVector(angle) ====
 +
 +=== Request: ===
 +^Bit ^Description ^Value(s) ^
 +|0 - 1 |16-bit sync | 174, 193 (0xc1ae) |
 +|2 |Type of packet |56 |
 +|3 |Length of payload |1 |
 +|4 |vector index | (varies) | 
 +
 +
 +=== Response: ===
 +
 +
 +^Byte ^Description ^Value(s) ^
 +|0 - 1 | 16-bit sync | 175, 193 (0xc1af) |
 +|2 |Type of packet |1 |
 +|3 |Length of payload |4 |
 +|4 - 5 |16-bit checksum | sum of payload bytes |
 +|6 - 9              | Response/​acknowledge | (varies) |
 +
 +
 +
 +==== reverseVector(angle) ====
 +
 +=== Request: ===
 +^Bit ^Description ^Value(s) ^
 +|0 - 1 |16-bit sync | 174, 193 (0xc1ae) |
 +|2 |Type of packet |62 |
 |3 |Length of payload |0 | |3 |Length of payload |0 |
 +
  
 === Response: === === Response: ===
  
  
-^Bit ^Description ^Value ^ +^Byte ^Description ^Value(s) 
-| | | | +|0 - 1 16-bit sync 175, 193 (0xc1af) ​
-| | | |+|2 |Type of packet |1 | 
 +|3 |Length of payload |4 | 
 +|4 - 5 |16-bit checksum | sum of payload bytes | 
 +|6 - 9              | Response/​acknowledge | (varies) | 
 + 
wiki/v2/line-packets.1538599767.txt.gz · Last modified: 2018/10/03 20:49 by jfrench