Skip to content

Commit

Permalink
map sequence to Python array.array() (ros2#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas authored Mar 21, 2019
1 parent bbfa861 commit bf18495
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion articles/142_idl.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ If a cell is blank then the default mapping is used.

| IDL type | | C type | C++ type | Python type | |
| ---------------------------- | - | --------------------------------- | -------------- | ----------------------------------------------- | - |
| T[N]<br>sequence\<T><br>sequence<T, N> | for numeric types T:<br>float, double,<br>int8, uint8,<br>int16, uint16,<br>int32, uint32,<br>int64, uint64 | - | - | numpy.ndarray(shape=(N, ), dtype=numpy.DT) | where DT is determined by T:<br>float -> float32, double -> float64,<br>intX -> intX, uintX -> uintX, |
| T[N] | for numeric types T:<br>float, double,<br>int8, uint8,<br>int16, uint16,<br>int32, uint32,<br>int64, uint64 | - | - | numpy.ndarray(<br>&nbsp;&nbsp;shape=(N, ),<br>&nbsp;&nbsp;dtype=numpy.DT) | where DT is determined by T:<br>float -> float32,<br>double -> float64,<br>intX -> intX,<br>uintX -> uintX |
| sequence\<T><br>sequence<T, N> | for numeric types T:<br>float, double,<br>int8, uint8,<br>int16, uint16,<br>int32, uint32,<br>int64, uint64 | - | - | array.array(typecode=TC) | where TC is determined by T:<br>float -> f,<br>double -> d,<br>int8 -> b, uint8 -> B,<br>int16 -> h, uint16 -> H,<br>int32 -> l, uint32 -> L,<br>int64 -> q, uint64 -> Q |
| octet[N] | | - | - | bytes | |
| sequence\<octet> | | - | - | bytes | |
| sequence<octet, N> | | - | - | bytes | |
Expand Down

0 comments on commit bf18495

Please sign in to comment.