benbusby / piro

A Raspberry Pi security camera rover
MIT License
100 stars 17 forks source link

Mobile servo controls #14

Open ufulu opened 5 years ago

ufulu commented 5 years ago

Me and my kid had a great time with raztot so far, thank you again for that! We checked out your mobile-controls branch and while it works, it feels buggy as the commands (i.e. touchend) don't seem to be transmitted directly and the robot keeps on driving after the touch is ended. While searching for a smoother solution I stumbled accross the following repo: https://github.com/ufulu/robotcontrol-javascript and wanted to know your thoughts if this could and should be integrated? While I have been tinkering around with python, flask and JavaScript for a bit in other mini projects I am not quite sure how to incorporate these controls on my own.. :/

benbusby commented 5 years ago

The mobile controls branch is still a work in progress, which is why it's in a separate branch and not in master. Generally feature branches are for features that still are in development, so it isn't intended for actual use just yet. When I have some more free time I'd like to look back into it, but for now that branch has become kinda stale. I believe the main problem you're encountering could be fixed by tweaking the tolerance for sending the command to stop movement, which should be a simple fix.

I just looked into that repo you mentioned, and it looks like a good alternative for the UI, but I don't think all of the other non-UI aspects of the repo would be necessary since they're already implemented in the raztot. The joystick elements could easily be integrated to call the startMovement and stopMovement functions in response to movement in a particular direction, and would likely have better accuracy/tolerance than the swipe controls I was testing out.

I'd like to keep the websocket controls as simple as possible, and I believe there could be a simple way to combine a similar sort of UI approach of the repo you mentioned with the current design of the raztot, but I don't think it would be a drop-in solution. Eventually I'll get back to working on the mobile controls and I'll take this into consideration. Or (if you're comfortable with it) you could take a crack at it, and if you get a working solution then you could open a pull request and I'll review it.