This repository has been archived on 2025-06-01. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
compLIB/server/include/robot.hpp
2022-03-21 22:37:13 +00:00

27 lines
No EOL
782 B
C++

#ifndef COMPLIB_SERVER_ROBOT_HPP
#define COMPLIB_SERVER_ROBOT_HPP
#define PI 3.14159265359L
#define WHEEL_CIRCUMFERENCE_MM (71.0L * PI)
#define TICKS_PER_TURN (27.7L * 100.0L)
#define ARBOR_LENGTH_MM 139.0L
#define ARBOR_LENGTH_M (ARBOR_LENGTH_MM / 1000.0L)
#define TICKS_PER_METER (1000.0L / WHEEL_CIRCUMFERENCE_MM * TICKS_PER_TURN)
#define MOTOR_COUNT 4
#define MAX_MOTOR_SPEED 65535
#define MOTOR_MAX_DELTA_TIME_S 0.1L
#define MOTOR_FILTER_ALPHA 0.05L
#define MOTOR_FILTER_RESET_DELAY_US (1000 * 10)
#define MOTOR_SPEED_CONTROL_RESET_DELAY_S 0.01L
#define MOTOR_SPEED_CONTROL_LOOP_HZ 150
#define MOTOR_SPEED_CONTROL_KP 0.5L
#define MOTOR_SPEED_CONTROL_KI 5.0L
#define MOTOR_SPEED_CONTROL_KD 0.025L
#define LEFT_PORT 3
#define RIGHT_PORT 0
#endif // COMPLIB_SERVER_ROBOT_HPP