I was trying to test the right arm in myrobotlab. So I added several lines for the right arm in InMoov2.minimal.py so it looks like this:
i01.startRightHand(rightPort)
# tweaking defaults settings of right hand
i01.rightHand.thumb.setMinMax( 35,145)
i01.rightHand.index.setMinMax( 35,148)
i01.rightHand.majeure. setMinMax(35,149)
i01.rightHand.ringFinger. setMinMax(36,149)
i01.rightHand.pinky.setMinMax( 37,149)
i01.rightHand.thumb.map(0,180, 35,145)
i01.rightHand.index.map(0,180, 35,148)
i01.rightHand.majeure.map(0, 180,35,149)
i01.rightHand.ringFinger.map( 0,180,36,149)
i01.rightHand.pinky.map(0,180, 37,149)
#################
i01.startRightArm(rightPort)
# tweak default RightArm
i01.rightArm.bicep.setMinMax( 46,120)
However, when I execute the code, the bicep was trying to go to 0, and it completely ignored the limit I set (46,120). I was told the servo will go to Gael's default rest angle (0) before the setMinMax() takes effect. Is there a function to override this? Thanks for any help!
Hello Dr Robot and Welcome
Hello Dr Robot and Welcome !
You can "create" & "adjust" before you "start"
In your script your starting before adjusting ...
More like this :
An analogy would be mapping is like adjusting volume, while min/max clip the output..
Thanks GroG! I was using i01
Thanks GroG! I was using
i01 = Runtime.createAndStart("i01", "InMoov")
at the very beginning of the script, so now should I change it to
i01 = Runtime.create("i01", "InMoov")?
It seems to me that setMinMax and map are redundant with each other, should I just use one or the other (map seems better)? Also, someServo.setRest(75), is the input 75 a value before or after mapping?
PS, I'll change my avatar soon, that one is set by default:)
i01 =
i01 = Runtime.createAndStart("i01", "InMoov")
this returns the "InMoov" service ... its can create to other Servo services... so it does not return a servo..
It does not directly own or control Servos...
This
rightHand = Runtime.create("i01.rightHand","InMoovHand")
is an InMoovHand (see the second parameter) ... it has all the finger servos
When you create a hand - it creats all the finger servos.. so I'd recommend you look closely at the example I previously provided.
the reason the "InMoov" service does not directly create "everything" as soon as it starts, its because many people don't have all the parts ...
Try experimenting with the right hand statement and sample I posted
MinMax is clipping output
Map is mapping input & output ranges ... they in some ways can produce similar results - but they control different things.
It will take a while to get familiar.. don't hesitate asking questions... pleanty of friendly elves here...
Thanks a lot! I just tested
Thanks a lot! I just tested the script after I made the changes you suggested, it worked great except a minor issue with the voice. Here is the full script I have now:
Not sure ... What version are
Not sure ...
What version are you using?
Send a NoWorky and we'll look at it ...
myrobotlab.org/content/helpful-myrobotlab-tips-and-tricks-0#noWorky
Never mind. I was using
Never mind. I was using 1.0.119, which is the latest version I found under the download link. Later I found out I can download the latest build above the shout box:) I am running 1.0.1349 now and the voice works fine.