Wait command for thread

Hi,

Currently attempting to add a wait command to a thread to better manage the timing.

Ideally, the high level logic would be Wait ‘Robot at Conveyor_Pounce’

‘Conveyor_Pounce’ is a programmed pose which is selectable as such. I just can’t seem to rack my brain around the function required to run this ‘compare’ to the live robot pose.

Does anyone have any initial ideas?

Cheers!

Zac

An easy approach would be to have a global boolean variable that you set on your main thread when the robot reaches there.’

# Before_Start
gobal robot_at_conveyor_pounce = False # init value

# Robot program
gobal robot_at_conveyor_pounce = False # do this if the program runs in a loop
do_stuff()
move_to_conveyor
  - Waypoint_1
  - Waypoint_2
  - Conveyor_Pounce
gobal robot_at_conveyor_pounce = True

# Thread_1
wait while (not robot_at_conveyor_pounce)

Hope this helps