Autonomic Computing & Robotics

94 views 9:57 am 0 Comments April 21, 2023

COM760 (Autonomic Computing & Robotics)
Coursework – Practical Skill Assessment
This coursework constitutes 50% of the total mark for the module. The submission deadline
is noon 12:00 on 30
th April 2023. Feedback will be made available within 20 working days
from the submission deadline.
I. Tasks
This coursework contains 2 tasks and you are required to complete all the tasks in Python working with
ROS Kinetic installed on Ubuntu 16.04. Before you start, create a ROS package called
com760_yourBcode.
All your files in your package should be organized with the following structure:
launch folder: contains launch files
urdf folder: contains the model files describing your robot
scripts folder: contains your python code
world folder: constains world description files
srv folder: contains your custom ROS services
msg folder: contains your custom ROS messages
CMakeLists.txt: list of cmake rules for compilation
Package.xml: Package information and dependencies
Hint: (1) Unless indicated otherwise, the text
YourBcode appearing subsequently should be replaced
with your student number, i.e.
b00xxxxxx; (2) you should include at least the following two launch files
in your launch folder:
com760_taskA.launch and com760_taskB.launch which are used to
start up all nodes needed for Task A and Task B respectively.
Task A – Leader-follower formation control of multi robots (50%)
Formation control of multiple robots is one of the most important areas in robotics research. In this task,
you are required to implement the basic concepts of leader-follower formation control using the
turtlesim simulator which is part of the ROS installation. Multiple turtles will be spawned in the simulator,
one of which is designated as the leader moving along an arbitrary trajectory. The other turtles as the
followers keep track of the leader turtle in the desired distance and orientation.
1. Basic requirements:
Using a launch file to spawn 3 turtles, namely leader, followerA and followerB, in
the turtlesim simulator
The leader turtle is located in the center with no rotation. The other 2 followers start at a
random position and orientation.

Define a custom message namely YourBCodeLeaderMessage.msg as shown below (Fig.
1) used to send an instruction from the leader to two followers
Fig. 1 The YourBcodeLeaderMessage.msg message to be defined
The leader starts with sending an instruction using the defined message to two followers
asking them to move to the formation position, i.e.
followerA is 1 meter behind the
leader and followerB is 1 meter behind followerA as illustrated in Fig.2.
Fig. 2. An illustration of leader-follower formation. i.e. followerA is 1 meter behind the leader and
followerB is 1 meter behind the followerA
Once the leader detects that the two followers are in the required formation position, it turns
to a
random direction and then keep moving in a straight line with a red pen until it reaches
the boundary of the turtlesim window. The three turtles should maintain column formation
while moving, i.e. three turtles travel one after the other as illustrated in Fig. 2 with two
followers move with a
white pen.
Hints: The formation control could be easily achieved by publishing additional frames to the
leader turtle. Here is the
tutorial you might find helpful.
Defining a custom ROS service, namely YourBcodeServicePID.srv, which provides a
service allowing a given turtle moves to a specified location using a PID controller as
illustrated in Fig. 3.
Fig. 3 The YourBcodeServicePID.srv service to be defined.
Hints: Here is a link which you can find how to use a PID controller to move a robot to a
specific location
When the leader turtle approaches to the border, it will send another instruction (again using
the defined message) to the followers and do the following
o Teleport 2 followers to their
initial position through the service (i.e. turtlesim/TeleportAbsolute) provided by
ROS
o The leader turtle returns to the center through the custom service defined above (i.e.
YourBcodeServicePID.srv). If the PID server fails to move the turtle to the
goal location, the leader turtle should be teleported back to the center
o All the turtles should return to their initial position with a black pen
A Vodcast is required to be produced to accompany your implementation within which a brief
walkthrough demonstration of your implementation and a walkthrough of the underlying
source code, along with an associated commentary.
2. Marking scheme
Using a launch file to spawn 3 turtles at required positions (8 marks)
Creating a custom ROS message, i.e. YourBcodeLeaderMessage.msg and a custom
ROS service, i.e.
YourBcodeServicePID.srv (7 marks)
Communication between the leader and follower turtles using the defined message (6 marks)
The leader turtle moves in a random direction (5 marks)
The control of leader-follower formation (12 marks)
Turtles return to their initial position (12 marks)
Task B – Bug algorithms for robot navigation (50%)
Unlike many other planning algorithms based on global knowledge (e.g. maps), insect-inspired bug
algorithms assume only local knowledge of the environment and a global goal, exhibiting two simple
behaviors, i.e. following a wall and moving toward to a goal. In this task, you are required to develop a
bug algorithm for navigation in an unknown environment.
1. Basic requirements:
Insert a laser scan sensor and a differential plugin to the provided URDF file, i.e.
com760Bot.urdf and revise it as follows.
o Change the name of your robot to yourBCodeBot, i.e. b00xxxxxxBot
o
Change the topic used for publishing the laser data to

/yourBCodeBot/laser/scan o Change the topic used to
command your robot to move to
/yourBCodeBot/cmd_vel
Using xacro to clean up the URDF file, i.e using the following 4 files to represent the robot
model which are easier to read and maintain
o yourBCodeBot.xacro – A primary file that
loads the following three files and contains only URDF items like joints and links

o yourBCodeBot.gazebo – It contains gazebo-specific labels including adding a
Gazeo ROS control plugin that are wrapped within gazebo o
materials.xacro
: defining all the material properties such as color o
macros.xacro
: defining macros to help simplify
The robot located at (9, 1) as illustrated in Fig. 5 starts with moving in a circle with an angular
velocity set to 0.4 radian/s and a random linear velocity in the
x axis less than 0.25 m/s, while
waiting for a homing signal that would be published within 30 seconds by calling the
YourBcodeHomingSignal.srv service defined below (Fig. 4).
Fig. 4 The YourBcodeHomingSignal.srv service to be defined
Once receiving the signal, the robot begins the journey back to the docking station whose
coordinates are specified in the above service using a
right-turning bug 2 algorithm, i.e. the
robot should turn right when detecting an obstacle and only leaves the obstacle when it
encounter the
m-line again closer to the goal.
Hints: the docking station is located at (-5, -1) close to the lamp post as illustrated below.
Fig. 5 An illustration of the world file provided, in which the docking station is located at (-5, -1) close to the lamp post
Defining a custom ROS service, namely YourBcodeSetBugBehaviour.srv, in which
the request contains a boolean value used to enable/disable the behavior and the request
field, i.e.
speed should be set to 1.5 (m/s) or 0.5(m/s) indicating the speed at which the
robot will travel as illustrated in Fig. 6.
Fig. 6 The YourBcodeSetBugBehaviour.srv service to be defined

The
defined
bug behaviours must be triggered through the

YourBcodeSetBugBehaviour.srv service(NOT std_srvs/SetBool service).
Users should be able to specify the speed the robot will travel with.

Implementation of any variations of Bug algorithms such as

