|Download Help (Windows Only)|
Requires: LabVIEW Robotics Starter Kit
Writes an angle to the servo on which the distance sensor is mounted to turn the servo to that angle. Note that the servo angle is different from the sensor angle if the servo and the sensor are not aligned.
|Note The maximum range the servo motor can turn is ± / 2 radians, or ±90°.|
|starter kit host in is a reference to the communication session between the host VI and the FPGA on the robot. Use the Starter Kit initialization VI that is appropriate for your application to generate this LabVIEW class object.|
|ccw servo angle (rad) specifies the angle, in radians, to which to turn the sensor servo. The angle is measured counterclockwise from the center of the robot as you view the robot from above. Thus, positive values turn the servo to the left of center, and negative values turn the servo to the right.|
|error in describes error conditions that occur before this node runs. This input provides standard error in functionality.|
|starter kit host out is a reference to the communication session between the host VI and the FPGA on the robot. You can wire this output to other Starter Kit VIs.|
|error out contains error information. This output provides standard error out functionality.|
You can use this VI to change the orientation of the sensor and then use the Read PING))) Sensor Distance VI to read the distance to any obstacles at that sensor angle. Pair the servo angle you write with this VI and the distance value the Read PING))) Sensor Distance VI reads to identify the exact location of obstacles in relation to the robot. When you know the angle and distance to an obstacle, you can write code to adjust the robot motor velocities to avoid the obstacle.
Refer to the following VIs for examples of using the Write Sensor Servo Angle VI: