GCVelocityControl Class Reference
Inherits from | NSObject |
---|---|
Declared in | GCVelocityControl.h |
Overview
The GCVelocityControl object allows you to control Galileo’s angular velocity for a given axis. You can access the instance through the velocityControlForAxis:
method of the Galileo
singleton instance.
Control is performed by setting a target velocity. Galileo will attempt to accelerate to reach the target velocity as fast and as smoothly as possible. Setting the target velocity whilst Galileo is already moving will cause Galileo to immediately begin accelerating towards the new target velocity. Once the target velocity is reached, Galileo will continue moving at a constant velocity until a new target velocity is supplied.
Detecting when target velocity is reached
controlDidReachTargetVelocity
Block-based handler for when target velocity is reached.
@property (nonatomic, copy) void ( ^ ) ( void ) controlDidReachTargetVelocity
Declared In
GCVelocityControl.h
delegate
Delegate-based handler for when target velocity is reached.
@property (nonatomic, assign) id<GCVelocityControlDelegate> delegate
Discussion
The delegate must adopt the GCVelocityControlDelegate protocol. Delegate is not retained.
Declared In
GCVelocityControl.h
atTargetVelocity
True if the accessory is cruising at the target velocity. False if the accessory is still accelerating towards the target velocity.
@property (nonatomic, readonly, getter=isAtTargetVelocity) BOOL atTargetVelocity
Declared In
GCVelocityControl.h
Controlling the target velocity
targetVelocity
The target velocity, in degrees per second.
@property (nonatomic) double targetVelocity
Discussion
Upon setting the target velocity, Galileo will attempt to accelerate to reach the target velocity as fast and as smoothly as possible. Setting the target velocity whilst Galileo is already moving will cause Galileo to immediately begin accelerating towards the new target velocity. Once the target velocity is reached, Galileo will continue moving at a constant velocity until a new target velocity is supplied.
Declared In
GCVelocityControl.h
Accessing control parameters
velocity
The current velocity Galileo is moving at, in degrees per second.
@property (nonatomic, readonly) double velocity
Declared In
GCVelocityControl.h
maxVelocity
The maximum velocity Galileo is able to move at, in degrees per second.
@property (nonatomic, readonly) double maxVelocity
Declared In
GCVelocityControl.h
minVelocity
The minimum velocity Galileo is able to move at, in degrees per second.
@property (nonatomic, readonly) double minVelocity
Declared In
GCVelocityControl.h
torque
Motor torque setting as a percentage of maximum possible.
@property (nonatomic) double torque
Discussion
A larger torque setting is useful to prevent stalling at greater velocities. Use a smaller torque setting to conserve power during low velocity operation.
Warning: Using a torque setting larger than the default for extended periods may causing heating and damage the motors.
Declared In
GCVelocityControl.h