<commit_before>/*Added command line arguments
when executing the following line at the command line prompt, an 'r' is sent over the serial connection to the arduino and the arduino dumps its data back in response
candii_motorcomm r
in order to write to a variable on the arduino, type the foloowing line into the command prompt. replace #1 with the number of the variable that you wish to write to, and replace #2 with the value you wish to write to that variable.
candii_motorcomm w #1 #2

when #1=0, the variable being written to is "leftMotorSpeed"
when #1=1, the variable being written to is "rightMotorSpeed"
when #1=2, the variable being written to is "softEStop"

leftMotorSpeed and rightMotorSpeed can have values between 0 and 255 inclusive. a value of 127 stops the motors. positive values spin the motors forward. negative values spin the motors in reverse.

setting softEStop to anything other than 0 makes the motors stop moving until it is cleared.
*/

#include "candii_serial.h"
#include "candii_motorcomm.h"
#include <stdio.h>

#define WAIT_TIME 20 //Used for setting VTIME, each tick is 0.1 s
#define BAUD B9600  //Serial baudrate
#define DEFAULT_SERIAL "/dev/ttyUSB0"

//The structure arduino_motor_reply_t defines and receives data that is read from the arduino-based motor control board.

typedef struct {
	uint8_t HWESTOP; //0 if Hardware Estop is untriggered, 1 if it is
	uint8_t AUTOMAN; //0 if the robot is operating in autonomous mode, 1 if manual control is active
	uint8_t PATHNAV; //0 if the robot is in autonomous path following mode, 1 if the robot is in autonomous waypoint navigation mode
	uint8_t CURRENTLEFT1; //Upper byte of the left motor current sensor's 10 bit reading
	uint8_t CURRENTLEFT2; //Lower byte of the left motor current sensor's 10 bit reading
	uint8_t CURRENTRIGHT1; //Upper byte of the right motor current sensor's 10 bit reading
	uint8_t CURRENTRIGHT2; //Lower byte of the right motor current sensor's 10 bit reading
	uint8_t LOGICBATT1; //Upper byte of the logic battery system's voltage 10 bit reading
	uint8_t LOGICBATT2; //Lower byte of the logic battery system's voltage 10 bit reading
	uint8_t MOTORBATT1; //Upper byte of the motor battery system's voltage 10 bit reading
	uint8_t MOTORBATT2; //Lower byte of the motor battery system's voltage 10 bit reading
} arduino_motor_reply_t;


int main(int argc, char *argv[]) {
	int fd = 0;<commit_msg>edited comments<commit_after>/*Added command line arguments
when executing the following line at the command line prompt, an 'r' is sent over the serial connection to the arduino and the arduino dumps its data back in response
candii_motorcomm r
in order to write to a variable on the arduino, type the foloowing line into the command prompt. replace #1 with the number of the variable that you wish to write to, and replace #2 with the value you wish to write to that variable.
candii_motorcomm w #1 #2

when #1=0, the variable being written to is "leftMotorSpeed"
when #1=1, the variable being written to is "rightMotorSpeed"
when #1=2, the variable being written to is "softEStop"

leftMotorSpeed and rightMotorSpeed can have values between 0 and 255 inclusive. a value of 128 stops the motors. positive values spin the motors forward. negative values spin the motors in reverse.

setting softEStop to anything other than 0 makes the motors stop moving until it is cleared.
*/

#include "candii_serial.h"
#include "candii_motorcomm.h"
#include <stdio.h>

#define WAIT_TIME 20 //Used for setting VTIME, each tick is 0.1 s
#define BAUD B9600  //Serial baudrate
#define DEFAULT_SERIAL "/dev/ttyUSB0"

//The structure arduino_motor_reply_t defines and receives data that is read from the arduino-based motor control board.

typedef struct {
	uint8_t HWESTOP; //0 if Hardware Estop is untriggered, 1 if it is
	uint8_t AUTOMAN; //0 if the robot is operating in autonomous mode, 1 if manual control is active
	uint8_t PATHNAV; //0 if the robot is in autonomous path following mode, 1 if the robot is in autonomous waypoint navigation mode
	uint8_t CURRENTLEFT1; //Upper byte of the left motor current sensor's 10 bit reading
	uint8_t CURRENTLEFT2; //Lower byte of the left motor current sensor's 10 bit reading
	uint8_t CURRENTRIGHT1; //Upper byte of the right motor current sensor's 10 bit reading
	uint8_t CURRENTRIGHT2; //Lower byte of the right motor current sensor's 10 bit reading
	uint8_t LOGICBATT1; //Upper byte of the logic battery system's voltage 10 bit reading
	uint8_t LOGICBATT2; //Lower byte of the logic battery system's voltage 10 bit reading
	uint8_t MOTORBATT1; //Upper byte of the motor battery system's voltage 10 bit reading
	uint8_t MOTORBATT2; //Lower byte of the motor battery system's voltage 10 bit reading
} arduino_motor_reply_t;


int main(int argc, char *argv[]) {
	int fd = 0;
{'fraction_non_alphanumeric': 0.05116472545757072, 'fraction_numerical': 0.02870216306156406, 'mean_word_length': 4.477220956719818, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4925447', 'n_tokens_mistral': 1523, 'n_tokens_neox': 1370, 'n_words': 734}