69 uint8_t heading_use_mpu;
137 static const uint8_t EEPROM_IMG_OFFSET;
139 uint8_t eeprom_img [32];
149 bool are_compois_daisy_chained;
159 uint32_t dribbler_pin;
177 void load_saved_info ();
179 void store_saved_info ();
181 void set_motor_port (
const uint8_t mtr_idx,
const uint8_t port);
183 uint8_t get_motor_port (
const uint8_t mtr_idx);
185 void set_compoi_port (
const uint8_t idx,
const uint8_t port);
187 uint8_t get_compoi_port (
const uint8_t idx);
189 void set_compoi_addr (
const uint8_t idx,
const uint8_t addr);
191 uint8_t get_compoi_addr (
const uint8_t idx);
193 void set_uts_mode (
const uint8_t side,
const uint8_t mode);
195 uint8_t get_uts_mode (
const uint8_t side);
197 void set_uts_port (
const uint8_t side,
const uint8_t port);
199 uint8_t get_uts_port (
const uint8_t side);
201 void set_heading_port (
const uint8_t port);
203 uint8_t get_heading_port ();
205 void set_heading_addr (
const uint8_t addr);
207 uint8_t get_heading_addr ();
209 void set_cam_port (
const uint8_t port);
211 uint8_t get_cam_port ();
213 void set_cam_baud (
const uint32_t baud);
215 uint32_t get_cam_baud ();
217 void set_kicker_pin (
const uint32_t pin);
219 uint32_t get_kicker_pin ();
221 void set_dribbler_pin (
const uint32_t pin);
223 uint32_t get_dribbler_pin ();
225 void set_comm_port (
const uint8_t port);
227 uint8_t get_comm_port ();
229 void set_comm_baud (
const uint32_t baud);
231 uint32_t get_comm_baud ();
266 void polar_ctrl (int16_t angle, int16_t spd, int16_t rotation);
278 void rect_ctrl (int16_t spd_x, int16_t spd_y, int16_t rotation);
300 bool move_to (
const uint8_t side1,
const int16_t dist1,
const uint8_t side2,
const int16_t dist2,
const int16_t target_heading = 0,
const double rotation_kp = 1.2,
const int16_t spd = 100,
const int16_t threshold = 1);
509 size_t print(
const __FlashStringHelper *);
510 size_t print(
const String &);
511 size_t print(
const char[]);
513 size_t print(
unsigned char,
int = DEC);
514 size_t print(
int,
int = DEC);
515 size_t print(
unsigned int,
int = DEC);
516 size_t print(
long,
int = DEC);
517 size_t print(
unsigned long,
int = DEC);
518 size_t print(
double,
int = 2);
521 size_t write(uint8_t);
Jason robot
The robot object.
side_t
4 sides.
Definition Jason.h:563
@ back
Back side.
Definition Jason.h:582
@ left
Left side.
Definition Jason.h:572
@ front
Front side.
Definition Jason.h:567
@ right
Right side.
Definition Jason.h:577
mtr_idx_t
Motor indices.
Definition Jason.h:536
@ RB
Right-Back motor.
Definition Jason.h:550
@ LF
Left-Front motor.
Definition Jason.h:540
@ RF
Right-Front motor.
Definition Jason.h:545
@ LB
Left-Back motor.
Definition Jason.h:555
Compound Eye Driver for XRCU.
Definition CompoI.h:21
Definition HardwareSerial.h:99
JM9_packer(HardwareSerial &init_uart, const uint8_t init_start_byte)
Creates a packer.
JM9_unpacker(HardwareSerial &init_uart, const uint8_t init_start_byte)
Creates an unpacker.
Jason Driver for XRCU.
Definition Jason.h:132
int16_t get_ir_max_val()
Gets the maximum value read by all IR channels.
void set_motor_spd(const uint8_t mtr_idx, int16_t spd)
Sets the speed of a motor.
virtual int16_t get_opponent_goal_angle()
Gets the angle to the opponent's goal (in degrees).
void end()
Deactivates the robot and releases all occupied resources.
virtual int16_t get_orange_ball_angle()
Gets the angle to the orange ball (in degrees).
int16_t get_heading()
Gets the heading of the robot.
int16_t get_ir_avg_val()
Gets the average value read by all IR channels.
int16_t get_rotation_spd(const int16_t target_heading=0)
Gets the rotation speed of the robot.
virtual void gs()
Do something about the grayscales.
void enable_uts(const uint8_t side)
Enables an ultrasonic sensor of one side.
virtual int16_t get_my_goal_dist()
Gets the distance to my goal.
virtual int16_t get_my_goal_angle()
Gets the angle to my goal (in degrees).
virtual void set_dribbler_spd(const int16_t spd)
Sets the spinning speed of the dribbler.
bool move_to(const uint8_t side1, const int16_t dist1, const uint8_t side2, const int16_t dist2, const int16_t target_heading=0, const double rotation_kp=1.2, const int16_t spd=100, const int16_t threshold=1)
Moves the robot to a specific position.
void clear_mon()
Clears everything on the monitor.
~Jason()
Destroys a robot object.
void begin()
Activates the robot and configure the peripherals.
void reset_heading()
Resets the heading of the robot.
virtual int16_t get_orange_ball_dist()
Gets the distance to the orange ball.
int8_t get_ir_max_idx()
Gets the channel number of the maximum valued IR channel.
virtual bool get_kicker_state()
Gets whether the kicker is "kicked" (extended) or retracted.
int16_t get_ir_ball_angle()
Gets the IR ball angle (in degrees).
void rect_ctrl(int16_t spd_x, int16_t spd_y, int16_t rotation)
Sets the rectangular (cartesian) speed of the robot.
virtual void set_kicker_state(const bool state)
Sets whether the kicker is "kicked" (extended) or retracted.
Jason()
Creates a robot object.
void set_cursor(int16_t x, int16_t y)
Sets the cursor to print text on the monitor.
int16_t get_uts_dist(const uint8_t side)
Gets the ultrasonic sensor distance of one side.
void polar_ctrl(int16_t angle, int16_t spd, int16_t rotation)
Sets the polar speed of the robot.
void disable_uts(const uint8_t side)
Disables an ultrasonic sensor of one side.
virtual int16_t get_opponent_goal_dist()
Gets the distance to the opponent's goal.
MPU-6050 Accel and Gyro with DMP Driver for XRCU.
Definition Mpu_6050_dmp.h:75
Motor Driver for XRCU.
Definition Motors.h:20
Definition Printable.h:33
QMC5883L Compass Driver for XRCU.
Definition Qmc5883l.h:21
Serial_packer(HardwareSerial &init_uart, const uint8_t init_start_byte)
Creates a packer.
Serial_unpacker(HardwareSerial &init_uart, const uint8_t init_start_byte)
Creates an unpacker.
Ultrasonic Sensor Driver (TRIG-ECHO Polling) for XRCU.
Definition Uts_gpio.h:31
Ultrasonic Sensor Driver (I2C) for XRCU.
Definition Uts_i2c.h:24
Ultrasonic Sensor Driver (UART) for XRCU.
Definition Uts_uart.h:26
VL53L0X LiDAR Driver for XRCU.
Definition Vl53l0x.h:30
Heading pointer type.
Definition Jason.h:64
UART connection pointer type.
Definition Jason.h:77
Ultrasonics all-in-one pointer type.
Definition Jason.h:49