Cardboard Robot SDK
 All Classes Functions Properties
Properties | Public Member Functions | Static Public Member Functions | List of all members
CBDofVector Class Reference

Detailed Description

Represents a vector composed of motor positions (M1, M2, M3), measured in RADIANS, that defines the position or change in position of the robot arm's tip.

When interpreted as a point, the vector (0, 0, 0) generally represents the "home position" of the arm.

#import <CBDofVector.h>

Inheritance diagram for CBDofVector:
<CBVector>

Properties

double m1
 Gets motor #1's position, in radians.
double m2
 Gets motor #2's position, in radians.
double m3
 Gets motor #3's position, in radians.

Public Member Functions

(id) - initWithM1:andM2:andM3:
 Returns a CBDofVector object initialized with the specified motor positions (M1, M2, M3).
(double) - componentWithIndex:
 Returns the value of the component with the given index (0, 1, or 2)
(CBDofVector *) - setComponentWithIndex:toValue:
 Returns a vector with the specified component (0, 1, or 2) set to the given value.
(CBDofVector *) - pointAsDofVectorForRobot:
 Interprets this vector as the position of the arm's tip, and returns its DOF (motor position) representation.
(NSString *) - description
 Returns a string representation of this point.

Static Public Member Functions

(CBDofVector *) + vectorWithM1:andM2:andM3:
 Returns a vector initialized to the specified motor positions (M1, M2, M3).
(CBDofVector *) + zero
 Returns a vector initialized to (0, 0, 0)

Member Function Documentation

- (CBDofVector *) pointAsDofVectorForRobot: (CBRobot *)  robot

Interprets this vector as the position of the arm's tip, and returns its DOF (motor position) representation.

If there is no exact conversion (i.e., the point is outside of the arm's reach), an approximation is returned instead (the closest position that is within reach).

Reimplemented from <CBVector>.

+ (CBDofVector *) vectorWithM1: (double)  m1Pos
andM2: (double)  m2Pos
andM3: (double)  m3Pos 

Returns a vector initialized to the specified motor positions (M1, M2, M3).


The documentation for this class was generated from the following files: