Project 1 - Setting up ROS1 and TurtleSim
Due: Sunday, Feb 1, 2026 at 11:59PM on Blackboard Weight: 10%
Introduction
In this project, you will demonstrate your ability to set up a ROS1 environment and create a simple node to control a robot using TurtleSim.
Objectives
- Set up the ROS1 environment.
- Create a simple ROS node to control a robot.
- Answer assessment questions.
NOTE: This project must be completed individually.
Step 1: Set Up Your ROS Environment
- Install ROS1 as per the Lab 1 instructions.
- Create your ROS workspace as per the Lab 3 instructions.
Step 2: Create and Run a Simple ROS Node
Use open-source code, AI-generated code, or your own code to create a controller as described below (and in Lab 3) to make the robot move in TurtleSim.
Create a new package called lab3_turtlesim. You can create a new workspace called lab3_ws or use your existing workspace.
The commands to create the packages are given below depending on your preferred programming language. You'll need the geometry_msgs dependency to use the twist object.
Python (Easy) project:
catkin_create_pkg lab3_turtlesim rospy geometry_msgs
or C++ (Hard) project:
catkin_create_pkg lab3_turtlesim roscpp geometry_msgs
Your node should do the following:
- Accept a command line argument specifying the name of the turtle it should control.
- i.e., running
rosrun lab3_turtlesim turtle_controller turtle1will start a controller node that controlsturtle1.
- i.e., running
- Use
w,a,s,d(andq,e,c, andz) to control the turtle by publishing velocity control messages on the appropriate topic whenever the user presses those keys on the keyboard, as in the originalturtle_teleop_key. The turtle should ONLY move when a key is pressed. When the key is released, the turtle should STOP moving.- Option 1 (Easy, max grade 80%) Single keypress: In addition to just forward/backward and turns, the turtle should move forward and turn left in a circular path if
qis pressed and similar fore,c, andzin their corresponding directions. - Option 2 (Hard) Multiple keypress: If you want to challenge your Python skills, make the controller so it listens to multiple keys. i.e., if
w + aare pressed, the turtle should move forward and turn left in a circular path. If the keys pressed are contradicting, there should be no movement. You'll need to install an additional Python package to achieve this.
- Option 1 (Easy, max grade 80%) Single keypress: In addition to just forward/backward and turns, the turtle should move forward and turn left in a circular path if
Hint: You'll need to use the Twist message type in the geometry_msgs package.
Hint: You can use teleop_turtle_key.cpp as a reference for cpp.
To test, spawn multiple turtles and open multiple instances of your new turtle controller node, each linked to a different turtle.
Step 3: Assessment Questions
- What command did you use to create the ROS package?
- Explain why and how you used ROS messages in your program. i.e., Which message and type?
- Describe the steps to launch ROS, TurtleSim, and your ROS node simultaneously.
- How do you verify that your ROS node is publishing messages correctly? i.e., What command?
Submission
- A link to your project folder (e.g., on GitHub or Google Drive) containing all the necessary files and code.
- A video showing your code running in TurtleSim and the robot moving.
- A text file containing your name and the answers to the assessment questions.
Note: If you used any GenAI tool for this project, you must also declare which tool and which portion of the code (i.e., line number or function), and/or paragraph was written by GenAI in the text file.
Late Submission Penalty
- A 25% reduction from the full mark will be applied for every 24 hours the submission is late after the deadline.