gc2-interface 0.2.8
GC2 Testbed Interface
Requires Python: >=3.7

# GC2 Testplatform Interface
Python library containing protobuf definitions and message builders for the gc2 testbed.

# Protocol Documentation
<a name="top"></a>

## Table of Contents

- [gc2_interface/pb/Command.proto](#gc2_interface/pb/Command.proto)
    - [BaseAction](#gc2_interface.BaseAction)
    - [DistanceMoveAction](#gc2_interface.DistanceMoveAction)
    - [PowerControl](#gc2_interface.PowerControl)
    - [RotateAction](#gc2_interface.RotateAction)
    - [ScheduleControl](#gc2_interface.ScheduleControl)
    - [TimedMoveAction](#gc2_interface.TimedMoveAction)
  
    - [PowerControlType](#gc2_interface.PowerControlType)
    - [ScheduleControlType](#gc2_interface.ScheduleControlType)
  
- [gc2_interface/pb/Common.proto](#gc2_interface/pb/Common.proto)
    - [Header](#gc2_interface.Header)
    - [Time](#gc2_interface.Time)
    - [Vector3](#gc2_interface.Vector3)
  
- [gc2_interface/pb/Sensor.proto](#gc2_interface/pb/Sensor.proto)
    - [Image](#gc2_interface.Image)
  
- [Scalar Value Types](#scalar-value-types)

<a name="gc2_interface/pb/Command.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## gc2_interface/pb/Command.proto

<a name="gc2_interface.BaseAction"></a>

### BaseAction

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| header | [Header](#gc2_interface.Header) | 1 | Header (see Header message) |
| linear_vel | [Vector3](#gc2_interface.Vector3) | 2 | [m/s] Linear velocity (x, y, z) -&gt; (forward/backward speed in m/s, ~, ~) (~ = not used, for future use) |
| angular_vel | [Vector3](#gc2_interface.Vector3) | 3 | [rad/s] Angular velocity (x, y, z) -&gt; (left/right turn speed in rad/s, ~, ~) (~ = not used, for future use) |

<a name="gc2_interface.DistanceMoveAction"></a>

### DistanceMoveAction

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| base | [BaseAction](#gc2_interface.BaseAction) | 1 | BaseAction (see above) |
| dist_m | [double](#double) | 2 | [m] Drive x meter with speed defined base_move header |

<a name="gc2_interface.PowerControl"></a>

### PowerControl

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| header | [Header](#gc2_interface.Header) | 1 | Header (see Header message) |
| cmd_type | [PowerControlType](#gc2_interface.PowerControlType) | 2 | Power command type: see PowerControlType |

<a name="gc2_interface.RotateAction"></a>

### RotateAction

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| base | [BaseAction](#gc2_interface.BaseAction) | 1 | BaseAction (see above) |
| angle_rad | [double](#double) | 2 | [rad] Turn x rad with speed defined base_move header |

<a name="gc2_interface.ScheduleControl"></a>

### ScheduleControl

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| header | [Header](#gc2_interface.Header) | 1 | Header (see Header message) |
| cmd_type | [ScheduleControlType](#gc2_interface.ScheduleControlType) | 2 | Schedule command: see ScheduleCommandType |

<a name="gc2_interface.TimedMoveAction"></a>

### TimedMoveAction

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| base | [BaseAction](#gc2_interface.BaseAction) | 1 | BaseAction (see above) |
| duration | [Time](#gc2_interface.Time) | 2 | Drive for a duration x with speed defined in the base_move header |

<a name="gc2_interface.PowerControlType"></a>

### PowerControlType

| Name | Number | Description |
| ---- | ------ | ----------- |
| MOTOR_ENABLE | 0 | enable motors (motors must be enabled before robot can move) |
| MOTOR_DISABLE | 1 | disbale motors |

<a name="gc2_interface.ScheduleControlType"></a>

### ScheduleControlType

| Name | Number | Description |
| ---- | ------ | ----------- |
| PAUSE | 0 | Pause action excecution |
| CONTINUE | 1 | Continue action excecution |
| FLUSH | 2 | Flush action queue (remove all scheduled actions) |

<a name="gc2_interface/pb/Common.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## gc2_interface/pb/Common.proto

<a name="gc2_interface.Header"></a>

### Header

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| messageID | [uint32](#uint32) | 1 | unique message id (generated locally) |
| sourceID | [uint32](#uint32) | 2 | node source id (managed by application) |
| targetID | [uint32](#uint32) | 3 | node target id (managed by application) |
| timestamp | [Time](#gc2_interface.Time) | 4 | timestamp (see Time message), time (int) since the epoch (platform dependent, for Unix, the epoch is January 1, 1970, 00:00:00 (UTC)) |

<a name="gc2_interface.Time"></a>

### Time

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| nsec | [int64](#int64) | 2 | int64 nanoseconds |

<a name="gc2_interface.Vector3"></a>

### Vector3


| Field | Type | Label |
| ----- | ---- | ----- |
| x | [double](#double) | 1 |
| y | [double](#double) | 2 |
| z | [double](#double) | 3 |

<a name="gc2_interface/pb/Sensor.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## gc2_interface/pb/Sensor.proto

<a name="gc2_interface.Image"></a>

### Image
Image message inspired by: https://docs.ros.org/en/melodic/api/sensor_msgs/html/msg/Image.html

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| header | [Header](#gc2_interface.Header) | 1 | Header (see Header message) |
| height | [uint32](#uint32) | 2 | image height, that is, number of rows |
| width | [uint32](#uint32) | 3 | image width, that is, number of columns |
| encoding | [string](#string) | 4 | # Encoding of pixels -- channel meaning, ordering, size |
| is_bigendian | [bool](#bool) | 5 | is this data bigendian? |
| step | [uint32](#uint32) | 6 | full row length in bytes |
| data | [bytes](#bytes) | 7 | actual image data, size is (step * rows) |


## Scalar Value Types

| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
| <a name="double" /> double |  | double | double | float | float64 | double | float | Float |
| <a name="float" /> float |  | float | float | float | float32 | float | float | Float |
| <a name="int32" /> int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="int64" /> int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| <a name="sint32" /> sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sint64" /> sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="fixed32" /> fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="fixed64" /> fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="bool" /> bool |  | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |