Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Add hal::orientation interface #631

Open
kammce opened this issue Jan 19, 2023 · 0 comments
Open

Add hal::orientation interface #631

kammce opened this issue Jan 19, 2023 · 0 comments
Labels
📜 interface apis abstraction for hardware

Comments

@kammce
Copy link
Contributor

kammce commented Jan 19, 2023

An interface representing the orientation of an entity. Such an entity can have 1D 2D or 3D orientation.

An example of a 1D orientation would be a rotary potentiometer. It has a single degree of rotational freedom and that's only has one degree of orientation.

An accelerometer to represent 2D orientation but so could a joystick represent 2D orientation. The reason accelerometers do not have more degrees of freedom is due to the fact that they cannot get y'all without some other reference that isn't gravity like a compass.

3D orientation can come from an IMU that provides yaw pitch and roll information.

There should also be consideration of whether or not there should be separate interfaces for each type of orientation 1D, 2D or 3D. The benefits of having separate types for each one are:

  1. APIs using specific interfaces will make it more clear and obvious to the developers what their expectations are. Taking a 3D orientation when you only want one dimension of orientation information can make the API a bit confusing.
  2. The cost of having to use a 3D orientation for all orientations is that you pay the cost of returning a larger data structure when you will never use these values.

Whether or not this particular interface should use were there angles or quaternions is up for debate. My personal preference would be or their angles as it's more intuitive for human beings to understand.

@kammce kammce added the 📜 interface apis abstraction for hardware label Jan 19, 2023
@kammce kammce self-assigned this Jan 20, 2023
@kammce kammce removed their assignment Feb 23, 2023
@kammce kammce changed the title hal::orientation Add hal::orientation interface Mar 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
📜 interface apis abstraction for hardware
Projects
None yet
Development

No branches or pull requests

1 participant