Jump to content

Recommended Posts

Posted

Hey,

 

I've been trying to understand how the inverse kinematic works and found out I need to use a Matrix (many). So I won't be able to just use loads of lists with pybricks. After some more reading I found that I need 'numpy' extension. I don't seem to find it in the 'Visual Studio Code' "extensions" tab.

 

So; Is it possible, and if so, how can I use numpy [or matrix] when running the program on the EV3 bricks alone.

 

50761794567_59dab4c9e7_b.jpg

Posted

Pybricks runs on MicroPython, so regular NumPy for Python won't work with it.

If you are using Python 3 on the EV3, you can install NumPy with:

sudo apt update
sudo apt install python3-numpy

 

There is a numpy-like library for MicroPython at https://github.com/v923z/micropython-ulab but you will need to compile it yourself.

 

Pybricks 3.x will also have a basic Matrix class, but EV3 isn't the focus of the 3.x release, so some things may be broken. You can find daily builds of the `pybricks-micropython` executable for EV3 at  https://github.com/pybricks/pybricks-micropython/actions?query=is%3Asuccess+branch%3Amaster+workflow%3ABuild. (Click on a build then scroll down to "Artifacts" and download "pybricks-micropython".

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...