Charge cycles added (6hrs)

Heading orientation fixed
This commit is contained in:
Mee2001 2021-06-15 13:33:58 +01:00
parent f0c4567102
commit 7dd064afe9
2 changed files with 5 additions and 4 deletions

View file

@ -256,11 +256,11 @@
var data = JSON.parse(raw_data); var data = JSON.parse(raw_data);
state = data.st; state = data.st;
batteryLevel = data.bV; batteryLevel = data.bL;
batteryVoltage = data.bV; batteryVoltage = data.bV;
batteryCycles = data.bC; batteryCycles = data.bC;
totalTripDistance = data.tD; totalTripDistance = data.tD;
currentHeading = data.cH + 180; currentHeading = 180 - data.cH;
current_pos = data.pos; current_pos = data.pos;
current_x = current_pos[0]; current_x = current_pos[0];
current_y = current_pos[1]; current_y = current_pos[1];
@ -349,7 +349,7 @@
function moveCmd(dist,hdg,spd){ function moveCmd(dist,hdg,spd){
mode = 1; mode = 1;
reqDistance = dist; reqDistance = dist;
reqHeading = hdg; reqHeading = 360 - hdg;
reqSpeed = spd; reqSpeed = spd;
reqCharge = 0; reqCharge = 0;
pstop_time = 0; pstop_time = 0;

View file

@ -410,7 +410,8 @@ void sendToCommand()
tdoc["bV"] = batteryVoltage; tdoc["bV"] = batteryVoltage;
tdoc["bL"] = 100; // tdoc["bL"] = batteryLevel; Hardcoded value as Energy is not present on demo Rover tdoc["bL"] = 100; // tdoc["bL"] = batteryLevel; Hardcoded value as Energy is not present on demo Rover
time(&now); time(&now);
tdoc["bC"] = (now - 1623750000)/21600; // tdoc["bC"] = batteryCycles; Estimates cycles in number of 6 hour periods // Serial.println(now);
tdoc["bC"] = ((float)now - 1623000000.0)/21600.0; // tdoc["bC"] = batteryCycles; Estimates cycles in number of 6 hour periods
tdoc["tD"] = odometer; tdoc["tD"] = odometer;
tdoc["cH"] = heading; tdoc["cH"] = heading;
tdoc["pos"][0] = xpos; tdoc["pos"][0] = xpos;