67 uint8_t heading_use_mpu;
101 const uint8_t start_byte;
124 bool send (
const uint8_t *
const tx_buf,
const uint8_t tx_buf_len);
137 const uint8_t start_byte;
250 #define EEPROM_IMG_OFFSET 0x50
252 uint8_t eeprom_img [32];
266 uint32_t dribbler_pin;
284 void load_saved_info ();
286 void store_saved_info ();
288 void set_motor_port (
const uint8_t mtr_idx,
const uint8_t port);
290 uint8_t get_motor_port (
const uint8_t mtr_idx);
292 void set_compoi_port (
const uint8_t idx,
const uint8_t port);
294 uint8_t get_compoi_port (
const uint8_t idx);
296 void set_compoi_addr (
const uint8_t idx,
const uint8_t addr);
298 uint8_t get_compoi_addr (
const uint8_t idx);
300 void set_uts_mode (
const uint8_t side,
const uint8_t mode);
302 uint8_t get_uts_mode (
const uint8_t side);
304 void set_uts_port (
const uint8_t side,
const uint8_t port);
306 uint8_t get_uts_port (
const uint8_t side);
308 void set_heading_port (
const uint8_t port);
310 uint8_t get_heading_port ();
312 void set_heading_addr (
const uint8_t addr);
314 uint8_t get_heading_addr ();
316 void set_cam_port (
const uint8_t port);
318 uint8_t get_cam_port ();
320 void set_cam_baud (
const uint32_t baud);
322 uint32_t get_cam_baud ();
324 void set_kicker_pin (
const uint32_t pin);
326 uint32_t get_kicker_pin ();
328 void set_dribbler_pin (
const uint32_t pin);
330 uint32_t get_dribbler_pin ();
332 void set_comm_port (
const uint8_t port);
334 uint8_t get_comm_port ();
336 void set_comm_baud (
const uint32_t baud);
338 uint32_t get_comm_baud ();
373 void polar_ctrl (int16_t angle, int16_t spd, int16_t rotation);
385 void rect_ctrl (int16_t spd_x, int16_t spd_y, int16_t rotation);
407 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);
616 size_t print(
const __FlashStringHelper *);
617 size_t print(
const String &);
618 size_t print(
const char[]);
620 size_t print(
unsigned char,
int = DEC);
621 size_t print(
int,
int = DEC);
622 size_t print(
unsigned int,
int = DEC);
623 size_t print(
long,
int = DEC);
624 size_t print(
unsigned long,
int = DEC);
625 size_t print(
double,
int = 2);
628 size_t write(uint8_t);
side_t
4 sides.
Definition Jason.h:670
@ back
Back side.
Definition Jason.h:689
@ left
Left side.
Definition Jason.h:679
@ front
Front side.
Definition Jason.h:674
@ right
Right side.
Definition Jason.h:684
mtr_idx_t
Motor indices.
Definition Jason.h:643
@ RB
Right-Back motor.
Definition Jason.h:657
@ LF
Left-Front motor.
Definition Jason.h:647
@ RF
Right-Front motor.
Definition Jason.h:652
@ LB
Left-Back motor.
Definition Jason.h:662
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
bool send(const uint8_t *const tx_buf, const uint8_t tx_buf_len)
Creates and sends a packet.
Definition Jason.cpp:52
HardwareSerial & uart
The underlying UART object.
Definition Jason.h:107
HardwareSerial & uart
The underlying UART object.
Definition Jason.h:197
uint8_t get_packet_len()
Gets the length of the received data.
Definition Jason.cpp:157
bool update()
Checks if a new packet is received.
Definition Jason.cpp:89
JM9_unpacker(HardwareSerial &init_uart, const uint8_t init_start_byte)
Creates an unpacker.
Definition Jason.cpp:65
~JM9_unpacker()
Destroys this unpacker.
Definition Jason.cpp:77
uint8_t * get_packet_ptr()
Gets the pointer to the received data.
Definition Jason.cpp:153
Jason Driver for XRCU.
Definition Jason.h:245
int16_t get_ir_max_val()
Gets the maximum value read by all IR channels.
Definition Jason.cpp:683
void set_motor_spd(const uint8_t mtr_idx, int16_t spd)
Sets the speed of a motor.
Definition Jason.cpp:592
virtual void set_kicker_state(const bool state)
Sets whether the kicker is "kicked" (extended) or retracted.
Definition Jason.cpp:882
void end()
Deactivates the robot and releases all occupied resources.
Definition Jason.cpp:588
int16_t get_heading()
Gets the heading of the robot.
Definition Jason.cpp:825
int16_t get_ir_avg_val()
Gets the average value read by all IR channels.
Definition Jason.cpp:689
int16_t get_rotation_spd(const int16_t target_heading=0)
Gets the rotation speed of the robot.
Definition Jason.cpp:847
virtual bool get_kicker_state()
Gets whether the kicker is "kicked" (extended) or retracted.
Definition Jason.cpp:886
void enable_uts(const uint8_t side)
Enables an ultrasonic sensor of one side.
Definition Jason.cpp:799
virtual void set_dribbler_spd(const int16_t spd)
Sets the spinning speed of the dribbler.
Definition Jason.cpp:890
virtual int16_t get_opponent_goal_dist()
Gets the distance to the opponent's goal.
Definition Jason.cpp:866
virtual int16_t get_my_goal_dist()
Gets the distance to my goal.
Definition Jason.cpp:874
virtual int16_t get_my_goal_angle()
Gets the angle to my goal (in degrees).
Definition Jason.cpp:878
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:626
void clear_mon()
Clears everything on the monitor.
Definition Jason.cpp:894
~Jason()
Destroys a robot object.
Definition Jason.cpp:208
void begin()
Activates the robot and configure the peripherals.
Definition Jason.cpp:461
virtual void gs()
Do something about the grayscales.
Definition Jason.cpp:679
void reset_heading()
Resets the heading of the robot.
Definition Jason.cpp:837
virtual int16_t get_opponent_goal_angle()
Gets the angle to the opponent's goal (in degrees).
Definition Jason.cpp:870
int8_t get_ir_max_idx()
Gets the channel number of the maximum valued IR channel.
Definition Jason.cpp:705
virtual int16_t get_orange_ball_angle()
Gets the angle to the orange ball (in degrees).
Definition Jason.cpp:862
int16_t get_ir_ball_angle()
Gets the IR ball angle (in degrees).
Definition Jason.cpp:725
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:617
virtual int16_t get_orange_ball_dist()
Gets the distance to the orange ball.
Definition Jason.cpp:858
Jason()
Creates a robot object.
Definition Jason.cpp:161
void set_cursor(int16_t x, int16_t y)
Sets the cursor to print text on the monitor.
Definition Jason.cpp:898
int16_t get_uts_dist(const uint8_t side)
Gets the ultrasonic sensor distance of one side.
Definition Jason.cpp:743
void polar_ctrl(int16_t angle, int16_t spd, int16_t rotation)
Sets the polar speed of the robot.
Definition Jason.cpp:603
void disable_uts(const uint8_t side)
Disables an ultrasonic sensor of one side.
Definition Jason.cpp:773
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:26
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:62
UART connection pointer type.
Definition Jason.h:75
Ultrasonics all-in-one pointer type.
Definition Jason.h:47