No overlapping blend, I think. this gives a different error message. I indeed calculate the next points while moving. The script is pretty complicated. But I try to give you an idea of what I am doing with a simplyfied excerpt (trying to keep the essential portions):
This piece of script does the movement:
#some constants:
global FaceDown = p[0,0,0,PI,0,0]
global PutDistance=0.1 # 10cm
local Angle = 3.14159/4
local InFrontOfBox = p[0.15, -0.1, PutDistance, 0, 0, 0]
local StartPose = pose_add( InFrontOfBox, FaceDown)
local StartingPose = pose_add( pose_add(InFrontOfBox, p[0, 0.1, 0, 0,0,0]), FaceDown )
local SwingHerePose = pose_add( pose_add(InFrontOfBox, p[0.0, 0.05, 0, -Angle, 0, 0]), FaceDown )
local SwingTherePose = pose_add( pose_add(InFrontOfBox, p[0.0, 0.3, -PutDistance/2, Angle, 0, 0]), FaceDown )
# the SAxPTP basically results in a movej with the corresponding joints vector (see below):
SAxPTP( StartPose )
SAxPTP( StartingPose )
SAxPTP( SwingHerePose )
# I need to set Blend to zero (otherwise error: "sudden change in target position" in the next SAxPTP)
local OldBlend = CurPTPBlend
CurPTPBlend = 0
SAxPTP( SwingTherePose )
CurPTPBlend = OldBlend
SAxPTP(StartPose)
Note the line “CurPTPBlend=0”. If I comment out this line, I get the error, while it is working, if I leave the line active. I have chosen the CurPTPBlend to be 1 cm:
global CurPTPBlend = 0.01 # 1cm
SAxPTP does something with a 7th axis and then a goes to function “PTP”, which is basically a “movej” (see last line). But I try to find a joints vector, which I can accept:
def PTP( ToPose ):
#<some calculation to find a good myQNear>
local ToJoints = get_inverse_kin( ToPose, myQNear )
#<maybe some more calculation to find a good myQNear>
ToJoints = get_inverse_kin( ToPose, myQNear )
#<additional calculations on ToJoints to make it acceptable for me>
local FromPose = get_forward_kin()
local FromJoints = get_target_joint_positions()
Debug( "PTP-Pose: " + to_pose_str(ToPose) + " ->Joints: " + to_joints_str(ToJoints) )
Debug( "frm-Pose: " + to_pose_str(FromPose) + " ->Joints: " + to_joints_str(FromJoints) )
movej( ToJoints, a=CurPTPAcc, v=CurPTPSpeed, r=CurPTPBlend )
end
That’s it.Quite some portion of code, but I think, not too difficult to understand. I replaced some calculation by the comments “<…>” to make the code piece shorter.
The resulting logging looks like this (note the lines with “C204”):
12:01:38.983 BigPose=[ 150mm /-800mm /600mm /-0.000152° /0° /-0° ] 7=450mm SmallPose=[ -300mm /-800mm /600mm /-0.000152° /0° /-0° ]
12:01:38.984 PTP-Pose: [ -300mm /-800mm /600mm /-0.000152° /0° /-0° ] ->Joints: [ 57.683116° /-69.591028° /97.950747° /-118.359848° /90.000081° /32.316884° ]
12:01:38.985 frm-Pose: [ 401.632217mm /601.48701mm /992.970922mm /-0.191059° /0.209549° /0° ] ->Joints: [ 222.334672° /-88.486855° /80.052865° /-81.282435° /89.999888° /-132.334672° ]
12:01:43.712 BigPose=[ 150mm /-900mm /600mm /-0.000152° /0° /-0° ] 7=450mm SmallPose=[ -300mm /-900mm /600mm /-0.000152° /0° /-0° ]
12:01:43.713 PTP-Pose: [ -300mm /-900mm /600mm /-0.000152° /0° /-0° ] ->Joints: [ 60.987276° /-61.528116° /85.898959° /-114.370975° /90.000074° /29.012724° ]
12:01:43.714 frm-Pose: [ -290.531525mm /-803.431402mm /601.636895mm /-0.000151° /-0.000002° /-0° ] ->Joints: [ 58.357763° /-69.668699° /97.874992° /-118.20642° /90.00008° /31.642237° ]
12:01:44.115 BigPose=[ 150mm /-850mm /600mm /-45.000114° /0° /-0° ] 7=450mm SmallPose=[ -300mm /-850mm /600mm /-45.000114° /0° /-0° ]
12:01:44.117 PTP-Pose: [ -300mm /-850mm /600mm /-45.000114° /0° /-0° ] ->Joints: [ 61.923169° /-54.494834° /79.454566° /-156.382361° /109.439061° /20.66606° ]
12:01:44.117 frm-Pose: [ -300.681549mm /-889.56923mm /600.462259mm /-0.000152° /0° /-0° ] ->Joints: [ 60.636334° /-62.384495° /87.179005° /-114.794642° /90.000075° /29.363666° ]
12:01:45.023 7th axis goes to: 450
12:01:45.023 BigPose=[ 150mm /-1100mm /650mm /44.99981° /0° /-0° ] 7=450mm SmallPose=[ -300mm /-1100mm /650mm /44.99981° /0° /-0° ]
12:01:45.024 PTP-Pose: [ -300mm /-1100mm /650mm /44.99981° /0° /-0° ] ->Joints: [ 64.125541° /-50.959651° /51.845493° /-48.906657° /72.02627° /18.930138° ]
12:01:45.024 frm-Pose: [ -298.037408mm /-850.671169mm /606.358957mm /-41.698852° /1.07528° /-0.351114° ] ->Joints: [ 61.789538° /-55.423549° /80.312428° /-153.456596° /107.302283° /21.748594° ]
12:01:46.937 :: -2 :: C204A1:6 :: null :: 2 :: :: :: 0
12:01:46.937 BigPose=[ 150mm /-800mm /600mm /-0.000152° /0° /-0° ] 7=450mm SmallPose=[ -300mm /-800mm /600mm /-0.000152° /0° /-0° ]
12:01:46.938 PTP-Pose: [ -300mm /-800mm /600mm /-0.000152° /0° /-0° ] ->Joints: [ 57.683116° /-69.591028° /97.950747° /-118.359848° /90.000081° /32.316885° ]
12:01:46.938 frm-Pose: [ -306.648104mm /-1095.102861mm /643.815867mm /41.956719° /-1.281293° /-1.30978° ] ->Joints: [ 63.952646° /-51.235684° /53.746496° /-53.011899° /74.461284° /19.0669° ]
12:01:46.943 :: -3 :: C204A1:5 :: 3 :: 1 :: :: :: 0
12:01:47.035 bullmer :: Program bullmer stopped
Can you see any potential problems?