Having a weird problem since weeks. Up to version 1.0.80 all worky, version 1.0.81 to 1.0.95 the right arm servos are not getting attached. At least the way I used to do.
Back to the roots I made a simple Python script to go thru all limbs. My usual procedure is e.g.:
1. create right hand - 2. set min/max, rest, mapping - 3. start right hand ####please see Python script
This way it gets created, sets its values and starts. Perfect!
The procedure works for all limbs except the right arm. It appears, but it's not attached and I can't even attach it manually, I can set the Arduino to "right" and all the pins. Clicking "attach" doesn't do nothing. See here:
I checked the log and found this. [Thread-6] INFO class org.myrobotlab.framework.Service - right arm already started (so I removed the i01.startRightArm(rightPort) and it still starts up + not attached as before).
Left arm and right hand worky perfect, no error message. It's always the right arm.
If I start the limbs before setting min/max, rest, mapping they all go crazy. Otherwise perfectly set.
The test script (right hand and left arm work, right arm no worky):
import random
rightPort = "COM5"
leftPort = "COM4"
i01 = Runtime.create("i01", "InMoov")
i01.rightHand = Runtime.create("i01.rightHand","InMoovHand")
i01.leftArm = Runtime.create("i01.leftArm","InMoovArm")
i01.rightArm = Runtime.create("i01.rightArm","InMoovArm")
i01.rightHand.thumb.setRest(0)
i01.rightHand.index.setRest(30)
i01.rightHand.majeure.setRest(40)
i01.rightHand.ringFinger.setRest(60)
i01.rightHand.pinky.setRest(20)
i01.rightHand.wrist.setRest(20)
i01.rightHand.thumb.setMinMax(0,160)
i01.rightHand.index.setMinMax(10,160)
i01.rightHand.majeure.setMinMax(40,170)
i01.rightHand.ringFinger.setMinMax(30,150)
i01.rightHand.pinky.setMinMax(0,160)
i01.rightHand.wrist.setMinMax(10,170)
i01.rightHand.thumb.map(0,180,0,160)
i01.rightHand.index.map(0,180,10,160)
i01.rightHand.majeure.map(0,180,40,170)
i01.rightHand.ringFinger.map(0,180,30,150)
i01.rightHand.pinky.map(0,180,0,160)
i01.rightHand.wrist.map(0,180,10,170)
i01.startRightHand(rightPort)
i01.leftArm.bicep.setRest(0)
i01.leftArm.rotate.setRest(110)
i01.leftArm.shoulder.setRest(96)
i01.leftArm.omoplate.setRest(99)
i01.leftArm.bicep.setMinMax(0,120)
i01.leftArm.rotate.setMinMax(40,168)
i01.leftArm.shoulder.setMinMax(0,180)
i01.leftArm.omoplate.setMinMax(99,170)
i01.startLeftArm(leftPort)
i01.rightArm.bicep.setRest(0)
i01.rightArm.rotate.setRest(110)
i01.rightArm.shoulder.setRest(90)
i01.rightArm.omoplate.setRest(0)
i01.rightArm.bicep.setMinMax(0,70)
i01.rightArm.rotate.setMinMax(40,168)
i01.rightArm.shoulder.setMinMax(20,160)
i01.rightArm.omoplate.setMinMax(0,100)
i01.startRightArm(rightPort)
@GroG I tried your suggestion using e.g.:
import random
rightPort = "COM5"
i01 = Runtime.create("i01", "InMoov")
ra = Runtime.create("i01.rightArm","InMoov")
ra.rightArm.bicep.setMinMax(0,60)
ra.rightArm.rotate.setMinMax(65,150)
ra.rightArm.shoulder.setMinMax(30,100)
ra.rightArm.omoplate.setMinMax(10,75)
i01.startRightArm(rightPort)
Receiving error "File string, line 8, in moduleAttributeError: NoneType object has no attribute bicep".
Why just the right arm?
Why does it say "right arm already started"? I think here is the problem.
This way it works but the min/max are just set after the servos started and servos go wild:
import random
rightPort = "COM5"
i01 = Runtime.create("i01", "InMoov")
i01.startRightArm(rightPort)
i01.rightArm.bicep.setRest(0)
i01.rightArm.rotate.setRest(110)
i01.rightArm.shoulder.setRest(90)
i01.rightArm.omoplate.setRest(0)
i01.rightArm.bicep.setMinMax(0,70)
i01.rightArm.rotate.setMinMax(40,168)
i01.rightArm.shoulder.setMinMax(20,160)
i01.rightArm.omoplate.setMinMax(0,100)
My Bad ! 1 small mistake -
My Bad !
1 small mistake - its Runtime.create( named instance, type) .. I got the "type" wrong for the arm should be InMoovArm - like this
The root design problem is
The root design problem is this - you and the Java service are clashing trying to get things done.
Given the following :
What is happening is you are modifying the internals of the InMoov service without the service knowing about it.
It happens right here :