[Bug] Inaccurate movements

This is an error report.


Screenshot of the error


Error details

robotcontrol.turn("counterclockwise", 1.5708, 1) Doesn't this mean the robot should turn 1.5708 (ie. 90 deg) radians in one second?

Hi @professor.herman, yes, you are correct that the method call robotcontrol.turn("counterclockwise", 1.5708, 1) is intended to make the robot turn counterclockwise at a speed of 1.5708 radians per second for 1 second.
You can also check the method definition that is:

    def turn(self, clockwise, speed, time):

        # Initilize velocities
        self.cmd.linear.x = 0
        self.cmd.linear.y = 0
        self.cmd.linear.z = 0
        self.cmd.angular.x = 0
        self.cmd.angular.y = 0

        if clockwise == "clockwise":
            self.cmd.angular.z = -speed
        else:
            self.cmd.angular.z = speed

        i = 0
        # loop to publish the velocity estimate, current_distance = velocity * (t1 - t0)
        while (i <= time):

            # Publish the velocity
            self.vel_publisher.publish(self.cmd)
            i += 1
            self.rate.sleep()

        # set velocity to zero to stop the robot
        self.stop_robot()

        s = "Turned robot " + clockwise + " for " + str(time) + " seconds at " str(speed) + "  radians/second"
        return s

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.