Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roadmap #1

Open
2 tasks
simonbyrne opened this issue Apr 10, 2017 · 18 comments
Open
2 tasks

Roadmap #1

simonbyrne opened this issue Apr 10, 2017 · 18 comments

Comments

@simonbyrne
Copy link
Member

simonbyrne commented Apr 10, 2017

LED

  • Rotation: create views into rotated/flipped matrices
  • Message scrolling
    • Need an 8 pixel font

Sensors

Kind of complex:

Should make use of Rotations.jl:

  • gyroscope would return a RodriguesVec
    • should add a Base.^(::RodriguesVec, ::Real) method to make it easy.
@Ellipse0934
Copy link
Contributor

I want to start working on the pixel font. How exactly will we store it ? Each character needs to be mapped to an 8x8 RGB565 Matrix. We'll easily get 100+ characters. What is the correct way to store data like this in a package ? Each mapping will look like JULIA_LOGO in src/led_extra.jl. I can do the entire printable ASCII set by 10th.

@aviks
Copy link
Member

aviks commented May 8, 2018

I'd say we should store the images as FixedPointNumber arrays. And then store these images into a Dict.

@simonbyrne
Copy link
Member Author

If there is no antialiasing, it might be easiest to store each character as a BitMatrix, so the whole thing would be a Dict{Char, BitMatrix}.

@Ellipse0934
Copy link
Contributor

Right now if we have a 8x8 matrix of RGB which we want to display on the SenseHat led screen we must transpose it to view correctly. Why should a user be responsible for doing this every time ? Instead how about using led_display(x::Array{RGB565}(8,8)) as the main display function which will transpose x then display it.

@simonbyrne
Copy link
Member Author

Yeah, I agree it's not ideal. Unfortunately it's due to how the buffer is laid out in memory. But this is a problem for all images.

We could have led_matrix() return a PermuteDimsArray?

@Ellipse0934
Copy link
Contributor

We could have led_matrix() return a PermuteDimsArray?

I don't understand what you mean by that.

@simonbyrne
Copy link
Member Author

e.g. it would give what PermuteDimsArray(led_matrix(), (2,1)) currently does.

@Ellipse0934
Copy link
Contributor

Yes, that makes sense. Or we could hide the implementation details altogether and simply provide two functions: setDisplay() and getDisplay(). The simpler the library is the better due to the intended audience. I'll see what Python does tomorrow. In the meantime I would really appreciate if you could take the time to review PR #4.

@simonbyrne
Copy link
Member Author

I personally really, really like being able to just assign pixels and have it change immediately.

@Ellipse0934
Copy link
Contributor

PermutedDimsArray makes perfect sense. However I would still like set_pixel() and set_display() functions. That way let these functions manage the flipping and rotation views. Let the led_matrix() stay for advanced users.
led_matrix() = PermutedDimsArray(Mmap.mmap(....), (2,1)) seems to work fine.

@simonbyrne
Copy link
Member Author

One idea I was thinking of was to allow optional arguments to led_matrix specifying the rotation/flipping. The downside is this would be type unstable, but with the constant propagation in 0.7 hopefully this won't be an issue.

@Ellipse0934
Copy link
Contributor

We can do that.
Has there been any progress with the IMU sensor?

@simonbyrne
Copy link
Member Author

No

@simonbyrne
Copy link
Member Author

I should perhaps expand on that.

If you are interested in reading from the IMU, then perhaps the easiest option is to wrap https://github.com/RPi-Distro/RTIMULib (which I think is what Python uses).

Alternatively, you should be able to use the smbus interface, but this would require writing your own calibration and state tracker (RTIMULib uses a Kalman filter).

@Ellipse0934
Copy link
Contributor

Along with the PermutedDimsArray we need a rotation/flipping. How can one create a rotated reference for a 2-D array ? Essentially PermutedDimsArray but for rotr90. If A = [1 2; 3 4] then B = [3 1; 4 2], A and B need to be linked memory wise.
The reason for this is that everyone has their own sense-hat orientation. I would bet that most people use it upside down as it is away from the hdmi connector that way.

@simonbyrne
Copy link
Member Author

You can flip by creating a view with a reverse range, e.g.

@view LED[8:-1:1, :]

If I have my group theory right, I think all we need is flipping and permute dims, as we can get rotations from those: e.g. rotate 90 left would be:

LEDPC = @view PermutedDimsArray(LED, (2,1))[8:-1:1, :]

@simonbyrne
Copy link
Member Author

It would be even better if we could use ImageAxes.jl somehow, as that has this sort of handling built in (though not this particular use case...)

@Ellipse0934
Copy link
Contributor

I only added orientation in PR #8. I didn't see any usefulness in flipping. Should I add it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants