Build text base interface
This commit is contained in:
@@ -1696,6 +1696,12 @@
|
|||||||
<mxCell id="PalTPUc4YgjrWZW5Ocwr-7" value="" style="sketch=0;html=1;aspect=fixed;strokeColor=none;shadow=0;align=center;fillColor=#2D9C5E;verticalAlign=top;labelPosition=center;verticalLabelPosition=bottom;shape=mxgraph.gcp2.check" vertex="1" parent="1">
|
<mxCell id="PalTPUc4YgjrWZW5Ocwr-7" value="" style="sketch=0;html=1;aspect=fixed;strokeColor=none;shadow=0;align=center;fillColor=#2D9C5E;verticalAlign=top;labelPosition=center;verticalLabelPosition=bottom;shape=mxgraph.gcp2.check" vertex="1" parent="1">
|
||||||
<mxGeometry x="101.32999999999993" y="1021" width="40" height="32" as="geometry" />
|
<mxGeometry x="101.32999999999993" y="1021" width="40" height="32" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
|
<mxCell id="PalTPUc4YgjrWZW5Ocwr-8" value="" style="sketch=0;html=1;aspect=fixed;strokeColor=none;shadow=0;align=center;fillColor=#2D9C5E;verticalAlign=top;labelPosition=center;verticalLabelPosition=bottom;shape=mxgraph.gcp2.check" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="85.37999999999994" y="940" width="40" height="32" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="PalTPUc4YgjrWZW5Ocwr-9" value="Missing Offset:" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="840" y="956" width="60" height="30" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
</root>
|
</root>
|
||||||
</mxGraphModel>
|
</mxGraphModel>
|
||||||
</diagram>
|
</diagram>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<mxfile host="Electron" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/26.0.4 Chrome/128.0.6613.186 Electron/32.2.5 Safari/537.36" version="26.0.4">
|
<mxfile host="Electron" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/26.0.4 Chrome/128.0.6613.186 Electron/32.2.5 Safari/537.36" version="26.0.4">
|
||||||
<diagram name="Page-1" id="VLDBnTalcAr4j7jpmEzg">
|
<diagram name="Page-1" id="VLDBnTalcAr4j7jpmEzg">
|
||||||
<mxGraphModel dx="989" dy="600" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
|
<mxGraphModel dx="14340" dy="8380" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
|
||||||
<root>
|
<root>
|
||||||
<mxCell id="0" />
|
<mxCell id="0" />
|
||||||
<mxCell id="1" parent="0" />
|
<mxCell id="1" parent="0" />
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ void GobotRPC_TI_Hardware_RP2040_I2C::i2cRxTask() {
|
|||||||
bool read_res = readI2C(&pkg, addr);
|
bool read_res = readI2C(&pkg, addr);
|
||||||
xSemaphoreGive(i2cMutex);
|
xSemaphoreGive(i2cMutex);
|
||||||
|
|
||||||
|
if(!read_res)
|
||||||
|
continue;
|
||||||
|
|
||||||
pkg.addr |= (i) << 8;
|
pkg.addr |= (i) << 8;
|
||||||
|
|
||||||
if(pushPackageCB != NULL)
|
if(pushPackageCB != NULL)
|
||||||
@@ -54,6 +57,10 @@ bool GobotRPC_TI_Hardware_RP2040_I2C::readI2C(GoRPCPackage_Transport * pkg, uint
|
|||||||
|
|
||||||
size_t len = pkg->data[CI_RX_PACKAGE_DATA_OFFSET + 1];
|
size_t len = pkg->data[CI_RX_PACKAGE_DATA_OFFSET + 1];
|
||||||
|
|
||||||
|
if(len > 64) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
res = i2c_read_blocking(i2c, addr, ((uint8_t *)pkg->data) + CI_RX_PACKAGE_DATA_OFFSET, len, false);
|
res = i2c_read_blocking(i2c, addr, ((uint8_t *)pkg->data) + CI_RX_PACKAGE_DATA_OFFSET, len, false);
|
||||||
pkg->len = len;
|
pkg->len = len;
|
||||||
pkg->addr = addr;
|
pkg->addr = addr;
|
||||||
|
|||||||
BIN
i2c-hub/session3
Normal file
BIN
i2c-hub/session3
Normal file
Binary file not shown.
1
i2c-hub/uart-adapter/cache/boardpos_1736386482.json
vendored
Normal file
1
i2c-hub/uart-adapter/cache/boardpos_1736386482.json
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"pos1": {"x": 1026, "y": 2096}, "pos2": {"x": 16651, "y": 18856}, "pos3": {"x": 1901, "y": 131}}
|
||||||
1
i2c-hub/uart-adapter/cache/scan_result.json
vendored
Normal file
1
i2c-hub/uart-adapter/cache/scan_result.json
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"corexy_available": true, "head_available": true, "vacuum_available": true, "corexy_port": 0, "head_port": 2, "vacuum_port": 1}
|
||||||
BIN
i2c-hub/uart-adapter/src/common/calibrate_boardpos.py
(Stored with Git LFS)
Normal file
BIN
i2c-hub/uart-adapter/src/common/calibrate_boardpos.py
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
i2c-hub/uart-adapter/src/common/i2c_scan.py
(Stored with Git LFS)
Normal file
BIN
i2c-hub/uart-adapter/src/common/i2c_scan.py
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
i2c-hub/uart-adapter/src/gobot.py
(Stored with Git LFS)
Normal file
BIN
i2c-hub/uart-adapter/src/gobot.py
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
i2c-hub/uart-adapter/src/gobotrpc/packages/corexy/packages_goto.py
(Stored with Git LFS)
BIN
i2c-hub/uart-adapter/src/gobotrpc/packages/corexy/packages_goto.py
(Stored with Git LFS)
Binary file not shown.
BIN
i2c-hub/uart-adapter/src/main.py
(Stored with Git LFS)
BIN
i2c-hub/uart-adapter/src/main.py
(Stored with Git LFS)
Binary file not shown.
BIN
i2c-hub/uart-adapter/src/uart_interface/ci_packages.py
(Stored with Git LFS)
BIN
i2c-hub/uart-adapter/src/uart_interface/ci_packages.py
(Stored with Git LFS)
Binary file not shown.
BIN
i2c-hub/uart-adapter/src/uart_interface/serial.py
(Stored with Git LFS)
BIN
i2c-hub/uart-adapter/src/uart_interface/serial.py
(Stored with Git LFS)
Binary file not shown.
@@ -52,12 +52,15 @@ struct BoardMessurements {
|
|||||||
int x_num;
|
int x_num;
|
||||||
int y_num;
|
int y_num;
|
||||||
|
|
||||||
|
int x_offset;
|
||||||
|
int y_offset;
|
||||||
|
|
||||||
int cell_x;
|
int cell_x;
|
||||||
int cell_y;
|
int cell_y;
|
||||||
};
|
};
|
||||||
|
|
||||||
BoardMessurements calcBoardMessurements(MotorPosition p0, MotorPosition p1, int grid_x, int grid_y);
|
BoardMessurements calcBoardMessurements(MotorPosition p0, MotorPosition p1, int grid_x, int grid_y, MotorPosition offset);
|
||||||
MotorPosition calcPosition(BoardMessurements * messurements, int x, int y);
|
MotorPosition calcPosition(BoardMessurements * messurements, int x, int y, bool offset);
|
||||||
|
|
||||||
void vTaskInitMotorHome(void *pvParameters);
|
void vTaskInitMotorHome(void *pvParameters);
|
||||||
|
|
||||||
@@ -94,7 +97,7 @@ public:
|
|||||||
bool getMotorEnabled();
|
bool getMotorEnabled();
|
||||||
|
|
||||||
void setBoardMessurements(BoardMessurements messurements);
|
void setBoardMessurements(BoardMessurements messurements);
|
||||||
void gotoPosition(int x, int y);
|
void gotoPosition(int x, int y, bool offset);
|
||||||
};
|
};
|
||||||
|
|
||||||
void homeXY(TMC2209_step_dual * driver, HOME_AXIS_DIRECTION direction, unsigned int speed, unsigned int backupSpace, MotorPosition * last_pos);
|
void homeXY(TMC2209_step_dual * driver, HOME_AXIS_DIRECTION direction, unsigned int speed, unsigned int backupSpace, MotorPosition * last_pos);
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ void CoreXYMaschine::setBoardMessurements(BoardMessurements messurements) {
|
|||||||
this->boardMessurements = messurements;
|
this->boardMessurements = messurements;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreXYMaschine::gotoPosition(int x, int y) {
|
void CoreXYMaschine::gotoPosition(int x, int y, bool offset) {
|
||||||
xSemaphoreTake(xMoveMutex, portMAX_DELAY);
|
xSemaphoreTake(xMoveMutex, portMAX_DELAY);
|
||||||
MotorPosition pos = calcPosition(&this->boardMessurements, x, y);
|
MotorPosition pos = calcPosition(&this->boardMessurements, x, y, offset);
|
||||||
|
|
||||||
if(posUnknow || untilNextHome == 0) {
|
if(posUnknow || untilNextHome == 0) {
|
||||||
homeFast(¤t_pos, true);
|
homeFast(¤t_pos, true);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
BoardMessurements calcBoardMessurements(MotorPosition p0, MotorPosition p1, int grid_x, int grid_y) {
|
BoardMessurements calcBoardMessurements(MotorPosition p0, MotorPosition p1, int grid_x, int grid_y, MotorPosition offset) {
|
||||||
BoardMessurements res;
|
BoardMessurements res;
|
||||||
|
|
||||||
MotorPosition * smaller;
|
MotorPosition * smaller;
|
||||||
@@ -16,6 +16,9 @@ BoardMessurements calcBoardMessurements(MotorPosition p0, MotorPosition p1, int
|
|||||||
bigger = &p0;
|
bigger = &p0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
res.x_offset = smaller->x - offset.x;
|
||||||
|
res.y_offset = smaller->y - offset.y;
|
||||||
|
|
||||||
res.x_num = grid_x;
|
res.x_num = grid_x;
|
||||||
res.y_num = grid_y;
|
res.y_num = grid_y;
|
||||||
|
|
||||||
@@ -31,11 +34,16 @@ BoardMessurements calcBoardMessurements(MotorPosition p0, MotorPosition p1, int
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
MotorPosition calcPosition(BoardMessurements * messurements, int x, int y) {
|
MotorPosition calcPosition(BoardMessurements * messurements, int x, int y, bool offset) {
|
||||||
MotorPosition res;
|
MotorPosition res;
|
||||||
|
|
||||||
res.x = messurements->x_padding + (x * messurements->cell_x);
|
res.x = messurements->x_padding + (x * messurements->cell_x);
|
||||||
res.y = messurements->y_padding + (y * messurements->cell_y);
|
res.y = messurements->y_padding + (y * messurements->cell_y);
|
||||||
|
|
||||||
|
if(offset) {
|
||||||
|
res.x -= messurements->x_offset;
|
||||||
|
res.y -= messurements->y_offset;
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -155,7 +155,7 @@ void onRxPackage(void * args, char *data, uint16_t len, GobotRPCTypes type, Gobo
|
|||||||
uint8_t cellX = data[24];
|
uint8_t cellX = data[24];
|
||||||
uint8_t cellY = data[25];
|
uint8_t cellY = data[25];
|
||||||
|
|
||||||
BoardMessurements messurements = calcBoardMessurements(p1, p2, cellX, cellY);
|
BoardMessurements messurements = calcBoardMessurements(p1, p2, cellX, cellY, p3);
|
||||||
appData->machine->setBoardMessurements(messurements);
|
appData->machine->setBoardMessurements(messurements);
|
||||||
g_appData.gobotrpc_ni->sendPackage(txBuffer, 0, GobotRPCTypes::RESPONSE, GobotRPCNumber::SET_PADDING);
|
g_appData.gobotrpc_ni->sendPackage(txBuffer, 0, GobotRPCTypes::RESPONSE, GobotRPCNumber::SET_PADDING);
|
||||||
break;
|
break;
|
||||||
@@ -165,7 +165,7 @@ void onRxPackage(void * args, char *data, uint16_t len, GobotRPCTypes type, Gobo
|
|||||||
int x = (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3];
|
int x = (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3];
|
||||||
int y = (data[4] << 24) | (data[5] << 16) | (data[6] << 8) | data[7];
|
int y = (data[4] << 24) | (data[5] << 16) | (data[6] << 8) | data[7];
|
||||||
bool offset = data[8] > 0;
|
bool offset = data[8] > 0;
|
||||||
appData->machine->gotoPosition(x, y);
|
appData->machine->gotoPosition(x, y, offset);
|
||||||
g_appData.gobotrpc_ni->sendPackage(txBuffer, 0, GobotRPCTypes::RESPONSE, GobotRPCNumber::GOTO);
|
g_appData.gobotrpc_ni->sendPackage(txBuffer, 0, GobotRPCTypes::RESPONSE, GobotRPCNumber::GOTO);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user