
castlephelps

Now that I have part of Wiggins (my robot arm's name) built with multiple motors and multiple sabertooth/kangaroos all of which are being driven by digital ports on EZ-B and speech recognition via bluetooth headset configured on the computer... I am not using a movement control, only things like Horizontal servo which configured will move a kangaroo controlled motor from 0 to 180. The kangaroo is Teach Tuned to drive left and right from 0 to 360 degrees and the feedback is a 10 turn potentiometer on the pinion of the gear motor.
What I want is to tell Wiggins to turn left a certain number of degrees, for example. So the swivel for Wiggins' arm is a single gear motor driven pivot that rotates 360 degrees and is controlled by a Horizontal servo control so that it moves the full 360 degrees using the 0-180 on the control. Is there a control that turns left and right 180 degrees?
What I want is to be able to tell Wiggins to move a discrete variable distance. For example," Wiggins - rotate left 32 degrees". Or "Wiggins - rotate to 090".
One of these is movement from the current position and then left 32 degrees. The other is to rotate to a constant location.
How do I do this?
All you need is 180 "if" statements for left and 180 "if" statements for right....
Seriously I would use larger "chunk" like commands... for instance right 1deg, 5deg, 10deg, 30deg, 60deg, 90deg, etc.... same for the left...
So say you need 96deg left (from centre)... you say "rotate left 90" then in a second voice command say "rotate left 5deg" and lastly in a third command say "rotate left 1 deg"... total 96deg left...
You could use a script that is fired by saying "Wiggins, move right". The script would set a variable (say $movingdirection) to right. From there, Wiggins would ask "How many degrees?" You would have 1 entry in the speech recognition control for each of the degrees that you want. You would say the number, which could be phonetically correct ("won" for 1 for example, "to" for two). This would set a variable (say $movedistance) to the value.
Your script would set the direction and distance that you want to move and perform the action if there is a valid value in $moveingdirection and $movedistance. It could also set a variable of say $moving to indicate that the motor is moving until it reached its location. From there, you would clear the variables and wait for the next command.
It will be a pain to put in all of the entries into the speech recognition control, but these can be entered once and then used for other things also.
Thanks for the grin! I'm thinking something a bit more elegant might be appropriate - again like setting a variable via voice and then executing that variable... hmmmm
In my solution above, I would put in "Wiggins won" instead of just "won" for 1. The reason is that you want to make sure that when you address your robot, you always put the name in first to reduce the chance that the robot picks up something unintended and runs with it.
David has a good point... That arm you are building (I think you mentioned the ability to move 70lbs or so) could do some serious damage if it should move unintentionally... You need to write your voice commands to be rock solid to avoid any dangerous surprise movements.... It might not be a bad idea to also "cage" the arm for safety...
Limiting damage and unintentional movement is going to be interesting - maybe a 360 degree LIDAR for collision detection... not sure what you mean by "cage".
Would it be asking too much for some sample EZ-Script to get me started?
Castle
You could even get creative with the scripts for the numbers and have it first check to see if the $movingdirection variable has a "Right" or "Left" prior to setting the $movedistance variable.
A couple of other things that I would do... disable speech recognition when your robot is speaking (done through the script) disable speech recognition when the robot is moving. You may want to incorporate a button that can be pressed as an emergency stop that could be hooked up to a digital port and monitored. When pressed, the digital port would go to high for example, and the movement script would send a stop command to the Kangaroo.
I will put together a sample project for you. It will be limited but you will get the idea pretty easily.