Objectives

In this assignment, you will perform coordinate transforms to determine the location of an object seen by a sensor relative to the robot and to the world coordinate frames.

This assignment is split into two parts:

  1. Setup the necessary transform and calculate the position of four points by hand. You may use tools such as a calculator, Matlab, Python, or Wolfram Alpha to do matrix multiplication but you must show your work as described below.
  2. Create a ROS node (along with a launch file to start it) that takes in a duckietown_msgs/Vector2D message on a topic (name of your choice) and:
    1. Publishes the transformed point in robot-relative coordinates to a new topic (name of your choice) as a Vector2D message.
    2. Publishes the transformed point in world coordinates to a second new topic (name of your choice) as a Vector2D message.

Verify that your node gives the same answer as your calculations in Part 1.

Problem Description

Your robot is in position (2, 7) facing 45 degrees left of the y-axis (135 degrees relative to x-axis) in world coordinates. It has a sensor pointed exactly behind the robot (180 degrees from forward/positive x-axis on the robot) and placed 2 m behind the center of the robot.

The sensor returns obstacles in the following locations (in the sensor coordinate frame):

  1. (17,13)
  2. (5,-19)
  3. (-16,19)
  4. (-11,-7)

Instructions

  1. Draw the robot and sensor in the world coordinate frame (does not need to be to scale).
  2. Find the transform from the sensor to the robot coordinate frame.
  3. Find the transform from the robot to the world coordinate frame.
  4. Find the transform from the sensor to the world coordinate frame.
  5. Calculate the position of each of the four points above relative to the robot coordinate frame.
  6. Calculate the position of each of the four points above relative to the world coordinate frame.
  7. Create a ROS node that performs these two transforms. As stated above, the node must subscribe to a topic that has the Vector2D message type and publish as a Vector2D message:
    1. The position relative to the robot coordinate frame
    2. The position relative to the world coordinate frame

Submission Instructions

Submit a PDF to Blackboard with:

  1. The answers (along with any work) to questions 1-6 above.
  2. Your name, repo URL, and the tag for this assignment
  3. The roslaunch command that starts your code for this assignment.
  4. The names of the three topics you created.

Rubric

24 points: Answers to instruction questions 1-6 (4 points each)
12 points: ROS node/launch file to perform the transform for any Vector2D input
4 points: Submission details as defined above