THE ANNIN ROBOTICS FORUM HAS MOVED TO A NEW COMMUNITY. 👉
robodk new drive cr...
 
Notifications
Clear all

robodk new drive creation

1 Posts
1 Users
0 Reactions
118 Views
대나무 가을
(@bamboo-in-autumn)
Active Member
Joined: 3 months ago
Posts: 2
Topic starter  

Movement and Issues

The linker movement is fine.. but if you do the same movement twice, it moves again and the third error remains

It seems like there is no position comparison statement for the movement on the board

I'm still working on fixing it to catch the error. I don't really know.

// 이전 위치 저장용 (글로벌 변수로 선언)

float lastX, lastY, lastZ, lastRz, lastRy, lastRx;

 

// tolerance 설정

const float coordTolerance = 0.01;

 

bool isSamePosition(float x, float y, float z, float rz, float ry, float rx) {

return (fabs(x - lastX) < coordTolerance &&

fabs(y - lastY) < coordTolerance &&

fabs(z - lastZ) < coordTolerance &&

fabs(rz - lastRz) < coordTolerance &&

fabs(ry - lastRy) < coordTolerance &&

fabs(rx - lastRx) < coordTolerance);

}

=================

if (isSamePosition(x, y, z, rz, ry, rx)) {

Serial.println("Same position - skipping move.");

return; // 현재 위치와 같으면 이동 생략

}

 

// 이동 실행 후 현재 위치 저장

lastX = x; lastY = y; lastZ = z;

lastRz = rz; lastRy = ry; lastRx = rx;

 

https://anninrobotics.com/wp-content/uploads/2025/07/robodk-new-drive-creation.mp4

https://anninrobotics.com/wp-content/uploads/2025/07/robodk-new-drive-creation_2.mp4

 

This topic was modified 2 months ago by 대나무 가을

   
Quote
Topic Tags
Share:
Upload your Photo