hello,
In my robot path planning algorithm that run in threaded child script(khepera robot) suppose from initial position to goal position robot stop in 5 step to find next position to achieve the goal position. I need "hokuyo urg 04lx ug01" sensor output that run in threaded child script . I change "hokuyo urg 04lx ug01" Non-Threaded child script to threaded child script because It's not always necessary to check for obstacle in my work.
so I need to call "hokuyo urg 04lx ug01" child script run when I want before each step in khepera robot threaded child script. How can i do it?
In addition I use sim.setStringSignal to send data from "hokuyo urg 04lx ug01" child script to khepera robot threaded child script and it works.
thanks,
In threaded child script call another child script to run again
Re: In threaded child script call another child script to run again
how would you identify when the robot has to stop?
do you repeatedly check if the robot's position is close to some landmark (i.e. their distance is below some threshold)?
do you repeatedly check if the robot's position is close to some landmark (i.e. their distance is below some threshold)?
Re: In threaded child script call another child script to run again
you can consider setting a boolean signal to true from the robot script, that will trigger obstacle detection in the sensor's script i.e. you repeatedly check if this signal value is true and if so start the computation, and set the signal value back to false after that
Re: In threaded child script call another child script to run again
I disabled sensor script and put all codes in function and copy all in robot script out of function sysCall_threadmain()
Robot script
In this way when l call laser() in while loop it works, is it correct ? Or may cause time complexity or conflict ?
Robot script
Code: Select all
Function laser()
All sensor script code
Return x
End
function sysCall_threadmain()
Call laser
End