Open abkeble opened 2 years ago
I have the same problem, Did you find a solution?
@Seferovic8 @abkeble Did either of you ever find a solution?
@Mcneelsh I never found a solution to this unfortunately.
No, you can't read the position on LeArm; that feature only works on XArm. But, regarding setPosition command, you need to change the xarm library source code. It's defined to set values between 0-1000, but for LeArm, you need to set values between 500-2500 (for all IDs from 2 to 6) and 1500-2500 for ID:1 (gripper). If you need additional help, you're free to contact me.
Good to know, thank you! I've got it figured out for the most part now. Thanks for such a speedy reply, as this was very frustrating when I started.
@Seferovic8 Thank you, this was very helpful for me for setting the position of the LeArm!
I was wondering about getting the position, is that fundamentally not possible to access or would just involve extending this codebase? Shouldn't the servos have some encoders that report their position? If not, how did people figure out the full scope of the controller interface, I'm curious if there is any documentation? (All I see are the hard-coded values in https://github.com/ccourson/xArmServoController/blob/c0b62f7def35019f17916ca24a314ed486657731/Python/xarm/controller.py#L7 but I'm curious where those came from / are they everything?)
I am using xarm to try and control my LeArm 6-DOF robotic arm via a USB connection. I am running on a Windows 10 machine and have pip installed the xarm library, and the libapi library. I am able to connect to the arm and print out the serial number. However when I try and get the position of one of the servos (it doesn't matter which one) I get the following error:
The code I am attempting to run is as follows:
I have inspected the
self._input_report
variable and it is set to an empty listAny help would be appreciated!
Additionally, I am also confused about how the setPosition function works, when I pass an angle of 0.0 the servo moves to its minimum value, and when I set 125.0 (which seems to be the max value from the docs) the servo only moves about 45 degrees from the 0.0 position, and any negative value I pass does nothing. Is there something I am misunderstanding, why can't I get the full range of motion for the servos?