Timed exit while loop. Best way?
Yes it is realtimeI think this would be considered real time but I am not sure?
ArcEye, I am building my code based on the Orac Toolchanger you wrote. I am just changing some things to make it work with my setup. The biggest issue I had with the Orac Toolchanger code is from my amateur eyes, contains loops that will go on to infinity if it never gets the right signal.
The Orac does not use a turret clamp signal, it reads the greyscale and divines whether it is at the required position.
Since the required tool position comes up once every 360 degrees it cannot loop forever, it either errors and exits if a false reading is returned or stops when it reads the required tool number.
If you have a signal that may never occur if there is an error, just decide how long you are willing to wait, use a timer for that period, after which abort with a message.
You just need to set a progress_level that tests for the signal and checks the timer and when the timer expires goes to an error state, or if found continues
(see the default: and progress_level 10: in the Orac code which print a message and sit there doing nothing when an error occurs)
The other issue I have with the timer in the Orac file is installing this: sudo comp --install timedelay2.comp The file is nowhere to be found so it says.
That header is out of date sorry, just use the standard timedelay component.
I did write my own initially but decided that was silly and just used the stock one
regards
Please Log in or Create an account to join the conversation.
loadrt weighted_sum wsum_sizes=4
addf process_wsums servo-thread
net turret-encoder1 wsum.0.bit.0.in <= hm2_5i25.0.gpio.016.in
net turret-encoder2 wsum.0.bit.1.in <= hm2_5i25.0.gpio.017.in
net turret-encoder4 wsum.0.bit.2.in <= hm2_5i25.0.gpio.018.in
net turret-encoder8 wsum.0.bit.3.in <= hm2_5i25.0.gpio.019.in
net sum-out <= wsum.0.sum
I am unable to get sum-out to change in the hal meter and I have verified the gpio pins are working with the hal meter. Any suggestions?
Please Log in or Create an account to join the conversation.
Is the weighed-sum component added to a thread? And is the thread running?I am unable to get sum-out to change in the hal meter
ie: does weighted_sum appear in an "addf" statement?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
You need both a "loadrt" and an "addf" for each component.
Please Log in or Create an account to join the conversation.
loadrt weighted_sum wsum_sizes=4
in my hal file. I can post the whole thing if thats easier to look at?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
You will need to look at the manual page for each component to see what the functions are called. Some components have a single function for all instances, but most have a function for each instance.
The functions run in the order that they are added to the thread. This sometimes matters. You want to add the functions that feed data to each other in the right order.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.