top of page
WFU Robotics

2: Viewpoint Control and Robot Programming

Updated: Mar 8, 2021

Once you select the Viewpoint Control benchmark, click on the blue bottom labeled “Start programming this benchmark”. After a brief loading screen you should be greeted with a robot sitting on a checkered wooden floor. From here you should read the overview, instructions, and metrics tabs. If you accidentally close this information window, you can reopen it by clicking the “i” button at the bottom left of the Webots window. The way this website “grades” you is a percentage based on how close you are to what they want. So once you figure out how to move the camera/viewpoint and generally have what they want, feel free to click the record button under the metrics tab. Once you do that it may prompt you to login to save your score but you can just click the x and then click the “power button” at the bottom left of the window. This will bring you back to the main menu. Now that you have learned how to move the camera, let’s learn how to program a robot in this environment!


For the Robot Programming benchmark, I recommend reading the overview and the instructions. When you open the controller, by right clicking on the robot and selecting “Edit controller”, note that you can resize the window and move it around. As the instructions say, try to change the value of the target variable so that the robot finishes in the middle of the target. After you try a couple of target values or wish to stop, take a look at the Explanations tab. Here, the math behind driving the robot forward using the target value is explained. With this newfound knowledge, try to find the perfect target distance. Note that the wheel has a radius of 21 millimeters and that the distance that you need to travel is 250 millimeters. Below is the explanation for how to calculate the correct value, so stop here and try to figure it out yourself.


Solution:


To solve this you must first calculate the circumference of the wheel (c=2πr). From there you divide the distance you want to travel by the circumference to get the amount of revolutions. Since we do not want this number in terms of revolutions, you can multiply the value by (2π)/(1 revolution), since those two values are the same and the revolutions units will cancel. Now you have the value you want to set as the target. I also recommend taking a look at the code at the bottom. This is a standard method for setting the position of the motor.

6 views0 comments

Recent Posts

See All

Comments


bottom of page