Doing this project with voice recognition only
Forums:
Doing this project strictly with voice recognition I ran into a problem I want the forward button to keep the rover moving forward until I tell it to stop. Since I have no use of my arms I want to start automating it. I'm thinking it has to do with how many cycles per click
piborg
Tue, 12/27/2016 - 11:46
Permalink
Voice recognition
Without knowing how your voice recognition works it is a little tricky to help with this one.
Hopefully I can point you in the right direction :)
In our
diddyWeb.py
script we have two variations on how the controls work.Using
192.168.0.198
as an example IP address for the robot:http://192.168.0.198
- Provides buttons which have to be pressed to change speed.This means clicking Forward will keep going along until Stop is clicked.
http://192.168.0.198/hold
- Provides buttons which have to be held to keep going.This does not work on all devices and may behave strangely with voice controls.
In this case the difference between the two in code is:
The code in
diddyWeb.py
should only change speeds when:The script communicates regularly to grab the camera image, so "no communication" should only happen when the device is not trying to control the robot any more.
Adam
Wed, 12/28/2016 - 00:40
Permalink
Voice recognition
I am using windows speech recognition. So when I open up the web UI in my browser I just say " forward" or any other button and the browser button gets clicked. I've tried changing the onmouseup from off() to on() that didn't work since I'm not using a mouse. I've also tried onmouseover on() so maybe if I hover over it, it would stay on, still the forward button stops after a few revolutions or seconds. I want it so when I say the command like "forward" it would go forward until I say " left" " right" or any other button command, I probably need a while loop . How can I change the time the motors go on per click?
piborg
Wed, 12/28/2016 - 11:27
Permalink
Which link are you using?
Which version of the controls are you using:
http://192.168.0.198
http://192.168.0.198/hold
Adam
Thu, 12/29/2016 - 03:56
Permalink
Voice recognition
I've tried both. Also tried to look at the pico reverse python file, but I'm stuck.
piborg
Thu, 12/29/2016 - 11:38
Permalink
Web UI
I think we should stick with the
http://192.168.0.198
version, this only sends single command when each button is pressed.I suspect your problem is the watchdog timer in the script deciding your browser has disconnected.
If you comment out the following lines in
diddyWeb.py
it should stop the watchdog running:and
To comment a line out add a
#
symbol to the start of the line.Adam
Thu, 12/29/2016 - 20:26
Permalink
Voice webui
I tried commenting out what you told me but I got the following error(uploaded below):
Watchdog not defined! So I tried leaving watchdog= watchdog() alone and comment out the others you told me. Still not working.
What is watchdog and where is it defined? I've also been looking at the other examples like Diddy sequence.py code and there's a part there I took a snippet of the section I uploaded down there. It's under #movement settings, "timeForward1m=5.7" #number of seconds to move. Is there a way to incorporate this code to webui.
Another idea I got was to experiment with under the "httptext+= Drive(1,1)", what is drive and where is it defined?
piborg
Fri, 12/30/2016 - 11:08
Permalink
Disabling the watchdog
My mistake, there are a couple more lines which need to be commented out.
The full list is:
All the watchdog does is check if the browser is still talking to the script.
If it has not seen any messages from the browser for more than 1 second it stops the DiddyBorg moving.
This is why I suspect it may be the cause of your problem.
Adam
Fri, 12/30/2016 - 20:27
Permalink
Voice webui
Thank you so much. Works like a charm. Next I think I wanna make it to avoid obstacles semiautomatic, maybe work with opencv with an extra camera for stereo vision or ultrasonic sensors.
Adam
Sat, 12/31/2016 - 19:58
Permalink
web ui add button
How would I a dd buttons that would control the speed, just by calling out the speed like 100% or 75%. Since I'm only doing this by voice the speed bar at the bottom is kind of complicated to operate by voice.
piborg
Sat, 12/31/2016 - 21:02
Permalink
Speed buttons
What you will need to do is add a button which changes the position of the slider.
For example this is the HTML code for a button which sets the slider to 50% speed:
You will need to add this to the
httpText
values in theelif getPath == '/':
section.This is the finished line for a 50% speed button:
The speed set is the
=50
part, the values are from 0 to 100.The text on the button is the
50%
part.You should be able to add as many buttons as you like :)
The new speed will be used on the next direction button clicked.
clankerr02
Tue, 05/14/2019 - 12:00
Permalink
Adding extra buttons for second picoborg reverse
Hi, using the above modifications to the Web gui script i.e. adding an extra speed/direction control button. How could I use this to control the speed of the motors on a second picoborg reverse connected by daisy chain.
Thanks.
piborg
Wed, 05/15/2019 - 20:05
Permalink
Are the two boards independent?
Are you trying to control the two boards independently, or do they operate as a pair?
clankerr02
Wed, 05/15/2019 - 22:59
Permalink
Yes two boards different axis
Hi thanks for the reply. Once again I'm trying to get my ROV working. The two boards would operate independently of each other. board 1would move the ROV forward and back whilst board 2 would allow the ROV to ascend and descend.
I like the web gui as it would allow me access to the ROV via an CAT5 cable tether and streams video from the raspberry pi.
Yes there are other methods and product out there but I'm trying to soley use a raspberry pi and piborg products.
I've reposted this as a new post so please ignore that one.
piborg
Sat, 05/18/2019 - 22:58
Permalink
Second speed control
This will probably need a few changes to get the behaviour you want to work.
First you will want to duplicate the section that starts:
and give it a new name, such as set2. This should be made to set the power levels on the second board.
Second you will want another slider to select the speed for the board. Look for these lines:
and duplicate them with an id of speed2 instead.
Third you will want a second drive function. Look for these sections:
Make a copy of each with the following changes:
Drive
toDrive2
speed
tospeed2
set
toset2
Finally when you add your new buttons call the new
Drive2
function just like the existing ones do withDrive
. For example:This should allow you to control both the speed and operation of the third axis separately from the first board. You should also be able to create speed buttons in the same way as mentioned earlier in this thread but setting speed2 instead.
clankerr02
Fri, 07/01/2022 - 09:04
Permalink
ROV with 2 picoborg
I've eventually got around to buying my second PicoBorg reverse. I have followed the above instructions (correctly I think)
I'm able to see new buttons in the WeGUI but they do not work as intended.
When dvice 11 is first in the chain it works but not 12. If 12 is placed first it works but not 11. Both devices are detected.
ideally I want two motors on device 11 to control Forward /reverse/left /right. device 12 only has 1 motor for up/down.
Also I need up down buttons on the key board ideally + and - could you help with this?
Hope I make sense.
BTW im only using the / path and /joystick path
P.s just noticed in my attached script (Web.txt) I have commented out i2c 12 this was only for testing and forgot to uncomment it prior to posting.
John
piborg
Mon, 07/04/2022 - 15:52
Permalink
Using two PicoBorg Reverses in a single script
You are only setting up a single
PBR
object in the code, this can only control a single board. To control both at once you will need to setup two objects, sayPBR1
andPBR2
, and set them to the correct address for that board. You can then control each output by using the correct combination of board and motor, e.g.PBR1.SetMotor1
.In the most basic form the setup would now look like this:
A more complete setup based on your current setup code would look something like this:
clankerr02
Wed, 07/06/2022 - 10:18
Permalink
Additional Web ui keyboard buttons
Thank you so much. Using the above script ie 2 picoborg reverse would you be able to help showing me how to add an extra button to the keyboard part of the webui. Again it would control the second picoborg making my RoV to ascend and descend. I use this on my attached laptop.
I'm nearly finished my Rov (submersible) and will post pics and a write up shortly
Thanks again for your help.
John
piborg
Mon, 07/11/2022 - 10:01
Permalink
Adding extra keys
All of the keyboard controls are in the "key management" section of the script.
The first thing is you will want the key codes for raising and lowering. I will use Page Up - 33 and Page Down - 34. This site can tell you what the correct code is for any key you want: https://www.toptal.com/developers/keycode
Start by changing the top section to have a third value for the rise motor
Next you will need to check for these keys and set the rise motor power accordingly.
Now you can add this value to the action section and the two new keys into the
map
value:Don't forget to turn the motors on both boards off in the
/off
section.Adam
Mon, 01/02/2017 - 03:30
Permalink
Thank you
.
timparkinson197...
Sun, 06/18/2017 - 10:39
Permalink
Hi Adam, (or anyone else that
Hi Adam, (or anyone else that can help)
This is exactly what i am trying to do, i am fairly new to all this raspberry pi stuff but loving everything so far,
basically i work with children with additional needs in a school and i am trying to create a buggy (like the diddy borg) to run on voice commands so the children just need to speak to get it to move etc. so far due to my lack of knowlage i am stuck.
please could you tell me (i am using a diddy borg thats all built up and runs perect using the diddyjoy.py sode using a rock candy controller) so basically how do i get that setup to run on voice commands.
you may need to explain it in a very basic way for me as i am still learning lol
many thanks
Tim.