Hello fellow Control-enthusiasts,
I have a set-up that I want to implement, and I was wondering if any experts here could donate some wisdom regarding how to implement it.
So, I have a High-level controller (let’s call it HLC) (runs at 2 Hz) that gives me the end-effector poses, and a Mid-level-controller (let’s call it MLC) (runs at 20 Hz) which takes this and performs Differential-Ik to give joint-velocities of the manipulator. These calculated joint-velocities are then sent over to their respective joint-velocity-controller topics to be dealt-with by Ros’s Low-level controllers.
Now, some hurdles that I foresee are as follows:
- Both the HLC and the MLC need to be provided by the current system-state at the time of their execution. So, if the system-state ros-topics are being published at 200-messages a sec and we start at the 0th-message, then the HLC must receive the 100th and 200th message, while the MLC must receive the 10th, 20th,…, 190th, 200th message.
- This act of rejecting the 1st, 2nd, …, and 4th message and then choosing the 5th message to send to the MLC needs to be done by (one) worker, while another chooses the messages for the HLC.
So, all-in-all, I need 4 workers for this job:
- Worker A: One worker to sort messages for the HLC,
- Worker B: One worker to carry-out the task of the HLC,
- Worker C: One worker to sort messages for the MLC,
- Worker D: One worker to carry-out the task of the MLC.
Now, I am planning to use the multiprocessing-package of python to ensure that the timing is maintained:
- Workers A and C will be receiving a queue each, which will be populated at 200 Hz. Every time they receive a message, they will check if it is time to accept the current message or not. If it is time, they will pass it on to their out-going queue (A is outputting at 2 Hz | B is outputting at 20 Hz).
- Worker B will be receiving data at a single-rate (2 Hz), and will be sending out data at 2 Hz.
- Worker D will be receiving data at two-different rates: 2 Hz and 20 Hz. Before starting its work, it will compare the current-time with the expected time-of-arraival of each message.
Now, I was wondering if there is a better way of doing this, especially in regards to having two workers A and C for sorting messages. Any suggestions are welcome.
Regards,
Arnab007