Homework 1 will introduce you to the tools we will use in this course. Most of the commands are specified for you in the linked instructions or below. At the end of this assignment, you should have a working system for future assignments and a basic understanding of ROS topics and nodes.
$ dts devel build --pull
This command will build your Dockerfile into an image that you can run as needed. It needs to be run when there are big changes, like when you update the template to your repo or when some Duckietown images are changed. We will discuss this more as the semester progresses. The “pull” option tells dts to check for any updates to other dependency images when it runs.
$ dts devel run -M -X --cmd bash
Let’s take a deeper look at this command:
$ cd /code/catkin_ws/ $ source devel/setup.bash $ catkin build $ source devel/setup.bash
These commands allow you to use the correct environment for ROS and build everything in that environment. You will have to run these commands every time you change code or create new packages. For this assignment, once is enough.
$ roscore
$ dts devel run attach
This will give you a new command line interface to your running docker container.
$ source /code/catkin_ws/devel/setup.bash
$ rosrun mystery_package mystery_node.py
$ rosnode list
You should see “mystery_node” here.
$ roslaunch mystery_package launch_mystery.launch
This will print some debug text to the screen and then stop printing information.
$ rosnode list
This shows all of the nodes that are currently running. You should see the same node you saw before.
$ rostopic list
This shows all active topics. Two topics, “/rosout” and “/rosout_agg” are almost always shown and we can ignore them for this assignment. We will focus on the two topics that are part of this mystery node.
$ rostopic echo <topic>
For one of the topics that you think is being sent by the mystery_node node. Leave this command running.
$ rostopic pub -1 <topic> <message_type> <value>
HINT: the value is just a number in this case. Pass any number you like.
NOTE: that is a “dash one” (1) after the command. Some fonts are clearer than others. It makes rostopic pub send the message exactly once and exit.
$ git status
And confirm that it says “nothing to commit”. If there is anything to commit, refer to the commit and push commands in the setup instructions.
$ git tag hw1 $ git push origin hw1
Remember to do this for each assignment you turn in!
To complete this assignment, submit a PDF to blackboard with the following information: