Skip to main content


By January 8, 2021No Comments

2021/1/8 COMP329 Programming Assignment 1/3 COMP329 Programming Assignment Due Monday by 23:59 Points 50 Submitting a file upload Submit Assignment Programming Assignment – worth 50% To be completed no later than 23.55 – 18th Jan 2021 Official Deadline is 11th Jan, but submissions will be accepted with no late penalty applied for 1 additional week. Note that this is an individual assignment. A typical student should aim to spend approximately 16 hours on this assignment, and no more than 30 hours in total. The Webots project that you will be working with can be downloaded here: The aim of the programming assignment is to take a partially completed Webots project, and add code to four of the files to determine: Deliberate movement Odometry and change in Pose A likelihood estimator for a Sensor Model A Monte-Carlo Sampler for a Particle Filter Each task is detailed below, and enables further functionality. A fifth task involves looking at the particle filter output, and providing a discussion on possible reasons for its behaviour, and how it could be modified to converge on the robot location (note you are not expected to fix this, but rather reflect on why it behaves as it does). The Webots project is available from here and includes the code for the controller as well as the definition of a sample world. The controller includes a number of Java source files, as well as a README file (detailing the role of each of the source files) and a configuration file used to define the map. Details on getting started are included below. When you start up the project (by opening the Assignment 2020.wbt file) you will see a Webots world with an ePuck (model 2), and three overlay displays that can be resized and repositioned. The displays are “attached” to the ePuck’s turret, and are used to assist in observing the state of the robot. Specifically: mapDisplay: provides a graphical representation of the map and the location of the robot (as well as simulated particles); odometryDisplay: visualises the different parameters used in determining the pose updates and odometry of the robot; sensorDisplay: provides an approximate position of the different proximity sensors on the ePuck, as well as their current values. If you start the simulation, you will notice that the mapDisplay and odometryDisplay are both static (i.e. they do not reflect the movement of the ePuck within the simulation). You should see something similar to the following image: 2021/1/8 COMP329 Programming Assignment 2/3 Detailed Task Description The assignment consists of five tests corresponding to different aspects of COMP329. Four are based on augmenting the existing Java code, and the fifth is based on observing the particle filter and discussing its behaviour as well as presenting a hypothesis as to why it doesn’t converge on the robot location. Each task will unlock further functionality of the robot and the displays. Successful completion of the work should result in similar behaviour to the following video: 1×0:00 0:42 Task 1 – Update to improve navigation The navigation of the robot is managed using the navigateRobot() method which modifies the speed of the motors based on detecting obstacles to the left or right of the robot. The current prototype for the method is: public static void navigateRobot(SensorModel sensorModel, Motor leftMotor, Motor rightMotor). You should replace this method with one that explores the environment by turning left 90 degrees ( ) whenever an obstacle is encountered. Note that not all of the environment will be explored, but the aim is to develop a different approach to that provided in the current source. You can make this method as sophisticated or as simple as you like; the marks will be detailed in the rubric but this should not take more than a few hours. Task 2 – Update Odometry in The method updateOdometry() in should be modified to update and track the pose of the robot (based on the wheel encoders), and provide the data that appears in the odometryDisplay. Specifically, the instance variable odometryPose maintains the pose of the robot, and should be updated as the robot moves around the environment. Two wheel 2021/1/8 COMP329 Programming Assignment 3/3 encoders are provided and can be used to determine the new pose of the robot, depending on whether the robot is stationary, moving in a straight line or rotating. You should make use of the notes on COMP329 2 Part 4: Kinematics and Differential Drives to determine changes to the pose. To do this, you will update the current pose based on the wheel encoders, and then calculate the change in odometry – for this you should make use of the notes on COMP329 5 Part 2 The odometry based motion model. The successful completion of this task will result in the robot icon in the mapDisplay moving around and approximating the location of the robot (remember that odometry errors will accumulate), and the details in the odometryDisplay being updated. Furthermore, if completed successfully, the motion model method sample_motion_model(), which is based on the algorithm in COMP329 5 Part 4 Sample Odometry Motion Model, will be used by the Particle filter to predict new positions of the particles as the robot moves, resulting in curved (banana shaped) distributions. Task 3 – Update the likelihood Field Range Finder Model in The method likelihood_field_range_finder_model(Particle xt, MapModel map) takes two arguments, a particle (representing a state) and a map model, and returns the likelihood of the sensor readings based on the known obstacles in the map. The method should implement the algorithm of the same name, which is discussed in the notes on COMP329 6 Part 7: Scan model and Likelihood Fields. A method for determining the nearest feature in a map is already provided in the map model. Likewise, the method for determining the probability for a sensor given a distance measurement is also provided by the Sensor Model. The successful completion of this task will result in the weights of particles changing as they move around the map. You will need to complete the final task before these weights will effect the particles appearing on the map. Task 4 – Write a Monte Carlo sampler in You should implement the stochastic_universal_sampling algorithm that is detailed in the COMP329 7 Part 6: Particle Filter and Monte Carlo Sampling notes, that is responsible for sampling a new set of particles from a previous set, based on the particle weights. This involves generating an array of cumulative weights and a random start point before sampling the weight array at regular weight intervals. The successful completion of this task will result in particles being replaced whenever the robot approaches an obstacle (i.e. when the weights are updated). The current implementation may result in some convergence of particles as the robot moves, but these will not necessarily converge on the true location of the robot. The reasons for this are manyfold and are the subject of the final task (Task 5). Note that if all Tasks 1-4 have been completed, then the resulting behaviour should be similar to the video presented above. Task 5 – Discuss the Particle Filter Behaviour The current particle filter doesn’t necessarily work as expected, with many particles appearing as others disappear. Particles also appear in obstacles, and many can vanish as soon as the robot approaches an obstacle. You should write a short (250-500 word) discussion on why the particle filter behaves as it does. The rubric provides details on the marking schedule, but as a guide, marks will be awarded based on a demonstration of understanding how the particle filter works, and speculation on the causes of the behaviour observed. No coding is required for this task, though it will rely on you looking at the code that has been implem
ented and demonstrating an understanding of its functionality. Submission Instructions Your solution should be submitted ELECTRONICALLY through canvas and should include all of the files for the Webots project (not just the java files), as a single zip file. Remember to include your student ID in your submission. If you experience any problems with submitting your assignment, then please email me ([email protected]) as soon as possible informing me of the problem, and include the latest version of your submission (as a zip file). If more than one submission is made, the latest submission will be marked. Note that details of the rubric will follow shortly. 欢迎咨询51作业君


Author admin

More posts by admin

Leave a Reply