Skip to main content
Version: 3.2.1

Slew

note

Click here for documentation on slew for each movement in EZ-Template!

Slew Class​

slew()​

Creates a slew object with constants. Robot will start at min_speed and will be at the maximum set speed once distance is traveled.

distance distance to travel until maximum speed is reached.
minimum_speed starting speed.

slew(double distance, int minimum_speed);

constants_set()​

Sets slew constants.

distance distance to travel until maximum speed is reached.
minimum_speed starting speed.

void constants_set(double distance, int minimum_speed);

initialize()​

Setup for slew. Keeps track of where the starting sensor value is and what the maximum target speed is.

enabled true if you want slew to run, false if you don't.
maximum_speed the target speed for the robot to reach.
target the distance to reach before max speed is hit.
current the current sensor value.

void initialize(bool enabled, double maximum_speed, double target, double current);

iterate()​

Iterates slew calculation and returns what the current max speed should be.

current the current sensor value.

double iterate(double current);

output()​

Returns what the current max speed should be.

double output();

enabled()​

Returns if slew is currently active or not.

double output();

speed_max_set()​

Sets the max speed slew can be.

speed maximum speed the output can be

void speed_max_set(double speed);

speed_max_set()​

Returns the max speed slew can be.

double speed_max_get();

/**

  • Sets the max speed the slew can be
  • \param speed
  • maximum speed */ void speed_max_set(double speed);

/**

  • Returns the max speed the slew can be */ double speed_max_get();