# Data Type for Amiga Position Readings

**URL:** <https://discourse.farm-ng.com/t/data-type-for-amiga-position-readings/145>\
**Category:** development\
**Created:** [March 29, 2023, 1:37am UTC](https://discourse.farm-ng.com/t/data-type-for-amiga-position-readings/145 "2023-03-29T01:37:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlflyons](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.farm-ng.com/carlflyons/32/79_2.png) [@carlflyons](https://discourse.farm-ng.com/u/carlflyons)\
**Post date:** [March 29, 2023, 1:37am UTC](https://discourse.farm-ng.com/t/data-type-for-amiga-position-readings/145/1 "2023-03-29T01:37:00Z")

</div>

Hello Farm-ng team. This question is based on my other post regarding communication between Arduino and Amiga (see [here](https://discourse.farm-ng.com/t/use-of-amiga-with-arduino/119/5)). Regarding how data is sent from the Amiga to the Arduino for interpretation purposes, what are the data types of position and speed (int, float, single value or matrix)? Is there anywhere we could find an example of such readings?

---

<div class="post-metadata">

**Author:** ![kylecoble](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.farm-ng.com/kylecoble/32/12_2.png) [@kylecoble](https://discourse.farm-ng.com/u/kylecoble)\
**Post date:** [March 29, 2023, 2:08am UTC](https://discourse.farm-ng.com/t/data-type-for-amiga-position-readings/145/2 "2023-03-29T02:08:02Z")

</div>

Hi Carl,

Short answer:

Speed and angular rate is in floats.  
We do not stream position, so you’ll have to integrate that based on the measured velocities!

Long answer:

Yes we have this information available in the API. What you’re looking for is in `farm-ng-amiga` (link at bottom).

The relevant data structures would be in:

- [farm-ng-amiga/packet.py at main · farm-ng/farm-ng-amiga · GitHub](https://github.com/farm-ng/farm-ng-amiga/blob/main/py/farm_ng/canbus/packet.py)

You’re mostly looking for the `AmigaTpdo1` class.

You can check some of our examples / tutorials for streaming information from the canbus:

- [farm-ng-amiga/py/examples/motor\_states\_stream at main · farm-ng/farm-ng-amiga · GitHub](https://github.com/farm-ng/farm-ng-amiga/tree/main/py/examples/motor_states_stream)
- [https://amiga.farm-ng.com/docs/tutorials/virtual\_joystick/virtual-joystick-overview](https://amiga.farm-ng.com/docs/tutorials/virtual_joystick/virtual-joystick-overview)

You could also use the `streamVehicleTwistState` rpc to stream `Twist2d` proto messages from the canbus service. This linear and angular velocity would be the same as you would get in the `AmigaTpdo1` objects. We do not have a python example of this stream, but the setup is exactly the same as any other server streaming rpc, which our examples are full of.

- proto / rpc definitions: [https://github.com/farm-ng/farm-ng-amiga/blob/main/protos/farm\_ng/canbus/canbus.proto](https://github.com/farm-ng/farm-ng-amiga/blob/main/protos/farm_ng/canbus/canbus.proto)

> **[GitHub - farm-ng/farm-ng-amiga: Amiga development kit for third party...](https://github.com/farm-ng/farm-ng-amiga)**
>
> Amiga development kit for third party hardware or software extensions - GitHub - farm-ng/farm-ng-amiga: Amiga development kit for third party hardware or software extensions

Hope this helps!  
– Kyle

* * *

P.S. if most of this is gibberish to you, try going through the tutorials. This’ll make a lot more sense after. We’re also going to live stream a walk-through of the tutorials tomorrow (March 29).
