
blapaz
I received my JD Humanoid a few days ago, and I have to say that so far I am very impressed!
My idea was to be able to ask something along the lines of "whats your battery level" and have JD give me a response. The response either in the form of percentage or number or whatever.
I know that anything is possible in programming, but I know there may be limits with the robots right now.
However, I thought I would ask and see if anyone had ideas or if this has already been done.
Thanks!
*As a note, I do know that the humanoid alerts you when the battery is low. That is how I started to think about this idea.
Code:
Add that to the speech recognition control as a response to "what is your battery level".
The only thing I don't understand is do I have to find the variable that is already build in to the system or do I have to set it up?
You meantioned something about variable watcher.
The rest of that you shared makes complete sense to me though.
1) load ARC
2) load your JD project
3) press PROJECT -> ADD CONTROL -> AUDIO -> SPEECH RECOGNITION from the top menu
4) press the ? question mark on the speech recognition control and read the tutorial to understand it before continuing
5) now press the GEAR icon on the speech recognition control
6) add your phrase "what is your battery voltage?"
7) press the multi line script edit button, as you learned from the activities in the learn section and paste this code...
Code:
And I understand the speech recognition and such, just didn't know about the variable.
Thanks for the great product!
Yes - the battery capacity is rated at 7.4 volts. If your robot is returning that voltage, the battery is quite charged. A freshly charged battery will start at around 8.2 volts... The battery saver will kick in at 7 volts, because using a battery below 7 volts has too high of a discharge rate and damage will be done to the lipo. Lipo batteries use a similar but different approach with the chemicals over a traditional battery. Where a traditional battery can be completely discharged, a lipo can not. Also, a lipo can provide a huge number of amperage while operating within it's efficiency charge capacity. Meaning, each battery has a chart displaying efficiency and the ez-robot lipo's are above 7v for optimal efficiency.
If an ez-robot lipo is used below 7v, the discharge is too quick due to poor efficiency and the battery will be damaged.
So, back to your first question - how to turn this value into a percentage? Let's play with math!
Code:
Here's what i'm doing...
1) get the voltage and subtract 7
2) divide the value by 1.2 to get a percent (this is because 8.2 is the max, so subtracted by 7 means it's 1.2).
3) multiple the value by 100
4) round the response to 1 decimal place
Battery voltage subtracted by 7, divided by 1.2, multiplied by 100 and rounded to the first decimal place.
*note: if your freshly charged battery is showing a voltage of 8.5, for example, change the 1.2 to 1.5.
I love learning extra things so thank you.
You can do a simple guess-timate, however...... The ezb4 and camera use about 180mA... a servo can use anywhere from 20MmA to 1 - 2amps depending on how much it is used and how much load is on it... LEDs maybe 20Ma... so
X = hours of operation
X = 1300/ (180 (ezb)+500mA (servo)+ 20mA(LEDS))
X = 1.85hrs (this will vary widely though as it depends on what the servo is doing)