Alg1 an
in
extension of the Bug2 algorithm
published 1990 https://ieeexplore.ieee.org/document/126290
Rev1 – an extension of the Alg1 algorithm published in 2001
(https://ieeexplore.ieee.org/document/932860
A Vodcast is required to be produced to accompany your implementation within which a brief
walkthrough demonstration of your implementation and a walkthrough of the underlying

source code, along with an associated commentary. Each member must take part in the
demonstration vodcast to report their contributions to the solution. A guide outlining what
the vodcast needs to contain can be found towards the end of this assignment specification.
2. Marking scheme
Robot modelling using xacro (8 marks)
Defining two custom ROS services, i.e. YourBcodeHomingSignal.srv and
YourBcodeSetBugBehaviour.srv (6 marks)
Moving in a circle, while waiting for a homing signal to be published by calling the
YourBcodeHomingSignal.srv custom service (6 marks)
The implementation of the right-turning Bug 2 algorithms in which the bug behaviors are
activated/deactivated through the defined ROS service, i.e.
YourBcodeSetBugBehaviour.srv(10 marks)
The control of the bug’s travel speed based on the input service message (4 marks)
Please note that the implementation of bug behaviours needs to be based on the provided
two partially completed classes, i.e.
GoToPoint.py and FollowWall.py
Implementation of any variations of Bug algorithms (6 marks)
Vodcast (10%) which provides a brief walk-through of you code for both Task A and Task B
should demonstrate clearly the features you have created as well as a clear readable review
of the code that make the features work. The vodcast should be encoded in mp4 format and
last no more than 10 minutes.
3. Resources
com760Bot.urdf – A URDF file for a simple two-wheeled differential drive robot used in
this assignment. It is simulated in Gazebo and visualizable in RViz.
GoToPoint.py – A partially completed python class used to move a robot from any point
to a desired point
FollowWall.py – A partially completed python class used to make the robot follow a wall
com760World.world – A custom Gazebo world file used in this assignment
II. Submission guidelines
1. Create a readme file in PDF named i.e. readme_YourB00CODE.pdf in which the following
information must be included otherwise points will be deducted from your overall score (-
5%).
A. Evidence of successful implementation of Task A
A screenshot after running the following launch file for Task A
$roslaunch com760_yourBcode com760_taskA.launch
A screenshot after running the following command in a separate terminal, in which
the topics published by your turtles should be highlighted (if any)
$rostopic list
A screenshot containing the services you defined after running the following
command in a separate terminal – in which the services advertised by your robot
should be highlighted (if any)
$rosservice list
A screenshot showing two followers are in the required formation position.
A screenshot showing the leader turtle moves in a random direction with a red pen
and the three turtles maintain column formation while moving.
A screenshot demonstrating all the turtles return to their initial position with a black
pen.
B. Evidence of successful implementation of Task B
A screenshot after running the following launch file for Task B
$roslaunch com760_yourBcode com760_taskB.launch
A screenshot after running the following command in a separate terminal, in which
the topics published by your turtles should be highlighted (if any)
$rostopic list
A screenshot containing the services you defined after running the following
command in a separate terminal – in which the services advertised by your robot
should be highlighted (if any)

$rosservice list
A screenshot showing the robot moves in a circle in Gazebo.
A screen shot demonstrating that the robot begins the journey back to the docking
after receiving the homing signal.
Screenshots demonstrating the successful implementation of Bug 2 algorithm o A
screenshot showing the robot is in State 0, i.e.
Go to point. o A screenshot
showing the robot is in State 1, i.e.
Wall following o A screenshot showing the
robot reaches the docking station
Include relevant screenshots and code snippets for any variants of Bug algorithms
implemented.
2. The completed ROS package along with the readme file must be zipped and uploaded to
Blackboard Learn by
noon 12:00 on 2nd May 2023. Your submission should be in the form
of a single zip file called com760_YourB00CODE.zip, i.e. “com760_b00123456.zip”.
3. A copy of vodcast should be submitted using the link
CW2 Vodcast Submission within the
module area of Blackboard by the submission deadline (
noon 12:00 on 2nd May 2023).
Please ensure the name of the submitted vodcast is given as
com760_yourB00CODE_VODCAST, i.e. “com760_b00123456 _VODACAST.mp4”.
4. Students must ensure that the submitted package can be uncompressed, opened and run in
ROS Kinetic on Ubuntu 16.04 and that vodcast conforms to the mp4 format, can be opened
and viewed (with sound). Corrupted files will be treated as a non-submission.
5. Please ensure that you keep a secure backup electronic copy of your assignment and retain a
screenshot of your successful submission.
PLEASE NOTE:
Avoid plagiarism: Feel free to google and be inspired by what you read. However, please do not try to
pass off any downloaded code as your own work. You must acknowledge all sources. This includes
information from the Internet. Plagiarism is a serious offence
.
Vodcast Guidelines
The vodcast must include a screencast of the program demo and code walkthrough, and a live
view of the presenter, positioned in the bottom right hand corner of the recording.
Program Demo Walkthrough
Evidence of completeness, confidence in operation, testing and awareness of any limitations
1. Execute your program in ROS on Ubuntu 16.04
2. Demonstrate each task and any additional features implemented, discussing the program output to
confirm the correct operation.
3. Demonstrate known issues / bugs that exist within the program and indicate whether these were due
to technical complexity, lack of time or some other reason.
4. Provide self-assessment of how well you feel you have achieved the main elements of the assignment.
Source Code Walkthrough
Application of concepts and evidence of understanding of code structure and key ROS concepts
1. Present an overview of the ROS package you have implemented 2.
Discuss the approach adopted for the implementation of each task.
3. to ensure the code is well organised and structured.
4. Discuss the code/concepts behind each function/feature presented within the vodcast for example the
control of leader-follower formation and activation/deactivation of bug behaviour etc.
5. Evidence your understanding of key ROS concept such as the use of custom topics/services etc.