41#include <Serial_packer.h>
42#include <Serial_unpacker.h>
69 uint8_t heading_use_mpu;
137 static const uint8_t EEPROM_IMG_OFFSET;
139 uint8_t eeprom_img [32];
153 uint32_t dribbler_pin;
171 void load_saved_info ();
173 void store_saved_info ();
175 void set_motor_port (
const uint8_t mtr_idx,
const uint8_t port);
177 uint8_t get_motor_port (
const uint8_t mtr_idx);
179 void set_compoi_port (
const uint8_t idx,
const uint8_t port);
181 uint8_t get_compoi_port (
const uint8_t idx);
183 void set_compoi_addr (
const uint8_t idx,
const uint8_t addr);
185 uint8_t get_compoi_addr (
const uint8_t idx);
187 void set_uts_mode (
const uint8_t side,
const uint8_t mode);
189 uint8_t get_uts_mode (
const uint8_t side);
191 void set_uts_port (
const uint8_t side,
const uint8_t port);
193 uint8_t get_uts_port (
const uint8_t side);
195 void set_heading_port (
const uint8_t port);
197 uint8_t get_heading_port ();
199 void set_heading_addr (
const uint8_t addr);
201 uint8_t get_heading_addr ();
203 void set_cam_port (
const uint8_t port);
205 uint8_t get_cam_port ();
207 void set_cam_baud (
const uint32_t baud);
209 uint32_t get_cam_baud ();
211 void set_kicker_pin (
const uint32_t pin);
213 uint32_t get_kicker_pin ();
215 void set_dribbler_pin (
const uint32_t pin);
217 uint32_t get_dribbler_pin ();
219 void set_comm_port (
const uint8_t port);
221 uint8_t get_comm_port ();
223 void set_comm_baud (
const uint32_t baud);
225 uint32_t get_comm_baud ();
260 void polar_ctrl (int16_t angle, int16_t spd, int16_t rotation);
272 void rect_ctrl (int16_t spd_x, int16_t spd_y, int16_t rotation);
294 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);
503 size_t print(
const __FlashStringHelper *);
504 size_t print(
const String &);
505 size_t print(
const char[]);
507 size_t print(
unsigned char,
int = DEC);
508 size_t print(
int,
int = DEC);
509 size_t print(
unsigned int,
int = DEC);
510 size_t print(
long,
int = DEC);
511 size_t print(
unsigned long,
int = DEC);
512 size_t print(
double,
int = 2);
515 size_t write(uint8_t);
side_t
4 sides.
Definition Jason.h:557
@ back
Back side.
Definition Jason.h:576
@ left
Left side.
Definition Jason.h:566
@ front
Front side.
Definition Jason.h:561
@ right
Right side.
Definition Jason.h:571
mtr_idx_t
Motor indices.
Definition Jason.h:530
@ RB
Right-Back motor.
Definition Jason.h:544
@ LF
Left-Front motor.
Definition Jason.h:534
@ RF
Right-Front motor.
Definition Jason.h:539
@ LB
Left-Back motor.
Definition Jason.h:549
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.
Definition Jason.cpp:45
JM9_unpacker(HardwareSerial &init_uart, const uint8_t init_start_byte)
Creates an unpacker.
Definition Jason.cpp:51
Jason Driver for XRCU.
Definition Jason.h:132
int16_t get_ir_max_val()
Gets the maximum value read by all IR channels.
Definition Jason.cpp:581
void set_motor_spd(const uint8_t mtr_idx, int16_t spd)
Sets the speed of a motor.
Definition Jason.cpp:490
virtual void set_kicker_state(const bool state)
Sets whether the kicker is "kicked" (extended) or retracted.
Definition Jason.cpp:780
void end()
Deactivates the robot and releases all occupied resources.
Definition Jason.cpp:486
int16_t get_heading()
Gets the heading of the robot.
Definition Jason.cpp:723
int16_t get_ir_avg_val()
Gets the average value read by all IR channels.
Definition Jason.cpp:587
int16_t get_rotation_spd(const int16_t target_heading=0)
Gets the rotation speed of the robot.
Definition Jason.cpp:745
virtual bool get_kicker_state()
Gets whether the kicker is "kicked" (extended) or retracted.
Definition Jason.cpp:784
void enable_uts(const uint8_t side)
Enables an ultrasonic sensor of one side.
Definition Jason.cpp:697
virtual void set_dribbler_spd(const int16_t spd)
Sets the spinning speed of the dribbler.
Definition Jason.cpp:788
virtual int16_t get_opponent_goal_dist()
Gets the distance to the opponent's goal.
Definition Jason.cpp:764
virtual int16_t get_my_goal_dist()
Gets the distance to my goal.
Definition Jason.cpp:772
virtual int16_t get_my_goal_angle()
Gets the angle to my goal (in degrees).
Definition Jason.cpp:776
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.
Definition Jason.cpp:524
void clear_mon()
Clears everything on the monitor.
Definition Jason.cpp:792
~Jason()
Destroys a robot object.
Definition Jason.cpp:104
void begin()
Activates the robot and configure the peripherals.
Definition Jason.cpp:359
virtual void gs()
Do something about the grayscales.
Definition Jason.cpp:577
void reset_heading()
Resets the heading of the robot.
Definition Jason.cpp:735
virtual int16_t get_opponent_goal_angle()
Gets the angle to the opponent's goal (in degrees).
Definition Jason.cpp:768
int8_t get_ir_max_idx()
Gets the channel number of the maximum valued IR channel.
Definition Jason.cpp:603
virtual int16_t get_orange_ball_angle()
Gets the angle to the orange ball (in degrees).
Definition Jason.cpp:760
int16_t get_ir_ball_angle()
Gets the IR ball angle (in degrees).
Definition Jason.cpp:623
void rect_ctrl(int16_t spd_x, int16_t spd_y, int16_t rotation)
Sets the rectangular (cartesian) speed of the robot.
Definition Jason.cpp:515
virtual int16_t get_orange_ball_dist()
Gets the distance to the orange ball.
Definition Jason.cpp:756
Jason()
Creates a robot object.
Definition Jason.cpp:57
void set_cursor(int16_t x, int16_t y)
Sets the cursor to print text on the monitor.
Definition Jason.cpp:796
int16_t get_uts_dist(const uint8_t side)
Gets the ultrasonic sensor distance of one side.
Definition Jason.cpp:641
void polar_ctrl(int16_t angle, int16_t spd, int16_t rotation)
Sets the polar speed of the robot.
Definition Jason.cpp:501
void disable_uts(const uint8_t side)
Disables an ultrasonic sensor of one side.
Definition Jason.cpp:671
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
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