Data Logging in the Virtual Robotics Toolkit
Data logging in the Virtual Robotics Toolkit can be done by attaching various sensors to your robot. To begin, navigate to the attachments window in the simulation environment by clicking
Once in the attachments window, begin to add sensors to your robot. For example, you could add an ultrasonic sensor, colour sensor, and gyro sensor.
Each type of sensor records a different type of data. For example, ultrasonic sensors are able to measure distance between your robot and an object in the distance, whether it be a wall, structure, or otherwise. When this sensor is attached, one of the robot's eyes will emit a high-pitched ping, while the other eye listens for the ping's echo. By noticing the time difference between the ping and the echo, the robot is able to calculate the distance between itself and the object.
When driving your robot, you will notice that your robot is also emitting a colour beam. This is a visual representation of its ultrasonic sensing capabilities. The closer the robot gets to the object in front of it, the warmer its colour will become. When the robot is far away from the object in front of it, its laser will be green. When the robot is extremely close to the object in front of it, the colour of its beam will become red.
Other sensors, such as colour sensors and gyro sensors, notice the robot's physical position on the mat and elements on the mat itself. They record data about light intensity of colours on the mat and the robot's physical location, respectively.
1. Using the Realtime Data Window
The Virtual Robotics Toolkit has the ability to provide real-time data from the simulated environment. Real-time data includes, but is not limited to, data on your robot's motors.
To view this information, start the simulator by pressing the Play button, and then click on the Real-Time Data toolbar button.
2. Using the Virtual Brick
Navigate to the third tab on the EV3 virtual brick by clicking on the virtual buttons.
Under the third tab, you will see options such as Port View, Motor Control, IR Control, and Brick Program. Select Port View by clicking the middle button on the virtual brick.
Selecting Port View will provide you with the data your sensors are collecting. These values will change as your robot moves and interacts with different elements of the simulated environment. Navigate between ports by clicking the left and right buttons on the virtual brick.
For example, using the Gyro sensor, we can collect data about the robot's physical location on the mat. This sensor will provide a reading of 0 degrees by default when the robot has not moved.
This reading will change when the robot rotates in either direction.
3. Using the LEGO EV3 Programming Environment
You can also use the EV3 Programming environment to view the data your robot's sensors record. To do this, start by opening up a new project in the LEGO EV3 Programming environment window by clicking the plus icon in the top left corner of the window.
Once you've opened up a new project, you'll need to connect the virtual robot to the programming environment. Ensure that WIFI is enabled by clicking the box underneath the WIFI icon.
Robot is not connected to the programming environment
Robot is connected to the programming environment
To view the data your robot's sensors are collecting, click on the Port View icon on the far left of this box.
When your robot is moving around and interacting with the simulated environment, you'll be able to see all of the data its collecting by looking at each of the ports.
Powered by Froala Editor