Distributed Intelligent Systems and Algorithms Laboratory EPFL 1 Lab 7: Coordinated and collective movements in Webots This laboratory requires the following equipment: • • • • C programming tools (gcc, make) Webots simulation software Webots User Guide Webots Reference Manual Office hours Additional assistance outside the lab period (office hours) can be requested using the dis-ta@groupes.epfl.ch mailing list. 1.1 Information In the following text you will find several exercises and questions. • The notation Sx means that the question can be solved using only additional simulation. • The notation Qx means that the question can be answered theoretically, without any simulation; if you decide to write a report, your answers to these questions should be submitted in your report. The length of answers should be approximately two sentences unless otherwise noted. • The notation Ix means that the problem has to be solved by implementing a piece of code and performing a simulation. • The notation Bx means that the question is optional and should be answered if you have enough time at your disposal. To prepare you for the graded homework sessions, we show an indicative number of points for each exercise between parentheses. The combined total number of points for this laboratory exercise is 100. 2 Formation Control For some applications (e.g., lawn-mowing, vacuum cleaning) it might be useful for having your multi-robot system maintain a relative formation (i.e. if the robots form a line, and the leader turns, the follower robots also turn, maintaining the line). Figure 1 shows an example of this type of behavior. You will now implement an algorithm able to maintain a robot formation using robot wheel speeds. Q1 (15): Write the equations for the left and right wheel speeds of robot 2 (vl2, vr2) as a function of robot 1 (vl1, vr1), shown in Figure 1, as they move along the trajectory shown (a translation of a length T and a rotation in formation of radius R) while maintaining the distance d between them. Give the piecewise-continuous trajectory ξ I (t ) as well, using the forward kinematic model presented in lecture 4 and assuming an initial position of (0, 0). Use SG, AP, Lab 7: Coordinated and collective movements in Webots 1 Distributed Intelligent Systems and Algorithms Laboratory EPFL the axle length a in your equations. Hint: Remember that tangential speed v = ωR, where ω is the angular speed and R is the radius. I2(10): Implement these equations in follower1.c using flocking1.wbt and leader.c. In this situation, robot 2 can observe the wheel speeds of robot 1, and robot 3 can observe the wheel speeds of robot 2 (robot 3 should use the same equations as robot 2 by symmetry). In order to activate this simulation, press play, and then click your world and use the arrow keys to make the leader move. You should initially just have the leader travel in a circle, with no obstacles, but may try more complicated formations if you wish. Take note of how the system performs. S3: Try changing the leader speed to different values (in leader.c). Note what happens when turning if you set the leader speed to a very high value. Figure 1: The robot formation first translates a length T with velocity v and than rotates along a circle of radius R with angular velocity ω. d represents the inter-robot separation that should be maintained during the movement. 3 Robust Formation Control using Relative Localization In this part, you will attempt to implement formation movement using the relative positions of robots. Followers should maintain the values of the leader robot’s relative range, bearing, and relative heading (orientation) so that the formation is not broken. Reminder: The range is the distance between leader and follower, and the bearing is the relative angular offset of the leader’s location in radians, i.e., 0 is straight ahead, -π/2 is directly right, π/2 is directly left. The relative heading is the difference between the two robots’ absolute heading, i.e., 0 means the two robots are facing the same way, -π/2 means the leader is facing West when the follower is facing North, and π/2 means the leader is facing East when the follower is facing North. SG, AP, Lab 7: Coordinated and collective movements in Webots 2 Distributed Intelligent Systems and Algorithms Laboratory EPFL 3.1 Odometry First, we will update the relative positioning by using the robot’s odometry equations. Open the flocking2.wbt world. The robots begin in a diamond formation with the leader at the head. Just like in section 2, the leader robot sends its wheel speeds to the other robots. The other robots use their wheel speeds as well as the leader’s wheel speeds to keep track of the range, bearing and relative heading. Q4(30): Assume that a follower robot does not move. Write the equations, calculating the new range, bearing and relative heading of the leader after Δt seconds, given the leader wheel speeds vl1, vr1, the old range d, the old bearing θ and the old heading φ. Hint: transform to x,y coordinates. I5(15): Open follower2.c. Implement this equation in the function update_leader_motion. Hint: look at the function update_self_motion, which updates the relative positioning assuming that the leader does not move and only the follower moves. I6(20): Now that each follower is able to track the leader, implement a simple control that updates its speed, allowing it to maintain the formation. Add your code to the function compute_wheel_speeds. Try your code by using the arrow keys to control the leader movements. Hint: Try to use a simple proportional controller, which tries to reach the target range and bearing values (goal_range, goal_bearing). S7: Open follower2_noise.wbt. The robots now have wheel slip. Compare the performance of this scenario to that of the previous exercise. 3.2 Range and bearing Now, seeing how the performance deteriorates with increasing odometry uncertainty, we equip our robots with modules that directly provide the robots with (noise-less) relative range and bearing measurements. Open flocking3.wbt. I8(5): Look at follower3.c. Copy the control function compute_wheel_speeds that you implemented in I6, modify the function update_leader_measurement, to account for the additional range and bearing measurements, and finally test your code. Compare the performance with that of S7. S9: Decrease the update rate of the range and bearing module. In order to do this, go into the Scene-tree and open the Supervisor node. Change the 2nd value in the controllerArgs field: the value is equivalent to the interval between two measurements, measured in robot steps; try the values 10, 20 30, etc. How does this affect the performance? Q10(5): Can you think of a way to alleviate this effect? 3.3 Fusion of Range and bearing and Odometry Finally, we will try to combine your code of I6 with that of I8, in order to fuse the information obtained from odometry as well as from the range and bearing module. B11(10): Open flocking4.wbt, follower4.c and introduce your code from I6 and I8. S12: Open tester.wbt and run it. The leader now moves randomly and the performance of your flocking algorithm is output into the console (1 is perfect and 0 is bad). Try to reach a performance of at least 0.7. SG, AP, Lab 7: Coordinated and collective movements in Webots 3