{"id":181,"date":"2024-07-11T23:26:40","date_gmt":"2024-07-11T23:26:40","guid":{"rendered":"https:\/\/vrobotsim.com\/nishant\/?p=181"},"modified":"2024-07-12T00:31:38","modified_gmt":"2024-07-12T00:31:38","slug":"intro-to-motor-power","status":"publish","type":"post","link":"https:\/\/vrobotsim.com\/nishant\/?p=181","title":{"rendered":"Intro to Motor Power"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Setting motor power<\/h2>\n\n\n\n<p>The following code blocks drive the robot forward for two seconds at a power of 0.2. After that we want it to strafe to the right. If we set the frontLeft power to 0.2, what would we set the other values to? Try this out in the app and then come back here to see the answer.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"542\" height=\"680\" src=\"https:\/\/vrobotsim.com\/nishant\/wp-content\/uploads\/2024\/07\/image.png\" alt=\"\" class=\"wp-image-182\" srcset=\"https:\/\/vrobotsim.com\/nishant\/wp-content\/uploads\/2024\/07\/image.png 542w, https:\/\/vrobotsim.com\/nishant\/wp-content\/uploads\/2024\/07\/image-239x300.png 239w, https:\/\/vrobotsim.com\/nishant\/wp-content\/uploads\/2024\/07\/image-535x671.png 535w\" sizes=\"(max-width: 542px) 100vw, 542px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">What power should I use?<\/h2>\n\n\n\n<p>Often in programming you need to set a value. Sometimes you have the opportunity to define what that value means before setting it, but often you have to work within the constraints of the existing software. In this case, the \u201cpower\u201d value we \u201cset\u201d for each wheel is determined by the VRS App. The only way you can figure out what the power should be is to experiment. Remember: in most cases you don\u2019t have to use whole numbers only; numbers can be negative, decimals, or both!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What now?<\/h2>\n\n\n\n<p>Ok so we\u2019ve successfully set the power of motors, now what? Well, if we simply wanted a robot that rams things at high speed, we are done. Most of the time, though, we want our robots to behave a bit more deliberately, so we need to introduce some more commands so our robot will move forward AND backward AND forward again (as many times for as far a distance as we want).<\/p>\n\n\n\n<p>Now that you understand how to stack code blocks to make the virtual robot move, you can make it go forward and backwards. Try it yourself in the app, then return here to see the way we did it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What causes a turn?<\/h2>\n\n\n\n<p>Turning is easy if you\u2019re driving a car\u2013 you just turn the wheel and the wheels (connected by the steering axle and some gears) turn to point in the direction you want the car to go. Turning the virtual robot is\u2026 not so straightforward.<\/p>\n\n\n\n<p>Try to imagine how you might turn the robot, then match the words in this quiz to complete the idea correctly.<\/p>\n\n\n\n<p>You can control the strength of the turn, also known as the turn radius, by adjusting the strength of these values. Which of the following would execute the tightest (smallest radius) turn?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is strafing?<\/h2>\n\n\n\n<p>A \u201cstrafe\u201d maneuver might be familiar to you if you\u2019ve ever played a First Person Shooter-style video game. Your character typically moves forward and backward using the left thumbstick up and down directions (or W and S on a keyboard), and looks around using the right thumbstick (or the mouse if you\u2019re using a mouse). Your character \u201cstrafes\u201d when using left and right on a thumbstick (or A and D on a keyboard). It\u2019s just another way of saying \u201cmove side to side without turning\u201d.<\/p>\n\n\n\n<p>The robot (both real and virtual) uses special wheels that allow it to strafe when all four turn in the correct direction in relation to each other. Those who want to try and figure it out on their own should use the app and experiment with different values.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to learn Java using blocks<\/h2>\n\n\n\n<p>As we learned in the introductory lesson, code blocks are a method for writing code. Just as a programming language like Java provides programmers a way to write machine code in a more understandable way, code blocks provide a way to write Java in a more understandable way. It is not necessary to learn Java\u2013 coding blocks are a completely viable method for controlling the robot, but for those who are interested in learning Java for its power and versatility, code blocks are an excellent learning tool.<\/p>\n\n\n\n<p>The VRS app allows you to switch back and forth between blocks and Java at the click of a button. This enables you to see the Java code you have created using the blocks, and understand its syntax.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introducing how to make your robot move, turn, and strafe<\/p>\n","protected":false},"author":1,"featured_media":183,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[114],"tags":[],"class_list":["post-181","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/vrobotsim.com\/nishant\/wp-content\/uploads\/2024\/07\/Screenshot-2024-07-11-at-4.26.20\u202fPM.png","_links":{"self":[{"href":"https:\/\/vrobotsim.com\/nishant\/index.php?rest_route=\/wp\/v2\/posts\/181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vrobotsim.com\/nishant\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vrobotsim.com\/nishant\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vrobotsim.com\/nishant\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vrobotsim.com\/nishant\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=181"}],"version-history":[{"count":7,"href":"https:\/\/vrobotsim.com\/nishant\/index.php?rest_route=\/wp\/v2\/posts\/181\/revisions"}],"predecessor-version":[{"id":194,"href":"https:\/\/vrobotsim.com\/nishant\/index.php?rest_route=\/wp\/v2\/posts\/181\/revisions\/194"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vrobotsim.com\/nishant\/index.php?rest_route=\/wp\/v2\/media\/183"}],"wp:attachment":[{"href":"https:\/\/vrobotsim.com\/nishant\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vrobotsim.com\/nishant\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vrobotsim.com\/nishant\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}