首页 > > 详细

辅导COM2009-3009辅导Robotics Lab Assignment #1

项目预算:   开发周期:  发布时间:   要求地区:

University of Sheffield
COM2009-3009
Robotics
Lab Assignment #1
‘An Introduction to the Robot Operating System
(ROS)’
Lab Instruction Sheet
Dr. Tom Howard

Department of Computer Science
March 16, 2020
Contents
1 Overview (please read carefully) 2
1.1 Logistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1.1 Simulation and the ROS IDE . . . . . . . . . . . . . . . . . . . . . 3
1.1.2 Working with the Robots . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 The Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.1 Provided Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.2 Hand-In Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.3 Getting Started with the Report Template . . . . . . . . . . . . . 4
2 Working with the TurtleBot3 Waffle 6
2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Safe Working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4 A note about WiFi communications . . . . . . . . . . . . . . . . . . . . . 7
3 Weekly Schedule 8
3.1 Week 1: ROS Concepts 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2 Week 2: Odometry-based Navigation . . . . . . . . . . . . . . . . . . . . . 9
3.3 Week 3: Hands-on with ROS . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.4 Week 4: ROS Concepts 2 - Services . . . . . . . . . . . . . . . . . . . . . . 14
3.5 Weeks 5 6: Implementing Subsumption-based Control . . . . . . . . . . 16
3.5.1 Part I: Catching up . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5.2 Part II: Building an Avoid-Wander Robot using a Subsumption
Control Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4 Final Steps 19
A Brooks’ Subsumption Architecture 20
A.1 Level-0: Avoid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
A.2 Level-1: Wander . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1
1 Overview (please read carefully)
The lab classes for COM2009-3009 take place in Computer Room 3 in the Diamond
(DIA-CR3). Session A takes place on Tuesdays from 14:00 to 16:00, and Session B on
Wednesdays from 09:00 to 11:00. The aim of the first assignment (running from weeks
1 to 6) is for you to gain practical hands-on experience of ROS (the Robot Operating
System), and use this to design, implement and evaluate a robot’s behaviour. You will be
working with ROS in both a simulation environment (individually) and on real robots
(in groups). The table below provides a broad outline of the lab schedule for the first 6
weeks.
Week # Date Time Details
Working
Format
1
Tue 11 Feb 2-4pm
Wed 12 Feb 9-11am
ROS Concepts 1:
Simulation Exercises
Individual
2
Tue 18 Feb 2-4pm
Wed 19 Feb 9-11am
Odometry-based Navigation:
Simulation Exercises
Individual
3
Tue 25 Feb 2-4pm
Wed 26 Feb 9-11am
Hands-on with ROS:
Working with a Robot
Group
4
Tue 3 Mar 2-4pm
Wed 4 Mar 9-11am
ROS Concepts 2 - Services:
Simulation Exercises
Individual
5 6
Tue 10 Mar 2-4pm
Wed 11 Mar 9-11am
Tue 17 Mar 2-4pm
Wed 18 Mar 9-11am
Implementing Subsumption-
based Control on a Robot
Group
Table 1: Lab schedule for weeks 1-6
Throughout these lab sessions you will explore a range of tools and libraries that are avail-
able within ROS to help Robotics Engineers get up and running with robot applications
quickly, and you will learn how to develop your own robot applications using the ROS
framework.
You will be assessed on a group report that is to be handed-in before 10pm Friday
27th March 2020. See Section 1.2 for further details.
1.1 Logistics
You will work in teams of three (assigned randomly, as per University policy), and each
team has been allocated a particular robot and laptop. See the list on Blackboard to find
your partners and the hardware you will be using.
Graduate Teaching Assistants (GTAs) will be in attendance to provide help and ad-
vice throughout each laboratory session: Varvara Papazoglou, Ben Hawker, Zeke Hobbs,
Blayze Millward, Areeb Sherwani, Will Fraser, Igiri Onaji, Fabio de Mello and Tope
Adeosun.
Note: The GTAs’ role is to help with your learning and any technical issues you may be
facing, NOT to debug your programs.
2
1.1.1 Simulation and the ROS IDE
As discussed above, you will learn about a lot of the core ROS concepts in simulation, and
for this you will work individually on the workstations in DIA-CR3 using a cloud-based
integrated development environment (IDE) called ROS Development Studio (ROSDS):
https://www.theconstructsim.com/rds-ros-development-studio/. Follow the link
and click on the ‘Getting Started’ button to sign up for a free account1. As shown in
Table 1, you will be working in ROSDS for the first two weeks, and will then return to
this again later in the semester.
Note: You will sit with your groups for every lab session, even when working individually
on ROSDS. We encourage you to work together as a team and help each other throughout
all the laboratory sessions.
1.1.2 Working with the Robots
Your first chance to work with robots will occur in week 3, where you will work in groups
with a customised version of the TurtleBot3 Waffle2.
Robots and laptops will be made available in the computer room before the start of the
session. Laptops and robots have already been paired and are therefore not interchange-
able: Laptops are numbered 1-40 (indicated with a sticker on the underside), and have
been paired with a particular TurtleBot3 whose id is printed on a name sticker on the top
and is of the form “dia-waffleX”, where X is a number 1-50. Please refer to the list on
Blackboard to find out which robot and laptop you will be working with. GTAs will be
on hand to distribute the hardware to you from special cabinets. Designate one person
in your group to collect your robot and another to collect your laptop. You will also need
to collect a charger for the laptop, and it is recommended that you work with the laptop
plugged in and charging whenever possible throughout the lab sessions.
Please work with your groups around the workstations that have been designated to you
(even though you may not necessarily need to use the workstations for the session).
Note: Please ensure that you carefully read the guidelines provided in the ‘Working with
the TurtleBot3 Waffle’ section of this Lab instruction sheet before handling and working
with your TurtleBot3. The robots are delicate and it is important that you work with
them appropriately to ensure that no damage occurs to the robot or any of its instrumen-
tation.
At the end of each lab session turn off your robot, shutdown your laptop and return them
both - along with the laptop charger - to the correct cabinet that it originally came from.
GTAs will be on hand by the cabinets to take them from you.
Note: You must not take a robot out of DIA-CR3 under any circumstances!
1.2 The Assignment
Lab Assignment 1 is worth 25% of the overall mark for COM2009-3009. Each group must
work together to complete an answer sheet using these instructions as a guide. There
are a number of questions for you to answer based on the work you have done in each
week’s lab session. Different questions carry different marks, where the maximum marks
1You can ‘Sign up with Google’ using your sheffield.ac.uk email address and account credentials.
2http://emanual.robotis.com/docs/en/platform/turtlebot3/overview/
3
available for each question is indicated along side it. You only need to submit one
report per group.
1.2.1 Provided Materials
In addition to these instructions, you have been provided with a .zip file containing a
number of items that you will need for this assignment (available on Blackboard). In
particular, you have been supplied with a LATEX template - Lab1-Group0z.tex - which
you will use to compile your responses.
LATEX is a free document preparation system for high-quality typesetting
3, and having
a working knowledge of LATEX is a key skill for any computer scientist
4. LATEX is very
easy to learn, and there are many resources available on the web, e.g. https://www.
sharelatex.com/learn/Learn_LaTeX_in_30_minutes.
LATEX distributions are available for Linux, Mac OSX and Windows (see: https://www.
latex-project.org/get/). However, for this assignment, you might like to use an on-
line development environment such as Overleaf (https://www.overleaf.com).
F Step 0: Before you start working with LATEX, edit the filename of the provided
Group0z.tex file by replacing 0 with your group number and z with your session id
(‘a’ if you are attending Session A on Tuesday afternoons, or ‘b’ if you are attending
Session B on Wednesday mornings). More details are provided in Section 1.2.3.
Your edited .tex file should compile to produce a .pdf document with your names on the
front cover, followed by your responses to a number of questions. You will be submitting
the .pdf file when you have completed the assignment, not the .tex file.
1.2.2 Hand-In Procedure
Your group report should be submitted as a single .pdf file to Blackboard. You do not
need to submit a paper copy. Please make sure that your names, group number and
session id are shown correctly on the front page of your report. The next section explains
how to do this.
The deadline is 10pm Friday 27th March 2020.
Note: Each group should submit one report, so you’ll need to select one member of your
group to submit it to Blackboard.
1.2.3 Getting Started with the Report Template
There are a number of options available for working with and creating LATEX documents
however we recommend that you use Overleaf (https://www.overleaf.com) for this
3LATEX includes features designed for the production of technical and scientific documentation, so it is
the de-facto standard for the publication of scientific/technical papers and reports. Unlike WYSIWYG
(“What You See Is What You Get”) word processors (such as Microsoft Word or OpenOffice), LATEX
is based on plain-text source files (containing html-style markup) which are compiled into a typeset
document. This separation of ‘content’ from ‘style’ facilitates the production of very professional scientific
documents in terms of their consistency, readability and design. You can find out more about LATEX here:
https://www.latex-project.org.
4The Department strongly recommends that you consider using LATEX for your Dissertation, and Prof.
Moore has provided a template here: http://staffwww.dcs.shef.ac.uk/people/R.K.Moore/campus_
only/USFD_Academic-_Report_LaTeX-Template.zip.
4
assignment. You will need to consider how you will share the working document with
your group members so that you can all access and contribute. One option would be to
use a shared Overleaf account, or alternatively, you could consider using Google Drive,
or GitHub, to share your working document amongst your group members.
F Step 1: Download the report template .zip file from Blackboard.
F Step 2: Upload this to Overleaf (or any other LATEX IDE of your choosing).
F Step 3: Change the name of the Lab1-Group0z.tex file to indicate your specific group
id. Replace the 0 with your group number, and replace the z with your session id (‘a’ if
you are attending Session A on Tuesday afternoons, or ‘b’ if you are attending Session
B on Wednesday mornings). e.g. If your group number is 5, and your group has been
allocated to Session B (on Wednesday mornings), then the name of your .tex file should
be Lab1-Group5b.tex.
F Step 4: Open the .tex file to start editing.
F Step 5: Under the % EDIT YOUR NAMES section near the beginning of the template,
replace the [Your Name 1], [Your Name 2] and [Your Name 3] fields (including the
square brackets) with the name of your individual group members.
F Step 6: Duplicate the section indicated by the % DUPLICATE THIS SECTION FOR EACH
QUESTION as appropriate, so that you have a dedicated “answer section” for each assign-
ment question. Copy the questions from this instruction sheet across to your report
template and fill in your answers where indicated in the report template.
F Step 7: Once complete, create a .pdf of your report and submit this on Blackboard
(a link for this will go live later in the semester).
5
2 Working with the TurtleBot3 Waffle
2.1 Overview
The robots that you will be working with throughout this semester are a customised
version of the standard TurtleBot3 WafflePi model as detailed on the Robotis Website5.
The robot is shown in Figure 1 below.
Figure 1: The TurtleBot3 Waffle Robots that you will be working with
The robot is comprised of the following core hardware elements:
ˆ Independent left and right wheel motors (DYNAMIXEL XM430’s) to drive the
robot in a differential drive configuration
ˆ An OpenCR Micro-Controller Board to power and control the wheel motors, dis-
tribute power to other hardware elements, and provide an interface for additional
sensors
ˆ An UP Squared (or UP 2) Single-Board Computer (SBC) with an Intel Processor
and 32GB on-board eMMC storage. This acts as the “brain” of the robot
In addition to this, the robot is equipped with the following sensors:
ˆ A Light Detection and Ranging (or LiDAR) sensor, which spins continuously when
the robot is in operation. This uses light in the form of laser pulses to allow the
robot to measure the distance to surrounding objects, and provides the robot with
a 360◦ view of its environment.
ˆ An Intel RealSense D435 Camera with left and right imaging sensors, allowing depth
sensing as well as standard image capture
ˆ A 9-Axis Inertial Measurement Unit (or IMU ) on-board the OpenCR Micro Con-
troller board, which uses an accelerometer, gyroscope and magnetometer to measure
the robot’s specific force, acceleration, and orientation. This sensor is fundamental
to the ROS Navigation System.
5http://emanual.robotis.com/docs/en/platform/turtlebot3/overview/#overview
6
ˆ Independent encoders within each of the DYNAMIXEL wheel motors, to provide
indication of left and right wheel speed and rotation count
2.2 Handling
These robots have lots of exposed sensors and electronics and so you must take great
care when handling them to avoid the robots becoming damaged in any way. When
handling the robot, always hold it by either the black waffle layers, or the vertical support
pillars.
Note: Do not pick the robot up or carry it by the camera or LiDAR sensor - these are
delicate sensors which can be easily damaged.
A lot of the electronics are housed on the middle waffle layer. Try not to touch any of the
circuit boards, and take care not to pull on any of the cabling or try to remove or rehouse
any of the connections. If you have any concerns with any of the electronics or cabling, if
something has come loose, or your robot is not working then ask a GTA to have a look
at this for you.
The robots will be supplied to you by the GTAs with a battery already installed and
ready to go. Do not try to disconnect or remove the battery yourselves. The robot will
beep when the battery is low, and if this happens ask a GTA to provide you with a
replacement.
2.3 Safe Working
You will each need to review a risk assessment before you work with the robots in
Computer Room 3 for the first time. This will be provided to you via Blackboard before
the start of the week 3 lab session, and you will need to answer a short questionnaire
on Blackboard before you can get started with the lab work. See Section 3.3 for further
details.
Note: There is a dedicated ‘Robot Arena’ in the middle of Computer Room 3 for using
the robots. Please do not step inside the robot arena yourselves to avoid any damage to
any robots that are running. If you need to get access to your robot - or to place it within
the centre of the arena - please ask a demonstrator to do this for you.
2.4 A note about WiFi communications
Your robot and laptop will communicate with one another over the DIA-LAB WiFi
network (you will need to consider the drawbacks of network-based vs. local control and
how to manage this, as it will likely impact you during these sessions!) The credentials
for DIA-LAB have already been set on the laptop and robot, and both devices should
therefore connect to this straight away. Note though, that when the laptop is connected
to the DIA-LAB network it will not be able to connect to the internet. You will need
to connect the laptop to eduroam if, at any point during this session, you need to access
any external resources. The WiFi access credentials for eduroam should also have already
been set, but speak to a GTA if you are having any difficulties.
7
3 Weekly Schedule
3.1 Week 1: ROS Concepts 1
Note: You can view the Jupyter notebook from this weeks session on GitHub here:
https://github.com/tom-howard/COM2009_WK01/blob/master/wk01_ROS_Concepts_1.
ipynb
This week you will be working in the ROSDS simulation environment, and you must
work through the exercises independently using the DIA-CR3 workstations. As dis-
cussed in Section 1.1.1 however, you will be sitting next to your other group members
and we encourage you to support one another and discuss your progress throughout the
session.
F Step 1: Click on the following link to access the lab content for this week: http:
//www.rosject.io/l/fdf0a53/. This link will take you to ROS Development Studio
(ROSDS), which you can access from any web browser (although chrome and firefox
are recommended).
F Step 2: Create a free ROSDS account if you haven’t already done so (see Section 1.1.1)
or log in and a ROSject called ‘TUoS COM2009-3009 Robotics Labs Week 1 2019-20’
containing all the material for this week’s lab session will be downloaded to your dashboard
area. Click the “Open” button to get started.
F Step 3: The first thing you should see when you launch the Week 1 ROSject is a
Jupyter Notebook containing all the instructions for this week’s session. Complete all the
exercises as described in the Jupyter Notebook.
F Step 4: Once complete, follow the instructions (as also provided in the Jupyter Note-
book) to save and download a copy of your work.
F Step 5: Before you leave get together in your groups and review the assignment
questions below. Make sure, as a group, that you can answer the questions appropriately
and make a start on your group report using the report template on Blackboard, and the
guidelines provided in Section 1.2.3.
F Step 6: Copy across the questions below into your group report, and make a start on
answering them. It is up to you as a group whether you complete this now, or work on
it together outside of this lab session, but you should agree this with your group members
before you leave and make a plan amongst yourselves.
QUESTION 1 (worth up to 6 marks)
What are the advantages of using a launch file in ROS? What ROS command should be
used to load a launch file, and what is the syntax for using this in a Linux terminal?
QUESTION 2 (worth up to 5 marks)
What is the difference between a package and a node, and what are the three things that
must exist in order for a package to be valid in ROS?
Week 1 Complete.
8
3.2 Week 2: Odometry-based Navigation
Note: You can view the Jupyter notebook from this weeks session on GitHub here:
https://github.com/tom-howard/COM2009_WK02/blob/master/wk02_Odometry_Based_
Navigation.ipynb
This week you will be working in the ROSDS simulation environment again, and will be
building upon the essential ROS skills that you learnt about during last week’s session.
As before, you must work through the exercises individually using the DIA-CR3 work-
stations. Again, you will be sat with your other group members, so talk to one another
and support each other throughout the session.
F Step 1: Click on the following link to access the lab content for Week 2: http:
//www.rosject.io/l/fb5d2f4/.
F Step 2: Sign in to ROSDS using the account credentials that you set up previ-
ously.
F Step 3: The ‘TUoS COM2009-3009 Robotics Labs Week 2 2019-20’ ROSject will
be downloaded to your dashboard area. Click the “Open” button to get started.
F Step 4: Complete the exercises in the Jupyter Notebook for this week’s session. You
don’t necessarily need to complete the final exercise if you run out of time during the lab
session but bear in mind that you will need to have a working solution to this as a group
in order to start working with the robots next week.
F Step 5: Discuss as a group how you are progressing with the final exercise and work
together on this if you need to. Remember that you can access ROSDS on any computer
(all you need is a web browser), so you could always arrange to work together outside
of the lab session if you need to. You don’t all need to have a working solution
individually.
F Step 6: Once complete, follow the instructions in the Jupyter Notebook to save and
download a copy of your work.
F Step 7: Before you leave get together in your groups and review the assignment
questions below. Copy across the questions into your group report and make sure, as a
group, that you can answer them appropriately. It is up to you as a group whether you
complete the answers now, or work on them together outside the lab session, but you
should agree this with your group members before you leave and make a plan amongst
yourselves.
QUESTION 3 (worth up to 4 marks)
What topic do we need to publish messages to to make the TurtleBot3 Robot move?
What type of message does this topic use, and what format does the message take?
QUESTION 4 (worth up to 4 marks)
Using the rostopic echo command, we obtain the following data from the /odom topic
to inform us of our robot’s current odometry:
pose:
pose:
position:
x: 0.649356
y: -0.374484
9
z: 0.0
orientation:
x: 0.0
y: 0.0
z: -0.469191
w: 0.883097
How far has the robot moved from its origin in the X-Y plane? (Explain briefly how you
arrived at this answer)
QUESTION 5 (worth up to 3 marks)
What tool can we use to help us build our own packages in ROS, and where do we need to
locate custom packages within the Linux filesystem of our robot or remote machine?
Week 2 Complete.
10
3.3 Week 3: Hands-on with ROS
Note: You can view the Jupyter notebook from this weeks session on GitHub here:
https://github.com/tom-howard/COM2009_WK03/blob/master/wk03_Hands_on_with_
a_real_robot.ipynb
This week you will work in your groups with a real TurtleBot3 Waffle, and will explore
some of the built-in capabilities of ROS. Before you get started, make sure that you re-read
Section 2 of this document to remind yourselves how to handle and work with the robot
appropriately.
Note: There is a compulsory pre-lab risk assessment quiz that you must each complete on
Blackboard before you start this weeks lab, to make sure that you are aware of the health
and safety practices that you must follow when working during these laboratory sessions.
Every member of your group must have complete the pre-lab quiz before your group will
be allowed to collect a robot.
F Step 1: Log into Blackboard individually on the CR-3 workstations and follow the
link to the pre-lab health and safety risk assessment and quiz. Once all your group mem-
bers have completed this, get the attention of a GTA who will check your scores.
You should now perform the following steps as a group:
F Step 2: Locate the Lab1 student-robot-allocations.pdf in the Lab Assignment
#1 folder on Blackboard to view the most up-to-date robot allocation list and find out
which robot and laptop your group will be working with. Head across to the laptop
and robot cabinets with this information and a GTA will provide you with the correct
hardware. Then return to your group by your allocated workstations.
F Step 3: Turn on the laptop and log in using the “robot” user account and the password
that will be provided to you separately.
F Step 4: Make sure the laptop is connected to the eduroam WiFi network.
Note: Whilst working on these laptops you may at some point see a message asking if
you would like to install software updates (as below) or update the operating system to the
latest version. Please do not perform any sort of updates on this laptop, and
just dismiss any messages, such as this, which may appear.
F Step 5: Open a terminal window using the CTRL+ALT+T keyboard shortcut (or oth-
11
erwise), and enter the following commands (excluding the $ symbol) in the order shown
below (note that in order to paste commands into the linux terminal you will need to use
the CTRL+SHIFT+V keyboard shortcut):
1. $ mkdir -p ~/com2009/labs cd ~/com2009/labs
2. $ git clone https://github.com/tom-howard/COM2009_WK03.git
Note: If you get the message: “fatal: destination path ‘COM2009 WK03’ already
exists and is not an empty directory”, just carry on but skip step 4.
3. $ cd COM2009_WK03/
4. $ chmod +x past_weeks.sh ./past_weeks.sh
5. $ conda activate jupyter notebook
F Step 6: A web browser will open showing a jupyter dashboard and a file tree. Click
on the wk03 Hands on with a real robot.ipynb file in the root of the file tree to launch
the Jupyter Notebook for this week’s lab session.
F Step 7: Complete all the exercises as a group, or at least make sure that you can do
enough to answer the assignment questions below.
F Step 8: When you have completed the lab session, make sure that you refer to the
“Next Steps” section at the very bottom of the notebook to guide you through the process
of shutting down your robot correctly. Make sure that you take a copy of any code
and/or data away with you.
F Step 9: Before you leave get together in your groups and review the assignment
questions below. Copy across the questions into your group report and make sure, as a
group, that you can answer them appropriately. It is up to you as a group whether you
complete the answers now, or work on them together outside the lab session. Make a plan
amongst yourselves.
QUESTION 6 (worth up to 5 marks)
Provide two images in your report showing:
1. The map that your robot generated in Exercise 4

软件开发、广告设计客服
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 9951568
© 2021 www.rj363.com
软件定制开发网!