Telemetry
Have you wanted to see how your robot perceives the world? Well then, telemetry is for you! Telemetry refers to the process of collecting and transmitting data from the robot to a driver station or computer. This data can include sensor readings (like color, distance, or touch), motor power, and other relevant information. Telemetry shows up in the top right side of the robot testing screen.
Telemetry readings are an important part in debugging and troubleshooting problems as you can easily tell if there is a mismatch between the robot and your expectations.
Using telemetry is simple. Whenever you want to read something in your code use the addData block:
.
This block has several variants but in essence the key is the label for the lower value. It's important to denote the key as it is your primary method of figuring out what the telemetry value is.
The second, lower value can be anything: numbers, text, etc, it just depends on the block.
For example:
Will tell you the velocity of the frontLeft motor.
Repeat the addData block for each data value you want to see.
Then call the update block to have the key and value displayed on the telemetry output screen.
So what is happening? Well the addData block adds data to the telemetry. The repeated addData blocks will continue to add more data to the telemetry. But why does the data now show up immediately in the output then? Well, the output shown is a snapshot of a previous version of the telemetry. When you update the telemetry again, the VRS will convert the current telemetry into readable text and display that. Afterwards, it will clear out the telemetry so that new data can be added.
This single display form of telemetry is useful for letting you know what part of the program you are on. It is common to add a
while waiting for the program to start in order to let the driver know that the code has been successfully initialized. Such text is invaluable in helping the driver to quickly check if the code is working or not.
Another common way to use telemetry is in a loop. In the example:
The telemetry
will provide a constant update on the power of each motor. This updating information is great for real time feedback of the robot, helping to quickly identify errors or flaws in code.
Although telemetry may not directly affect the robot, it is nevertheless an important tool at a programmer’s disposal. Good telemetry can greatly speed up coding and provide feedback for drivers, resulting in more points scored. This often is the difference between a good robot and a great robot.