-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Food on Fork node V1 #32
Conversation
# 1. Distance threshold (Note: to index into cv img, we need (row, col) format | ||
# -> https://stackoverflow.com/questions/9623435/image-processing-mainly-opencv-indexing-conventions) | ||
min_dist = unchanged_depth_img[(tine1_row, tine1_col)] - 20 # distance @ left-most tine - 2 cm | ||
max_dist = unchanged_depth_img[(tine1_row, tine1_col)] + 40 # distance @ left-most tine + 4 cm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Print out the actual distances at each fork tines
result = result & (result > min_dist) | ||
# result < min_dist -> if true: keeps the result otherwise makes it 0 | ||
result = result & (result < max_dist) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- change manipulated_img to bgr
- The pixels where result is true, color red (np.where)
- cv.imshow
rclpy.init(args=args) | ||
food_on_fork = FoodOnFork() | ||
|
||
rclpy.spin(food_on_fork) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
executor = MultiThreadedExecutor() |
class FoodOnFork(Node): | ||
def __init__(self): | ||
super().__init__('food_on_fork') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- create a field that has latest_color_img
- update that in the color callback
overlay the color img on the depth img
- otsu thresholding of the depth img
- https://note.nkmk.me/en/python-opencv-numpy-alpha-blend-mask/
Closing this PR because I am creating another branch that will have code related to the FoF node. |
Description
[TODO: describe, in-detail, what issue this PR addresses and how it addresses it. Link to relevant Github Issues.]
Testing procedure
[TODO: describe, in-detail, how you tested this. The procedure must be detailed enough for the reviewer(s) to recreate it.]
Before opening a pull request
python3 -m black .
pylint --recursive=y .
Before Merging
Squash & Merge