add a TODO: Remove the inference to depth_callback directly?

This commit is contained in:
TJU_Lu 2024-11-19 10:58:45 +08:00
parent f0e7d7c4f7
commit 2d34e89fd4

View File

@ -86,6 +86,10 @@ class YopoNet:
print("YOPO Net Node Ready!") print("YOPO Net Node Ready!")
rospy.spin() rospy.spin()
def callback_set_goal(self, data):
self.goal = np.asarray([data.pose.position.x, data.pose.position.y, 2])
print("New goal:", self.goal)
# the first frame # the first frame
def callback_odometry(self, data): def callback_odometry(self, data):
self.odom = data self.odom = data
@ -158,10 +162,7 @@ class YopoNet:
self.depth = depth_.astype(np.float32) self.depth = depth_.astype(np.float32)
self.new_depth = True self.new_depth = True
def callback_set_goal(self, data): # TODO: Remove the test_policy to callback_depth directly?
self.goal = np.asarray([data.pose.position.x, data.pose.position.y, 2])
print("New goal:", self.goal)
def test_policy(self, _timer): def test_policy(self, _timer):
if self.new_depth and self.new_odom: if self.new_depth and self.new_odom:
self.new_odom = False self.new_odom = False