关键词 > CS733/833
CS 733/833 Introduction to Mobile Robotics Fall 2022
发布时间:2022-11-26
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
CS 733/833 Introduction to Mobile Robotics
Fall 2022
Lab Assignment 3: Mobile Robot Kinematics and Odometry [10 points]
Introduction:
In this lab you will use odometry to control the trajectory of the Turtlebot. A complete understanding of the code in Pre-Lab 3 and the ability to move the robot using the code is a requirement for this lab.
Lab Work:
1. Subscribe to Odometry messages via the ‘/odom’ topic. Investigate the Odometry message
to determine its contents.
2. A starter code is provided for this lab (lab3_skeleton.py). Use the starter code to implement the functions listed in the “Functions” section of this manual. Each function returns two objects:
a. A Twist message that indicates the speed the robot should travel at.
b. A ‘finish_condition’ function that returns a Boolean indicating if the robot is at the goal or not
3. Write a launch file to bring up your node. We will use ONLY this launch file to run and test your code. Therefore, without a launch file, you will not get any credit for your work.
Functions:
All units should be in meters, degrees, and meters/second
velocity_from_wheels(phi_left, phi_right)
Convert the velocities of a differential drive robot to the linear and angular components of a Twist message. Hint: Consider what the linear velocity will be given different combinations of wheel velocities. Then do the same for the angular velocity. If you execute this function using the ‘exeute_trajectory’ function it will continue to execute the given Twist messages until the node is killed.
drive_straight_no_odometry(speed, distance)
distance=speed x time; Evaluate the time required to travel the given distance and move the robot for that duration. Since the robot will not achieve the given speed instantaneously, you have to find the correct time on a trial and error basis.
drive_straight_odometry(speed, distance)
Subscribe to odometry message and obtain the starting position. Keep driving the robot at the specified velocity until you travel the specified distance. You have to evaluate the Euclidean distance between the starting position (obtained from odometry) and current position (obtained from odometry) to determine when you have traversed the specified distance.
rotate(angle)
Use the odometry message, as discussed above. Remember that odometry message supplies orientation as a Quaternion. You should convert it to Euler angle to conveniently measure the distance between two orientations. Assume an angular velocity of 1.0.
Note: if needed you can easily convert radians to degrees and degrees to radians using math.degrees(rad) and math.radians(deg) respectively.
Note: we have also included a normalize_angle function and an angular_distance function to help you in manipulating angles. Refer to the code for further descriptions.
drive_arc(radius, speed, angle)
You may use any combination of the above approaches/functions to perform this functionality.
execute_trajectory()
Consider inputs to be in degrees (clockwise is negative, and counterclockwise is positive)
- Drive forward 60cm
- Turn 90°
- Drive -180° arc with a radius of 15cm
- Turn -135°
- Drive forward 42cm
Deliverables and Deadlines
This lab is due on December 2. Make sure to push your launch file along with codes. We will use ONLY this launch file to run and test your code. Therefore, without a launch file, you will not get any credit for your work.
In addition to your code, you will submit a .txt file that briefly discusses the following:
a. Compare the performance of “drive_straight_no_odometry” and “drive_straight_odometry”
If you used external sample code other than the packages listed in this lab document, please also submit a document called References.txt that lists all such sources, as well as a very brief description of what you used from each one. All submissions are through GitLab.