Adds simulation and mockup threads for drilling machine plugin#13
Adds simulation and mockup threads for drilling machine plugin#13moriarty wants to merge 4 commits intorockin-robot-challenge:rockinfrom
Conversation
cfg/config.yaml
Outdated
There was a problem hiding this comment.
In my opinion we can enable the simulation by default. What do you think?
|
Besides my comments this looks good. Please fix or provide feedback. |
|
@svenschneider - feedback has been integrated |
There was a problem hiding this comment.
This together with the last line in this function leads to a horrible lockup of the complete CFH:
- The scoped lock is acquired here
- In the last line the thread goes to sleep, but does not release the lock. Therefore, all calls that also need to lock the mutex will wait.
My proposal is to manually release the lock before sending the thread to sleep.
Additionally, why is the variable here (and in other places) called lock2?
|
Please integrate the feedback, squash the commits appropriately and update the pull request. When squashing the commits please also update the commit messages. The convention for the subject line is "component: message", where the message is all lower-case and limited to 50 characters. Component is the "top-level" folder of the changed file(s), here component should be "plugins" (within the rockin folder). |
|
Any update? |
- Adds simulation and mockup threads for drilling machine plugin - Default Drilling Machine config to simulation
6b4fb07 to
17b1dde
Compare
|
@svenschneider - update, I fixed all the feedback and rebased squashing commits. I used There are still some comments about locking the mutex. Should I be locking it there? |
|
The existing code (hopefully) may work because the variable that is read, and concurrently written from somewhere else, atomically. Therefore, the assumptions for this code being correct are:
Thus, in my opinion the safe way is to lock the mutex for each access (read and write). Could you please check if this has any noticable effect? |
|
@svenschneider I've added the lock(clips_mutex) to both the simulation and real thread. |
There was a problem hiding this comment.
I just saw that this is "spamming" the terminal. Therefore, I would suggest to use "logger->log_debug([...])".
There was a problem hiding this comment.
should I modify that in the other plugins as well? And the non-simulated versions?
|
Thanks, there is one more minor issue about the logging. When that feedback is integrated, we should be ready to go. |
|
I removed some of the logging and switched some log_debug as suggested. |
Adds drilling_machine_simulation_thread and drilling_machine_mockup_thread
In simulation mode, the drilling machine the operation is simulated.
In mockup mode, clips functions are exposed but nothing is simulated.
This pull request closes #10. Feedback and re-factoring has been incorporated.