-
Notifications
You must be signed in to change notification settings - Fork 3
Enhance controlling manually braccio #73
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
Conversation
Memory usage change @ ffd88d7
Click for full report table
Click for full report CSV
|
I updated the code with the Braccio.lvgl_lock/unlock statements and commented on it. The code is good, but it is slow to respond to the commands with the joystick. That is something that we don't see in the project 02 code. With this new example, we will have two similar codes ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is okay, but please check the message in the thread.
I couldn't test it with the braccio attached, tomorrow morning I'm going to investigate on it. It might be due to the delay inside the if statement of the loop. Is a scope creep of this PR - but - a refactoring in the library on how the lvgl driver functions are exposed would be helpful in order to allow to customize the KEY events paired with the physical buttons. This slowness would be surely overcome if all input buttons could be read as KEY_ENTER events in this sketch, making possible to use the LV_EVENT_PRESSING and LV_EVENT_RELEASED inside the event handler when left,right,up,down joystick buttons are used. |
After you test it, you could try to create multiple screens for each layout (shoulder, elbow, wrist, and gripper), or you can delete the button matrix object and recreate it again with the new design. I think one of these updates should fix the problem. |
In the code, it was missing the Braccio.lvgl_lock/unlock statements to avoid multi-threaded access to LVGL.
414975a
to
5ff8dde
Compare
Good input, I'll take it into considerations. |
I did a fair bit of rework on the example. Please test it and let me know what you think. I'm experiencing a bit of jerkiness of the arm which is caused due to |
This code is the most stable of all. I ran the code many times, and it worked most of the time correctly. Now, the response of the movements when we move the joystick is quick. Once or twice, I had to restart the Arduino because the movement of the Elbow and the wrist didn't work well, but I couldn't figure out why it was necessary. |
Enhanced version of the manually-controlling-braccio example:
Note: since the driver definition and hardware buttons mapping happens inside the library and that only the "KEY_ENTER" lvgl input triggers the LV_EVENT_PRESSED/PRESSING/RELEASED, is not possible to achieve a "push button" behavior without adding a routine in loop that check if Braccio.getKey() has changed to zero in order to remove the checked state.
The definition of another input driver for this example where each input is identified as KEY_ENTER would make possible to exploit the states of lvgl with all the physical inputs.