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

Tolerance Waypoints does not works #30

Open
GitNzino opened this issue May 23, 2022 · 1 comment
Open

Tolerance Waypoints does not works #30

GitNzino opened this issue May 23, 2022 · 1 comment

Comments

@GitNzino
Copy link

Hi I want to congrats you for the excellent work done, all the package works amazing!

I only have issue on waypoints tolerance because I don't want that the robot stops at each waypoints and also changing the value of tolerance the robot stops the same.

Can You help me in found some solution?
I would be grateful,
Lorenzo

@GitNzino
Copy link
Author

In my script I am using tf2_ros, so I had some issue on time tolerance of tf because tf2_ros not publish the tf with a certain frequency as tf does.

For me worked this type of modification from line 78 to 92 of follow_waypoints.py.

self.client.send_goal(goal)
            if self.distance_tolerance <= 0.0:
                self.client.wait_for_result()
                rospy.loginfo("Waiting for %f sec..." % self.duration)
                time.sleep(self.duration)
            else:
                #This is the loop which exist when the robot is near a certain GOAL point.
                distance = 10
                while(distance > self.distance_tolerance):
                    now = rospy.Time(0)
                    self.listener.waitForTransform(self.frame_id, self.base_frame_id, now, rospy.Duration(4.0))
                    trans,rot = self.listener.lookupTransform(self.frame_id,self.base_frame_id, now)
                    distance = math.sqrt(pow(waypoint.pose.pose.position.x-trans[0],2)+pow(waypoint.pose.pose.position.y-trans[1],2))
                    # rospy.loginfo(distance)
        return 'success'

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

No branches or pull requests

1 participant