{"id":14042,"date":"2020-08-17T14:09:04","date_gmt":"2020-08-17T04:09:04","guid":{"rendered":"http:\/\/legoeng.local\/?p=14042"},"modified":"2020-08-21T13:04:10","modified_gmt":"2020-08-21T03:04:10","slug":"program-virtual-robots-using-gears","status":"publish","type":"post","link":"http:\/\/legoeng.local\/program-virtual-robots-using-gears\/","title":{"rendered":"Program Virtual Robots using Gears"},"content":{"rendered":"

By guest contributor, Cort Wee, creator of Ev3devSim and Gears<\/em><\/p>\n

Hi all. I\u2019m Cort, the creator of Gears<\/a><\/em>, the successor of\u00a0Ev3devSim<\/a>. Ev3devSim is a 2D robotics simulator I created to aid in teaching Python for the EV3, but I have found the 2D environment and lack of physics simulation rather limiting. My current project, Gears, is a free and opensource 3D robotics simulator that runs in a browser (no login or accounts required). It is available here<\/a> or, if you prefer, you can download it from Github<\/a> and run it on your own server.<\/p>\n

Some of the features of Gears include…<\/p>\n

Multi-Robots Arena<\/h2>\n
\"\"<\/a>
Run multiple robots simultaneously<\/figcaption><\/figure>\n

The ability to work with or compete against a friend can be a powerful motivator. In Arena mode, Gears can run multiple robots simultaneously, either competing or cooperating with each other to complete a mission. Currently, there are arenas for robot paintball matches, collaborative item collection challenges, two to four-way sumo matches, and a blank arena for synchronized movements (or just general fooling around).<\/p>\n

Customizable Robots<\/h2>\n

Gears comes with seven pre-configured robots to choose from, but you can also customize your own robots with any combinations of sensors and actuators. Components can be placed anywhere on the robot and in any orientation (e.g. forward-facing color sensor). They can also be attached to actuators (e.g. ultrasonic sensor attached to a motorized swivel platform) and be rotated or moved independent from the robot body.<\/p>\n

Realistic Physics<\/h2>\n
\"\"<\/a>
Gears simulates realistic physics<\/figcaption><\/figure>\n

Just like a real robot, a GearsBot won\u2019t move straight<\/a> without a line or gyro to follow. This creates the opportunity for experimenting with many of the techniques used with a real robot (e.g. PID control).<\/p>\n

Blockly Enhancements<\/h2>\n

One drawback in using Scratch or Makecode as a replacement for EV3G is that larger programs with many functions are messy and difficult to manage. Gears uses Blockly (the same engine behind Scratch and Makecode) to power its blocks-based interface, but adds a multi-page system to facilitate organization of code; similar to EV3G, but without forcing its use.<\/p>\n

Code reuse is an important programming principle that is difficult to practice in many blocks-based coding environments. To encourage code reuse, Gears provides a function import feature. Students can use it to import useful functions that they have built for a previous mission into their current program.<\/p>\n

Blocks to Python to Physical Robot<\/h2>\n

Block-based programming is great for learning coding basics, but for more complex programs, the expressiveness of a text-based language is far superior. Gears automatically converts its block program into Python and produces Python code that is compatible with either Ev3dev or Pybricks. The user can edit the generated Python code or write their entire program in Python from the start. Besides running it in the simulator, the Python code can also be uploaded and run on a real EV3 brick.<\/p>\n

Built-in and Customizable Challenges<\/h2>\n

Gears comes with many built-in challenges. These include topics-based challenges (e.g. line following, obstacle avoidance), as well as some mission-based challenges (e.g. rescue victims from a burning building). You can also create your own game world; just upload your own image to use as a map, then optionally add obstacles and items to pick up.<\/p>\n

\"\"<\/a>
Create your own challenge environments<\/figcaption><\/figure>\n

The Future…<\/h2>\n

At the time of writing this, Gears is only a couple months old, and I\u2019m actively enhancing it whenever I can find the time. If you would like to help, one of the biggest thing you can do is to simply use it and provide feedback, suggestions, and bug reports.<\/p>\n

Try out Gears here<\/a>\u00a0and help spread the word!<\/p>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

By guest contributor, Cort Wee, creator of Ev3devSim and Gears Hi all. I\u2019m Cort, the creator of Gears, the successor of\u00a0Ev3devSim. Ev3devSim is a 2D robotics simulator I created to aid in teaching Python for the EV3, but I have found the 2D environment and lack of physics simulation rather limiting. My current project, Gears, […]<\/p>\n","protected":false},"author":410,"featured_media":14045,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[604,19],"tags":[323,558],"_links":{"self":[{"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/posts\/14042"}],"collection":[{"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/users\/410"}],"replies":[{"embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/comments?post=14042"}],"version-history":[{"count":0,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/posts\/14042\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/media\/14045"}],"wp:attachment":[{"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/media?parent=14042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/categories?post=14042"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/tags?post=14042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}