Objectives

In this assignment, you will modify your code from Homework 3 and connect it in between your HW2 publisher and the mystery_node. This is intended to show you 1) how to work with third-party packages you may want to use in the future and 2) how to use parameters to make your code more flexible. You may choose to modify the same unit conversion code file as you created in Homework 3 or make a new one. Do not modify your publisher from Homework 2! Here are the detailed specifications:

  • Your new/revised conversion node should be able to convert to a third unit: smoots (1.7018 meters or 5.5833 feet, ref: https://www.larsondesigngroup.com/understanding-smoot/)
  • Each time your node receives a measurement to convert, it should check a parameter (name of your choice) to determine which unit it should convert to:
    • Meters (no conversion, output the same message as the input)
    • Feet
    • Smoots
  • You may change your topic name/type from Homework 3 as desired.
  • You should make a new launch file that starts the following nodes:
    • mystery_node
    • Your Homework 2 publisher
    • Your Homework 2 subscriber
    • Your new/revised conversion node
  • Without changing any code in your Homework 2 publisher, remap the topic it publishes to in the launch file so that it listens to the output of your new/revised conversion node.
    • To be clear: your Homework2 publisher should publish to /mystery/input still.
    • Your node should listen to this remapped topic and publish to mystery_node
    • Alternatively, you can place the remap such that mystery_node listens to a different topic, as long as your publisher flows through the converter before mystery_node.
  • Also, set the parameter used by your new/revised node to produce an output in Smoots as an initial default.

At the end of this, your Homework 2 subscriber node should log statements to the console in whatever units your conversion code publishes. See slides for an example graph of the end product.

Test your code thoroughly by changing the parameter on the command line and watching the output from your conversion node and the console. It should start as Smoots and then change as you change the parameter on the command line.

Submission Instructions

Submit a PDF to blackboard with:

  1. Your name, repo URL, and the tag for this assignment
  2. The command that starts your nodes for this assignment, ie:
    roslaunch <package> <launch_file>
  3. The name of the node you created
  4. The parameter you created and the valid values you can use.
  5. Any difficulties you had with this assignment

Rubric

6 points – Added new unit smoots
10 points – Parameter to switch units
10 points – Successful remap
6 points – All nodes started in launch file
2 points – Tag applied in git
6 points – Answers given in PDF