Question regarding ROS(turtlesim).Moving one turtle towards another turtle
I want to write a python node such that it subscribes to relevant topics and publishes to relevant topics to make default 'turtle1' at (5.444,5.444) move towards a newly spawned turtle 'blah' at (X1, Y1) and stops at a 'D' unit distance from 'blah'.(This is in ROS)Can someone please explain or provide a solution?!
I gave new subscriber as rospy.Subscriber('turtle/blah',Pose,update_posenew)
and a new object called as posenew=Pose()
inside __init__
function. The callback function is:
def update_posenew(self,data) self.posenew=data self.posenew.x = round(self.pose.x, 4) self.posenew.y = round(self.pose.y, 4)
... Uptil now fine.now.. In the move2goal function
def move2goal(self): goal_pose =Pose() goal_pose.x =∆ goal_pose.y = ∆
What should be given in place of ∆?