Skip to content

Lab 7: Pose Transforms and Navigation

Maya Cakmak edited this page Apr 21, 2020 · 3 revisions

In this lab you will practice coordinate frame transforms.

Step 1: Get the latest labs repository from GitHub. For Lab 7 you will work in:

  • pose_transform.py – This script involves having the robot wait in place until it detects a Cozmo cube. Then it simply displays the robot's current pose and the detected cube pose.

Try running this script and show the robot a cube. Move the cube around and observe how the pose changes to get a better sense of the coordinate frames and cube orientations.


Step 2: You will notice that the cube pose and the robot pose are both in the global/world coordinate frames. For this exercise, you will convert the cube pose back into the robot coordinate frame. In other words we would like to know where the cube is relative to the robot. For that, implement the get_relative_pose() function that takes in two poses in the same frame of reference and finds the relative transform.

Note that different tools and libraries already exist for doing such transforms; however, if you would like to work through how transformations work, you can implement the function with low level trigonometry and matrix algebra using numpy.


Step 3: As a final step you will make the robot move relative to a cube that it detects. Do this within the move_relative_to_cube() function using a combination of function you implemented. You will need to decide what the desired relative pose should be, either by hand or through experimentation (e.g. place the cube where you want it to be relative to the robot and record relative pose). Make a video of the robot moving to the cube in two different cube poses.

Clone this wiki locally