ARMS  3.1.1
Documentation for ARMS movement library
config.h File Reference

The ARMS configuration file. This file is where you setup everything about your chassis, including the motors, the sensors, and constants. This is also where you will setup autonomous selector. More...

Go to the source code of this file.

Macros

#define ODOM_DEBUG   0
 Odom debug mode. More...
 
#define LEFT_MOTORS   0
 Left chassis motors. More...
 
#define RIGHT_MOTORS   0
 Right chassis motors. More...
 
#define GEARSET   pros::E_MOTOR_GEAR_200
 Chassis gearset. More...
 
#define TPI   0
 Ticks per Inch. More...
 
#define MIDDLE_TPI   0
 Middle Ticks Per Inch. More...
 
#define TRACK_WIDTH   0
 Track Width. More...
 
#define MIDDLE_DISTANCE   0
 Middle Distance. More...
 
#define IMU_PORT   0
 IMU Port. More...
 
#define ENCODER_PORTS   0, 0, 0
 Encoder Ports. More...
 
#define EXPANDER_PORT   0
 Encoder ADI Expander Port. More...
 
#define ENCODER_TYPE   arms::odom::ENCODER_ADI
 Encoder Type. More...
 
#define SLEW_STEP   0
 Slew Step. More...
 
#define LINEAR_EXIT_ERROR   0
 Linear Exit Error. More...
 
#define ANGULAR_EXIT_ERROR   0
 Angular Exit Error. More...
 
#define SETTLE_THRESH_LINEAR   0
 Linear Settle Threshold. More...
 
#define SETTLE_THRESH_ANGULAR   0
 Angular settle threshold. More...
 
#define SETTLE_TIME   0
 Settle Time. More...
 
#define LINEAR_KP   0
 Linear kP. More...
 
#define LINEAR_KI   0
 Linear kI. More...
 
#define LINEAR_KD   0
 Linear kD. More...
 
#define TRACKING_KP   0
 Tracking kP. More...
 
#define ANGULAR_KP   0
 Angular kP. More...
 
#define ANGULAR_KI   0
 Angular kI. More...
 
#define ANGULAR_KD   0
 Angular kD. More...
 
#define LEAD_PCT   0
 Lead Percent. More...
 
#define MIN_ERROR   0
 Minimum Error. More...
 
#define AUTONS   0
 Auton Selector Routines. More...
 
#define HUE   0
 Autonomous Selctor Hue. More...
 
#define DEFAULT   0
 Autonomous Selctor Default Routine. More...
 

Functions

void arms::init ()
 Initialize ARMS using the user defined constants Example 1: More...
 

Detailed Description

The ARMS configuration file. This file is where you setup everything about your chassis, including the motors, the sensors, and constants. This is also where you will setup autonomous selector.

YOU NEED TO REPLACE ALL OF THESE VALUES WITH THE CORRECT VALUES FOR YOUR ROBOT.

Macro Definition Documentation

◆ ANGULAR_EXIT_ERROR

#define ANGULAR_EXIT_ERROR   0

Angular Exit Error.

Parameters
errorthe error to use when exiting angular movement

Example 1:

//using an error of 4 units
#define ANGULAR_EXIT_ERROR 4

Sets the error to use when exiting angular movement to error.

◆ ANGULAR_KD

#define ANGULAR_KD   0

Angular kD.

Parameters
kdthe derivative constant for the angular motion PID controller

Example 1:

//using a kd of 0.5
#define ANGULAR_KD 0.5

Sets the derivative constant for the angular motion PID controller to kd.

◆ ANGULAR_KI

#define ANGULAR_KI   0

Angular kI.

Parameters
kithe integral constant for the angular motion PID controller

Example 1:

//using a ki of 0.5
#define ANGULAR_KI 0.5

Sets the integral constant for the angular motion PID controller to ki.

◆ ANGULAR_KP

#define ANGULAR_KP   0

Angular kP.

Parameters
kpthe proportional constant for the angular motion PID controller

Example 1:

//using a kP of 0.5
#define ANGULAR_KP 0.5

Sets the proportional constant for the angular motion PID controller to kp.

◆ AUTONS

#define AUTONS   0

Auton Selector Routines.

Parameters
auton_namesthe names of your autonomous routines.

Example 1:

//using the autons "left", "middle", "right", and "nothing"
#define AUTONS "left", "middle", "right", "nothing"

Sets the auton names to run. The names should be seprated by commas. The maximum number of autons is 10. This is part of the autonomous selector configuration. More details can be found at selector.h

◆ DEFAULT

#define DEFAULT   0

Autonomous Selctor Default Routine.

Parameters
indexthe index for the default autonomous routine to run.

Example 1:

//using the default auton to be "left"
#define DEFAULT_AUTON 1

Sets the default auton to run. This is part of the autonomous selector configuration. More details can be found at selector.h

◆ ENCODER_PORTS

#define ENCODER_PORTS   0, 0, 0

