I make one seonr to monitor the angle of robort arm. Now I try to make the arm stop with function(step) when the seonsor is active. I think there are wrong about the time setting in the function. Should I get the action time of senor, then set into the funtion of stopping-step function? If yes, which command can i use?
In your SENSOR, you can return the time at which the sensor is triggered by enabling the Event Evaluation option and setting it to Run-Time Function. Here you can simply enter the string time for the function.
The in your Solver script for stopping the motion, you simply need to subtract this sensed time from the time in the new STEP() function like so:
In your SENSOR, you can return the time at which the sensor is triggered by enabling the Event Evaluation option and setting it to Run-Time Function. Here you can simply enter the string time for the function.
The in your Solver script for stopping the motion, you simply need to subtract this sensed time from the time in the new STEP() function like so: