Hi!
We are trying to access the position of our robot at all time in a UFRAME and UTOOL who are unactive in a backgroud logic program. For this, we need to run a KAREL program in the background. In this program, I'm trying to put the Position register in a Register. I have this code for the infinite loop to put the positon in a PR :
How do I put the Position Register to a Register in KAREL? I tried to use SET_INT_REG like this :
Code
REPEAT
Actual_POS = CURPOS(0,0,1)
SET_INT_REG(1,Actual_POS.x,status)
SET_INT_REG(2,Actual_POS.y,status)
SET_INT_REG(3,Actual_POS.z,status)
SET_INT_REG(4,Actual_POS.r,status)
DELAY 50
UNTIL stopLoop
But this code gives an error because the Actual_POS.n is not an integer.
Is there a way to convert a real to an integer without loosing precision?
Thank you!