Encoder Ports.

Parameters
leftthe port the left encoder is plugged into. 0 for disabled.
rightthe port the right encoder is plugged into. 0 for disabled.
middlethe port the middle encoder is plugged into. 0 for disabled.

Example 1:

//using one parrallel encoder, IMU for heading, and not worring about sidways movement
#define ENCODER_PORTS 1, 0, 0

Example 2:

//using all three encoders and no IMU for heading. Heading will be calculated using all 3 encoders.
#define ENCODER_PORTS 1, 3, 5

Sets up the 1-3 encoders being used on the bot. An IMU_PORT should be set if you do not use all 3 encoders. An encoder perpindicular to the chassis (middle) should be used if the robot is expected to be pushed sideways. Negative values reverse the direction of the encoder. A value of 0 disables the encoder and uses the integrated motor encoders instead. The values should be valid smart ports if using the V5 rotation sensor, or odd numbered adi ports if using the optical shaft encoders. This is configured at ENCODER_TYPE If all encoders are disabled, the integrated encoders in the chassis motors will be used.

◆ ENCODER_TYPE

#define ENCODER_TYPE   arms::odom::ENCODER_ADI

Encoder Type.

Parameters
typeThe type of encoder being used

Example 1:

//using the new V5 Rotation sensors
#define ENCODER_TYPE arms::odom::ENCODER_ROTATION

Example 2:

//using the old Optical Shaft Encoders
#define ENCODER_TYPE arms::odom::ENCODER_ADI

Which type of vex encoder is being used on the chassis. Using a mixture of encoder types is not currently supported. This influences what the valid values for ENCODER_PORTS are.

◆ EXPANDER_PORT

#define EXPANDER_PORT   0

Encoder ADI Expander Port.

Parameters
portthe port the ADI expander is plugged into. 0 for disabled.

Example 1:

//using an ADI expander in port 1
#define EXPANDER_PORT 1

Example 2:

//don't use an ADI expander
#define EXPANDER_PORT 0

Uses the expander port in port port for the encoder's configured at ENCODER_PORTS.

◆ GEARSET

#define GEARSET   pros::E_MOTOR_GEAR_200

Chassis gearset.

Parameters
rpmthe rpm of the chassis's motors

Example 1:

//using 200 rpm cartridges
#define GEARSET pros::E_MOTOR_GEAR_200

Sets the robot's chassis gearset to rpm.

◆ HUE

#define HUE   0

Autonomous Selctor Hue.

Parameters
huethe hue of your autonomous selector Example 1:
//using a hue of 60 (yellow)
#define HUE 0

S This is part of the autonomous selector configuration. More details can be found at selector.h

◆ IMU_PORT

#define IMU_PORT   0

IMU Port.

Parameters
portthe port the imu is plugged into. Set to 0 for disabled

Example 1:

//using an IMU in port 8
#define IMU_PORT 8

Example 2:

//don't use an IMU
#define IMU_PORT 0

Sets the chassis' imu to the sensor in port port.

◆ LEAD_PCT

#define LEAD_PCT   0

Lead Percent.

Parameters
pctthe lead percent to use for go to pose movements (boomerang controller)

Example 1:

//using a pct of 0.3
#define LEAD_PCT 0.3

Sets the lead percent to use for go to pose movements to pct. In theory, lower percents will be more linear movements, while higher percents will be more curvy.

◆ LEFT_MOTORS

#define LEFT_MOTORS   0

Left chassis motors.

Parameters
portsthe motor ports on the right side of the chassis

Example 1:

// two motors on the left side of the chassis in ports 4 and 5
#define LEFT_MOTORS 4, 5

Example 2:

// three motors on the left side of the chassis in ports 4, 5, and 6. The motor in port 5 is reversed
#define LEFT_MOTORS 4, -5, 6

Comma seperated ports that the chassis's left motors are in. Negative values reverse the motor on that port.

◆ LINEAR_EXIT_ERROR

#define LINEAR_EXIT_ERROR   0

Linear Exit Error.

Parameters
errorthe error to use when exiting linear movement

Example 1:

//using an error of 4 units
#define LINEAR_EXIT_ERROR 4

Sets the error to use when exiting linear movement to error.

◆ LINEAR_KD

#define LINEAR_KD   0

Linear kD.

Parameters
kdthe derivative constant for the linear motion PID controller

Example 1:

//using a kd of 0.5
#define LINEAR_KD 0.5

Sets the derivative constant for the linear motion PID controller to kd.

◆ LINEAR_KI

#define LINEAR_KI   0

Linear kI.

Parameters
kithe integral constant for the linear motion PID controller

Example 1:

//using a ki of 0.5
#define LINEAR_KI 0.5

Sets the integral constant for the linear motion PID controller to ki.

◆ LINEAR_KP

#define LINEAR_KP   0

Linear kP.

Parameters
kpthe proportional constant for the linear motion PID controller

