Telemetry is the process of collecting and transmitting data. In robotics ,telemetry is used to output internal data from the actuators and sensors to the Driver Hub. It is a way for the robot to communicate back to you the programmer what the robot thinks its doing or seeing. This information can then be used to improve your code, make adjustments to a mechanism, or to strategize when driving around the field if competing.
For OnBot Java we can use the following to request the servo's position:
We already have a couple lines of telemetry within our code to let us know what state our program is in: "Initialized" or "Running". Below our if/else if statement we can add another telemetry.addData();
.
First, we need to add a "string" or the text that we want to appear on our Driver Hub. For now we will enter this as "Servo Position"
. After our comma, we will add the data we want outputted to the Driver Hub, which is test_servo.getPosition();
.