Fixed-point scalar types
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python
- Domain
- embedded-iot
Research direction
Start with the proposed fixed-point Q16.8 use case and the related quaternion discussion in dsdl/issues/34; then review the representation concerns for generated DSDL classes, including Python arithmetic and libuavcan. Done means reaching a concrete decision on whether fixed-point scalar types belong in the native DSDL type set and how they should be represented.
Written by the indexing model from the issue text.
Description
@jschall once proposed to add those to the set of native DSDL types:
Can we use a floating point standard that matches IEEE 754 for 16, 32, 64 and 128-bit floats, but also provides for arbitrary bit lengths of floating point fields? I've got a spot where I'd like to use a 24-bit float, but there isn't really any support for it.
Actually what I really want to use here is fixed point Q16.8 - because I want uniform precision for this field. This keeps coming up, again and again and again, and I'd really like built-in support for it.
I can't make it a 32-bit float without spilling into another CAN frame
To which I said:
while I do like the idea in general, it seems like too much work right now, and besides there are questions on how to represent fixed-point numbers in generated DSDL classes. In Python there is support for fixed-point arithmetics in the standard library; but what about libuavcan. We'll have to either cast fixed-point numbers to floats, which pretty much defeats the purpose, or we'll need to code up custom fixed-point arithmetic classes (I know that many modern MCU support fixed-point in hardware, but the solution has to be generic). Overall I'm not sure if this feature is worth the extra complexity, at least right now.
This issue is to attract relevant discussion and feedback.
In this thread over there there was also a related discussion on how to represent the elements of rotation quaternions in the most efficient and usable way; fixed-point types could be applied there greatly: https://github.com/UAVCAN/dsdl/issues/34
- Dominant language
- No language data
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenCyphal/dsdl_specification
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
OpenCyphal/dsdl_specification#2 · 2 comments ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Explicit structuringOpenenhancement
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in OpenCyphal/dsdl_specification
Similar issues
-
Bosch Room Thermostat II number entities offer -500 to 3000 °C setpoint limits and a -32768 to 32767 °C outdoor temperaturePossibly taken @zigpy-review-bot claimed this today. Openbot: code audit
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zigpy/zha-device-handlers#5769 ·
Maintainers usually reply within 1 day
-
Status: Opened
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
espressif/esp-eth-drivers#201 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
GalusPeres/HomeTiles#165 ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Koenkk/zigbee-herdsman-converters#13884 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day