Example 1:

//using a kP of 0.5
#define LINEAR_KP 0.5

Sets the proportional constant for the linear motion PID controller to kp.

◆ MIDDLE_DISTANCE

#define MIDDLE_DISTANCE   0

Middle Distance.

Parameters
distthe distance between the middle wheel and the center of the robot

Example 1:

//using a middle distance of 2 inches.
#define MIDDLE_DISTANCE 2

◆ MIDDLE_TPI

#define MIDDLE_TPI   0

Middle Ticks Per Inch.

Parameters
mtpiencoder ticks per inch of robot movement for the perpendicular middle wheel

Example 1:

//using a middle tpi of 10.
#define MIDDLE_TPI

Sets the number of middle encoder ticks per inch of perpendicular robot movement to tpi.

◆ MIN_ERROR

#define MIN_ERROR   0

Minimum Error.

Parameters
errorthe minimum error for the robot to be considered at the target position

Example 1:

//using a minimum error of 2
#define MIN_ERROR 2

Sets the minimum error for the robot to be considered at the target position to error.

◆ ODOM_DEBUG

#define ODOM_DEBUG   0

Odom debug mode.

Parameters
dbEnable/disable odom debug

Example 1:

//enable odom debug messages
#define ODOM_DEBUG 1

Example 2:

//disable odom debug messages
#define ODOM_DEBUG 0

Enable/disable odometry debugging messages being sent to the terminal. This can be useful when trying to troubleshoot chassis movements. Note: Enabling odom debug prints the robot's x, y, and angle to the termal 100 times a second. Make sure to connect to your brain with a wire when using this. Connecting wirelessly through the controller will cause values to take dozons of seconds to show up.

◆ RIGHT_MOTORS

#define RIGHT_MOTORS   0

Right chassis motors.

Parameters
portsthe motor ports on the right side of the chassis

Example 1:

// two motors on the right side of the chassis in ports 1 and 2
#define RIGHT_MOTORS 1, 2

Example 2:

// three motors on the right side of the chassis in ports 1, 2, and 3. The motor in port 2 is reversed
#define RIGHT_MOTORS 1, -2, 3

Comma seperated ports that the chassis's right motors are in. Negative values reverse the motor on that port.

◆ SETTLE_THRESH_ANGULAR

#define SETTLE_THRESH_ANGULAR   0

Angular settle threshold.

Parameters
thresholdthe threshold to use when settling angular movement

Example 1:

//using a threshold of 1 units
#define SETTLE_THRESH_ANGULAR 1

Sets the threshold to use when settling angular movement to threshold. The robot is considered settled if it does not move this many units within the duration of SETTLE_TIME.

◆ SETTLE_THRESH_LINEAR

#define SETTLE_THRESH_LINEAR   0

Linear Settle Threshold.

Parameters
thresholdthe threshold to use when settling linear movement

Example 1:

//using a threshold of 1 units
#define SETTLE_THRESH_LINEAR 1

Sets the threshold to use when settling linear movement to threshold. The robot is considered settled if it does not move this many units within the duration of SETTLE_TIME.

◆ SETTLE_TIME

#define SETTLE_TIME   0

Settle Time.

Parameters
timethe time the chassis must be still to be considered settled

Example 1:

//using a settle time of 150 milliseconds
#define SETTLE_TIME 150

Sets the time the chassis must be still to be considered settled to time in milliseconds. A high settle time may make movements take too long to complete, where as a low settle time may cause the robot to exit its movement prematurely.

◆ SLEW_STEP

#define SLEW_STEP   0

Slew Step.

Parameters
stephow much to slew the motors by each time the motors are updated

Example 1:

//using a slew step of 10
#define SLEW_STEP 10

Sets the slew step to step. A smaller value results more slew.

◆ TPI

#define TPI   0

Ticks per Inch.

Parameters
tpithe number of encoder ticks per inch of forward robot movement.

Example 1:

//using a tpi of 10.
#define TPI 10

Sets the number of encoder ticks per inch of forward robot movement to tpi.

◆ TRACK_WIDTH

#define TRACK_WIDTH   0

Track Width.

Parameters
twidthThe track width of the robot (distance between left and right weels)

Example 1:

//using a track width of 16 inches.
#define TRACK_WIDTH 16

Sets the number of encoder ticks per inch of forward robot movement to tpi.

◆ TRACKING_KP

#define TRACKING_KP   0

Tracking kP.

Parameters
trackkpthe proportional constant for turning strength during point to point movements

Example 1:

//using a Tracking kP of 60
#define TRACKING_KP 60

sets the proportional constant for turning strength during point to point movements to trackkp

Function Documentation

◆ init()

void arms::init ( )
inline

Initialize ARMS using the user defined constants Example 1:

// initalize arms
void init()
Initialize ARMS using the user defined constants Example 1:
Definition: config.h:566

initialize ARMS (pid, chassis, odom, etc) using the defined constants in config.h