Where is joint_pos coming from, and why are you overwriting lpos if you are pulling that from a PR? Why pull lpos from a PR at all? This is probably where your uninit error is coming from.
Joint POS is coming from another application(App2) running in the cloud. App2 receives robot's work cell picture and process it with CNN to detect object to pick and does geometric transformations and provide joint angles for the the object that needs to be picked.
My middleware application (Python script) receives the Following is the message received from App2:
{
"RequestId":"0a69389d",
"TimeStamp":"2021-12-16 13:48:53Z",
"Tcp":{"xyz":[0,0,0],"rijk":[1,0,0,0]},
"Pose":{"xyz":[0,0,0],"rijk":[1,0,0,0]},
"InverseKinematicSolutions":
[
{"j1":[0,-28,-35,0,-55,0]},
{"j2":[2.090,-13.947,35.395,-9.524,-118.506,-6.663]},
{"j3":[-0.821,-4.007,48.883,-11.750,-132.158,-7.106]}
]
}
Display More
The joint angles in the message are dummy (taught randomly for testing). J1 and j2 are reachable locations on the other hand J3 is not readable.
I a position is not reachable then middleware starts the camera cycle for a new picture and sends it to App2. The following picture shows the big picture of the use case. A lot of steps for APP1(middleware) has been completed.