From bf41b75f6ed4148c441cf93f44ddfabd10beae5c Mon Sep 17 00:00:00 2001 From: tscherne Date: Sun, 17 Dec 2023 21:01:00 +0100 Subject: [PATCH] Test depth --- .gitignore | 3 ++- turtle_control/scripts/get_depth.py | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index dbe9c82..381d783 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.vscode/ \ No newline at end of file +.vscode/ +turtle_control/CMakeFiles/* diff --git a/turtle_control/scripts/get_depth.py b/turtle_control/scripts/get_depth.py index 8d0d60c..ea43a35 100755 --- a/turtle_control/scripts/get_depth.py +++ b/turtle_control/scripts/get_depth.py @@ -16,23 +16,26 @@ from geometry_msgs.msg import Twist class get_depth: def __init__(self): + rospy.init_node("turtle_control", anonymous=True) self.bridge = CvBridge() self.depth_img = rospy.Subscriber( "camera/depth/image", Image, self.callback ) - rospy.init_node("turtle_control", anonymous=True) + #We acutally dont want to pulbish anything + self.pub = rospy.Publisher("/cmd_vel_mux/input/navi", Twist, queue_size=1) self.rate = rospy.Rate(10) def callback(self, data): - pass print("TopLeft" + data[0] + ":" + float(data[0]) + "m") - print() + print("callback end") self.rate.sleep() def main(args): gd = get_depth() + try: + ropsy.spin() print("DONE!") cv2.destroyAllWindows()