Tasks sequence
Posted: 12 Sep 2021, 16:26
Hi,
I got a Bill on path model and a UR10 robot and I would like to develop a sequence of tasks that involve both the models.
The Bill model stops when it has followed the 60% of its path, then it sends an integer signal to start the movement of the robot.
I was able to get this using the following code:
Bill's child script:
UR10's child script
This works fine, but I'm not able to stop the Bill model until the robot ends his task.
I tried creating a new integer signal into the robot code as follows:
But this solution doesn't work.
When Bill reaches the 60% of the path, the 'Human_TP' signal is sent to the robot, which starts its movement, but the Bill model doesn't stop, he continues to move.
In order to be clear, this is the sequence that I would like to get:
[*]1 - Bill walks on path
The robot is not moving
[*]2 - Bill reaches the 60% of the path, sends the signal and stops.
The robot starts moving
[*]3 - Bill stays at the 60% of the path
The robot performs its task
[*]4 - The robot ends its movement and sends a signal to let Bill move
Bill restarts his path
Right now, I was able to achieve the first 2 points, but I didn't figure out how to make Bill stop once he sends its signal.
I cannot set a time-related stop (using a wait command), because I don't know how much time the robot needs to complete its task, so I've tried with a sim.waitForSignal command, but I doesn't work.
Have you any suggestion about that issue?
Cheers
I got a Bill on path model and a UR10 robot and I would like to develop a sequence of tasks that involve both the models.
The Bill model stops when it has followed the 60% of its path, then it sends an integer signal to start the movement of the robot.
I was able to get this using the following code:
Bill's child script:
Code: Select all
if currentPosOnPath>pathL*0.59 and walkingDir>0 then
sim.setIntegerSignal('Human_TP',1)
end
Code: Select all
Robot_start=sim.waitForSignal('Human_TP')
if Robot_Start then
sim.setJointTargetVelocity(simJoints[1],maxIkVel[1])
sim.setJointTargetVelocity(simJoints[2],maxIkVel[1])
sim.setJointTargetVelocity(simJoints[3],maxIkVel[1])
sim.setJointTargetVelocity(simJoints[4],maxIkVel[1])
sim.setJointTargetVelocity(simJoints[5],maxIkVel[1])
sim.setJointTargetVelocity(simJoints[6],maxIkVel[1])
moveToConfig_viaFK(maxConfVel,maxConfAccel,maxConfJerk,initConf,data)
moveToPose_viaIK(maxIkVel,maxIkAccel,maxIkJerk,Target_1,data)
moveToPose_viaIK(maxIkVel,maxIkAccel,maxIkJerk,Target_2,data)
moveToPose_viaIK(maxIkVel,maxIkAccel,maxIkJerk,Target_3,data)
moveToPose_viaIK(maxIkVel,maxIkAccel,maxIkJerk,Target_4,data)
end
I tried creating a new integer signal into the robot code as follows:
Code: Select all
Tip_pos=sim.getObjectpose(simTip,-1)
if Tip_pos>Target_3 then
sim.setIntegerSignal('Robot_Finish',2)
end
When Bill reaches the 60% of the path, the 'Human_TP' signal is sent to the robot, which starts its movement, but the Bill model doesn't stop, he continues to move.
In order to be clear, this is the sequence that I would like to get:
[*]1 - Bill walks on path
The robot is not moving
[*]2 - Bill reaches the 60% of the path, sends the signal and stops.
The robot starts moving
[*]3 - Bill stays at the 60% of the path
The robot performs its task
[*]4 - The robot ends its movement and sends a signal to let Bill move
Bill restarts his path
Right now, I was able to achieve the first 2 points, but I didn't figure out how to make Bill stop once he sends its signal.
I cannot set a time-related stop (using a wait command), because I don't know how much time the robot needs to complete its task, so I've tried with a sim.waitForSignal command, but I doesn't work.
Have you any suggestion about that issue?
Cheers