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

Mouse support (joystick simulator) #17

Closed
bartekxk opened this issue Jan 21, 2019 · 21 comments
Closed

Mouse support (joystick simulator) #17

bartekxk opened this issue Jan 21, 2019 · 21 comments
Assignees

Comments

@bartekxk
Copy link
Contributor

bartekxk commented Jan 21, 2019

Hello, I would like to start participating in the project. I am currently reading the code and came up with the idea of supporting the mouse to using the robot. I'm going to start creating this component. It can be helpful?

@pbustos
Copy link
Contributor

pbustos commented Jan 21, 2019

Hello, yes it could be a nice way to start using RoboComp. Maybe with a Qt window with a crosshair simulating the position of the joystick.
By the way, we are using gitter robocomp related channels to discuss these issues.

@orensbruli
Copy link
Collaborator

orensbruli commented Jan 24, 2019 via email

@bartekxk
Copy link
Contributor Author

bartekxk commented Jan 24, 2019 via email

@orensbruli
Copy link
Collaborator

@bartekxk let us know about your progress with the component to close this issue.

@bartekxk
Copy link
Contributor Author

bartekxk commented Feb 2, 2019

@orensbruli I apologize for the lack of information (due to the exams: /). I tried to understand the code and I will try to implement the component next week (or as much as possible its part).

@orensbruli
Copy link
Collaborator

Ok. No problem. We are not in a hurry with this. Just keep us updated to avoid forgetting to close the issue. Good luck with the exams.

@bartekxk
Copy link
Contributor Author

bartekxk commented Feb 9, 2019

I created my own joystick but with the help of tkinter (because I already knew it). Can I use this library or better if I used PySide? I'm not sure if I can use this in this project.

@orensbruli
Copy link
Collaborator

Hello @bartekxk
Most of the components on robocomp use qt when a UI is needed, so it would be great to have it working on qt. That way we avoid introducing dependency on another graphic library and we keep the coherence on the code examples.
Best.

@bartekxk
Copy link
Contributor Author

Hello @orensbruli
Okay, I created today basic gui in Qt (PySide). I will try to find time in the coming days to improve it and connect it with robocomp.

@bartekxk
Copy link
Contributor Author

Ok, I created GUI but I have a question. Should I create 2 joystick (one for speed and one for rotation) or one joystick for both?
image
What would be better? Maybe create two option with switch button?
Best.

@orensbruli
Copy link
Collaborator

I think that the first idea is better. You usually will want to move and rotate at the same time and I don't see the way to do that with the splitted option, right?
If you want to code a "mode switch" button or menu, it would be also great, but I guess the first option will be the most used one.
Best.

@bartekxk
Copy link
Contributor Author

bartekxk commented Feb 16, 2019

Hello @orensbruli ,
I think that my component is already working. Of course, it's not perfect yet and I'm going to improve it but it seems to me that it looks cool. It would be nice if you looked and tell me your opinion. I would like to do comments and moving the joystick around the circle iin the coming days.
It is here:
https://github.com/bartekxk/robocomp-robolab
You can run it like keyboard robot controller

cd ~/robocomp/components/robocomp-robolab/components/joystickSimulatorController
cmake .
make
src/joystickSimulatorController.py etc/config

Thanks for Your help.
Best.

@orensbruli
Copy link
Collaborator

Hello @bartekxk,

Have you followed this tutorial to create your component?
https://github.com/robocomp/robocomp/blob/stable/doc/robocompdsl.md

Sorry for the delay, busy week.
Best.

@bartekxk
Copy link
Contributor Author

@orensbruli
Hello, no problem.
Sorry, I have not seen that. I will read it and properly correct it.

@orensbruli
Copy link
Collaborator

Ok, @bartekxk thank you. The tutorials are a good point to start, I thought that you had already seen it: https://github.com/robocomp/robocomp/blob/stable/doc/README.md
If you generate your component with robocompdsl it will have the same structure that we are currently using. Save your current component code and you can use it in the new generated one.
Best.

@bartekxk
Copy link
Contributor Author

bartekxk commented Feb 24, 2019

Hello @orensbruli ,
I corrected it according to the tutorial. Works good but I'm not sure if it is perfectly written as in the tutorial. I also added joystick circular motion. I am going to add comments and write readme. Everything is the same as before, here https://github.com/bartekxk/robocomp-robolab .
Best.

@bartekxk
Copy link
Contributor Author

Hello @orensbruli ,
I created merge request. Can you look at this in your free time?
Best.

@orensbruli
Copy link
Collaborator

Hello @bartekxk,
I have been reviewing your code. If you have followed the tutorials you know that most of the custom code for a component is developed on the specificworker.py (or cpp if using C++).
As far as I see, your mouse control code have been implemented on the genericworker.py file which should be avoided, because it's auto generated each time by the execution of robocompdsl
The same is applied to the main file joystickSimulatorController.py. All tour custom code should be moved to the specificworker.py file and class.
Please review the tutorial and check what is done in it.
Thank you.

@bartekxk
Copy link
Contributor Author

Hello @orensbruli ,
Okay, I'll try to improve it in my component. Thank you for your opinion.
Best.

@bartekxk
Copy link
Contributor Author

bartekxk commented Apr 4, 2019

Hello @orensbruli ,
I have moved the specific code to the specificworker.py and I think the component works well. Can you look at this? #20
Thanks.

@rcintas
Copy link
Contributor

rcintas commented Sep 2, 2019

new component added

@rcintas rcintas closed this as completed Sep 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants