Due: 2023-10-06, 11:59pm
Logistics
This assignment is intended to be completed in teams of size 3. Nevertheless, it may be completed in teams of size 1, 2, or 3. Expectations and grading standards will be the same regardless of team size. The instructor will not mediate conflicts between team members. Everyone on the team will be considered fully responsible for all of the submitted work. You should assign yourself to a team within the Canvas system —Use the People link within the course page— by noon on September 26. After this date, teams for this project will be final. If you are choosing to work alone, this step is still required; simply add yourself to a group with no other members.Reference material
In addition to the concepts you used in Project 1 (nodes, topics, publishers, subscribers, etc.), you'll need to use services, parameters, and bags. You will likely want to consult the tutorials and reference documentation on those subjects.Provided software
Download the newly-updated versionsim
package from this link and
extract it into the src
subdirectory in your ROS workspace.
You should use this package to complete this assignment, but should not
modify anything in the sim
package.
Overview and purpose
This assignment asks you use thesim2
simulator, an enhanced
version of sim1
from the previous project, to control the
simulated robot to visit collection of sites efficiently and
accurately. The purpose is to give some experience using ROS in a
non-trivial context, along with some experience controlling the motion
of (simulated) robots.
Your task
Create a ROS node that uses thesim2
simulator to draw a line that
visits a given set of targets. Each target is a line segment
that the robot must touch. The robot's movement should be accurate
(i.e. minimal extraneous movement) and fast.
Here is an example of what a visualization of the completed project might look like:
sim2
is set up to handle this problem:
- The sim2node accepts a string parameter calledtargetsthat gives the name of the file from while the target points will be read. To find the file named by this parameter, thesim2node will look first in the current directory and then in thesharedirectory of thesimpackage. Thus, by setting this parameter, you can test your program with the sample target files provided with thesimpackage and also with your own hand-crafted targets. You will want to learn how to include parameter values on theros2 runcommand line.
- The targets file is simply a list of line segments in YAML
format. Each segment is a list of two points, and each point is a
list of two floating point numbers. Here's an example, included in
the simpackage, defining four segments:Contents of file: corners.targets
- [[4.0, 6.0],[6.0,4.0]] - [[-4.0, 6.0],[-6.0,4.0]] - [[4.0, -6.0],[6.0,-4.0]] - [[-4.0, -6.0],[-6.0,-4.0]]
- The visualization markers published by sim2include visualizations of the target segments. Your goal is to get the center of the robot to each of these segments. When a target is successfully visited, its color in this visualization will change.
- You may discover that sim2publishes some other information that you'll find helpful. You are encouraged to explore its behavior.
- The sim2node provides aresetservice that returns everything to is initial state. This may be useful for testing your own program multiple times without restartingsim2.
- Before moving the robot, your program should clear any existing
drawing using the resetservice offered bysim2.
- The robot does not need to visit the segments in the order in which they are given. On the contrary, your program should make intelligent choices about the order to visit the segments, along with the points on each segment to target, to keep the travel time small.
- You should move the robot by publishing messages on the
cmd_veltopic. Your program must publish at least $10$ messages per second on this topic. This is a minimum; you may publish more rapidly than this if you like. You can check this using theros2 topic hzcommand.
- You should visualize the results using rvizas in Project 1, including displays for the Robot Model and the Marker Array of simulation markers. It is recommended to use a white background.
What to submit
You should submit a single zip archive containing everything listed below:- A PDF report including:
- A concise description of how the system works. This should be a couple of paragraphs, describing your overall approach at a conceptual level. Some questions to consider: What choices did you make in designing the program, and why? What nodes does your system contain, and what role does each one play? What specific constants are part of your method, and how did you select values for those constants?
- A short answer to these questions: Did the results meet your expectations? Why or why not?
- The source code for your program(s). This will span at least one source code file. Be sure to consult the source code style guide on the course website.
- Recordings created by ros2 bag recordof all topics throughout the entire execution of your program for each of the five input files included in the archive below: It is essential for your submitted bags to contain all topics because this information will play a primary role in evaluating the correctness of your solution. We cannot evaluate bags that do not contain recordings of all topics, and will need to assign grades accordingly. The directory of each bag file must be named with your two digit group number for this project, followed by a dash, followed by the number of the input bag file. For example, if you are in Group 3, your submission should include bag directories called03-1,03-2, and so on. Incorrectly named bags cannot be graded. Each rosbag recording is a directory which contains both a db3 file and a yaml file of metadata. You may rename this directory, but you should not modify the names or contents of the db3 or yaml files after recording, or you risk corrupting the rosbag. Corrupted rosbags cannot be graded.
- A short video demonstrating your system in some way that may be helpful in grading.