Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Write Sensor Servo Angle VI

LabVIEW 2013 Robotics Module Help

Edition Date: June 2013

Part Number: 372983D-01

»View Product Info

Requires: LabVIEW Robotics Starter Kit

Owning Palette: Starter Kit 1.0 VIs, Starter Kit 2.0 VIs

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°.

Details  Examples

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.

Write Sensor Servo Angle Details

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.

Examples

Refer to the following VIs for examples of using the Write Sensor Servo Angle VI:

  • labview\examples\robotics\Starter Kit 1.0\Starter Kit 1.0.lvproj
  • labview\examples\robotics\Starter Kit 2.0\Starter Kit 2.0.lvproj

 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit