-
Notifications
You must be signed in to change notification settings - Fork 2
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
Create thresholding node to red using HSV #165
base: develop
Are you sure you want to change the base?
Conversation
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.
Looks great! Nice job type hinting and implementing the service. I would suggest loading the thresholds from ros params. SetThreshold.srv
should go in tauv_msgs/srv
, and also make sure that you add a line for it to CMakeLists.txt
so it gets compiled.
self._cv_bridge : CvBridge = CvBridge() | ||
self._publisher : rospy.Publisher = rospy.Publisher('starter_task/thresholded_img', Image, queue_size=5) | ||
|
||
rospy.Subscriber('/kf/vehicle/oakd_bottom/stereo/right/image_color', Image, self.filter) |
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.
Shouldn't need to hardcode /kf
here. Using vehicle/...
(no leading /
) will set the /kf
automatically using ROS namespacing if the launch file is set up properly.
self._publisher.publish(result) | ||
|
||
def set_threshold(self, req): | ||
self._lower_threshold = np.array([req.hue, req.saturation, req.value]) |
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.
Very nice touch with the service
print("running!") | ||
rospy.init_node('starter_threshold') | ||
|
||
self._lower_threshold : np.ndarray = LOWER_THRESHOLD |
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.
Good style with naming, underscores, and type hints
from cv_bridge import CvBridge | ||
from tauv_common.srv import SetThresholdRequest, SetThresholdResponse | ||
|
||
LOWER_THRESHOLD = np.array([0, 60, 60]) # TODO: figure out typing for threshold |
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.
Try moving these to be ros params
Wrote starter task node that thresholds for red in HSV colorspace.
Currently unsure about how to properly set up launch files / service.