Skip to content
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

Closed
wants to merge 17 commits into from
Closed

Conversation

atharva-kashyap
Copy link
Contributor

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

  • Format your code using black formatter python3 -m black .
  • Run your code through pylint and address (most) warnings/errors: pylint --recursive=y .

Before Merging

  • Squash & Merge

# 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
Copy link
Contributor Author

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)

Copy link
Contributor Author

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)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class FoodOnFork(Node):
def __init__(self):
super().__init__('food_on_fork')

Copy link
Contributor Author

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

@atharva-kashyap
Copy link
Contributor Author

Closing this PR because I am creating another branch that will have code related to the FoF node.

@atharva-kashyap atharva-kashyap linked an issue Jul 31, 2023 that may be closed by this pull request
@atharva-kashyap atharva-kashyap changed the title Atharvak/food on fork node Food on Fork node V1 Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ROS2] Food on Fork Detection
1 participant